remove hash_map/hash_set; replace with std::unordered_map|set

This commit is contained in:
Laurent Perron
2017-04-27 14:14:05 +02:00
parent bb865b6667
commit 4db7d3bc4e
63 changed files with 219 additions and 631 deletions

View File

@@ -331,7 +331,7 @@ bool ConstraintImpactComparator(FapConstraint constraint1,
}
int64 ValueEvaluator(
hash_map<int64, std::pair<int64, int64>>* value_evaluator_map,
std::unordered_map<int64, std::pair<int64, int64>>* value_evaluator_map,
int64 variable_index, int64 value) {
CHECK_NOTNULL(value_evaluator_map);
// Evaluate the choice. Smaller ranking denotes a better choice.
@@ -344,7 +344,7 @@ int64 ValueEvaluator(
}
// Update the history of assigned values and their rankings of each variable.
hash_map<int64, std::pair<int64, int64>>::iterator it;
std::unordered_map<int64, std::pair<int64, int64>>::iterator it;
int64 new_value = value;
int64 new_ranking = ranking;
if ((it = value_evaluator_map->find(variable_index)) !=
@@ -579,7 +579,7 @@ void HardFapSolver(const std::map<int, FapVariable>& data_variables,
ChooseVariableStrategy(&variable_strategy);
// Choose the value selection strategy.
DecisionBuilder* db;
hash_map<int64, std::pair<int64, int64>> history;
std::unordered_map<int64, std::pair<int64, int64>> history;
if (FLAGS_value_evaluator == "value_evaluator") {
LOG(INFO) << "Using ValueEvaluator for value selection strategy.";
Solver::IndexEvaluator2 index_evaluator2 = [&history](int64 var,
@@ -864,7 +864,7 @@ int main(int argc, char** argv) {
std::vector<operations_research::FapConstraint> constraints;
std::string objective;
std::vector<int> values;
hash_map<int, operations_research::FapComponent> components;
std::unordered_map<int, operations_research::FapComponent> components;
operations_research::ParseInstance(FLAGS_directory, FLAGS_find_components,
&variables, &constraints, &objective,
&values, &components);