various compilation fixed for visual studio 2013

This commit is contained in:
Laurent Perron
2017-04-18 00:08:19 +02:00
parent be1b75a8f6
commit 787d8075c2
4 changed files with 8 additions and 5 deletions

View File

@@ -1177,7 +1177,7 @@ std::function<LiteralIndex()> FirstUnassignedVarAtItsMinHeuristic(
.Index();
}
}
return kNoLiteralIndex;
return LiteralIndex(kNoLiteralIndex);
};
}
@@ -1197,7 +1197,7 @@ std::function<LiteralIndex()> UnassignedVarWithLowestMinAtItsMinHeuristic(
candidate_lb = lb;
}
}
if (candidate == kNoIntegerVariable) return kNoLiteralIndex;
if (candidate == kNoIntegerVariable) return LiteralIndex(kNoLiteralIndex);
return integer_encoder
->GetOrCreateAssociatedLiteral(
IntegerLiteral::LowerOrEqual(candidate, candidate_lb))

View File

@@ -25,6 +25,8 @@ DEFINE_bool(lp_constraint_use_dual_ray, true,
namespace operations_research {
namespace sat {
const double LinearProgrammingConstraint::kEpsilon = 1e-6;
LinearProgrammingConstraint::LinearProgrammingConstraint(
IntegerTrail* integer_trail)
: integer_trail_(integer_trail) {

View File

@@ -127,7 +127,7 @@ class LinearProgrammingConstraint : public PropagatorInterface {
glop::Fractional GetVariableValueAtCpScale(glop::ColIndex var);
// TODO(user): use solver's precision epsilon.
constexpr static double kEpsilon = 1e-6;
static const double kEpsilon;
// Underlying LP solver API.
glop::LinearProgram lp_data_;

View File

@@ -351,8 +351,9 @@ PiecewiseLinearFunction* PiecewiseLinearFunction::CreateFullDomainFunction(
PiecewiseLinearFunction* PiecewiseLinearFunction::CreateOneSegmentFunction(
int64 point_x, int64 point_y, int64 slope, int64 other_point_x) {
return new PiecewiseLinearFunction(
{PiecewiseSegment(point_x, point_y, slope, other_point_x)});
std::vector<PiecewiseSegment> segments =
{PiecewiseSegment(point_x, point_y, slope, other_point_x)};
return new PiecewiseLinearFunction(segments);
}
PiecewiseLinearFunction* PiecewiseLinearFunction::CreateRightRayFunction(