remove hash_map/hash_set; replace with std::unordered_map|set
This commit is contained in:
@@ -2378,7 +2378,7 @@ class PositiveBooleanScalProdEqCst : public Constraint {
|
||||
class ExprLinearizer : public ModelParser {
|
||||
public:
|
||||
explicit ExprLinearizer(
|
||||
hash_map<IntVar*, int64>* const variables_to_coefficients)
|
||||
std::unordered_map<IntVar*, int64>* const variables_to_coefficients)
|
||||
: variables_to_coefficients_(variables_to_coefficients), constant_(0) {}
|
||||
|
||||
~ExprLinearizer() override {}
|
||||
@@ -2639,7 +2639,7 @@ class ExprLinearizer : public ModelParser {
|
||||
|
||||
// We do need a IntVar* as key, and not const IntVar*, because clients of this
|
||||
// class typically iterate over the map keys and use them as mutable IntVar*.
|
||||
hash_map<IntVar*, int64>* const variables_to_coefficients_;
|
||||
std::unordered_map<IntVar*, int64>* const variables_to_coefficients_;
|
||||
std::vector<int64> multipliers_;
|
||||
int64 constant_;
|
||||
};
|
||||
@@ -2677,7 +2677,7 @@ void DeepLinearize(Solver* const solver, const std::vector<IntVar*>& pre_vars,
|
||||
}
|
||||
if (need_linearization) {
|
||||
// Instrospect the variables to simplify the sum.
|
||||
hash_map<IntVar*, int64> variables_to_coefficients;
|
||||
std::unordered_map<IntVar*, int64> variables_to_coefficients;
|
||||
ExprLinearizer linearizer(&variables_to_coefficients);
|
||||
for (int i = 0; i < pre_vars.size(); ++i) {
|
||||
linearizer.Visit(pre_vars[i], pre_coefs[i]);
|
||||
@@ -3201,7 +3201,7 @@ IntExpr* MakeScalProdFct(Solver* solver, const std::vector<IntVar*>& pre_vars,
|
||||
}
|
||||
|
||||
IntExpr* MakeSumFct(Solver* solver, const std::vector<IntVar*>& pre_vars) {
|
||||
hash_map<IntVar*, int64> variables_to_coefficients;
|
||||
std::unordered_map<IntVar*, int64> variables_to_coefficients;
|
||||
ExprLinearizer linearizer(&variables_to_coefficients);
|
||||
for (int i = 0; i < pre_vars.size(); ++i) {
|
||||
linearizer.Visit(pre_vars[i], 1);
|
||||
|
||||
Reference in New Issue
Block a user