Skip to content

Commit

Permalink
support Visual studio 2013 using Solver::IndexEvaluator2
Browse files Browse the repository at this point in the history
  • Loading branch information
Driss Lahlou committed Nov 4, 2016
1 parent d1688a1 commit a220b1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 6 additions & 4 deletions examples/cpp/frequency_assignment_problem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,12 @@ void HardFapSolver(const std::map<int, FapVariable>& data_variables,
hash_map<int64, std::pair<int64, int64>> history;
if (FLAGS_value_evaluator == "value_evaluator") {
LOG(INFO) << "Using ValueEvaluator for value selection strategy.";
db = solver.MakePhase(variables, variable_strategy,
[&history](int64 var, int64 value) {
return ValueEvaluator(&history, var, value);
});
Solver::IndexEvaluator2 index_evaluator2 = [&history](int64 var,
int64 value) {
return ValueEvaluator(&history, var, value);
};
LOG(INFO) << "Using ValueEvaluator for value selection strategy.";
db = solver.MakePhase(variables, variable_strategy, index_evaluator2);
} else {
LOG(INFO) << "Using Solver::ASSIGN_MIN_VALUE for value selection strategy.";
db = solver.MakePhase(variables, variable_strategy,
Expand Down
8 changes: 4 additions & 4 deletions src/base/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ struct StdArrayHasher : public stdext::hash_compare<std::array<T, N>> {
#if defined(_MSC_VER)
namespace stdext {
template <>
inline size_t hash_value <std::pair<int64, int64>> (
const std::pair<int64, int64>& a) {
inline size_t hash_value<std::pair<int64, int64>>(
const std::pair<int64, int64>& a) {
PairIntHasher pairIntHasher;
return pairIntHasher(a);
}
return pairIntHasher(a);
}
} // namespace stdext
#endif // _MSC_VER

Expand Down
1 change: 0 additions & 1 deletion src/flatzinc/sat_fz_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

#include "flatzinc/sat_fz_solver.h"

#include "base/timer.h"
#include "base/map_util.h"
#include "flatzinc/checker.h"
Expand Down

0 comments on commit a220b1b

Please sign in to comment.