OR-Tools  9.3
cp_model_utils.h File Reference

Go to the source code of this file.

Classes

struct  IndexReferences
 

Namespaces

namespace  operations_research
 Collection of objects used to extend the Constraint Solver library.
 
namespace  operations_research::sat
 

Functions

int NegatedRef (int ref)
 
int PositiveRef (int ref)
 
bool RefIsPositive (int ref)
 
bool HasEnforcementLiteral (const ConstraintProto &ct)
 
int EnforcementLiteral (const ConstraintProto &ct)
 
void SetToNegatedLinearExpression (const LinearExpressionProto &input_expr, LinearExpressionProto *output_negated_expr)
 
IndexReferences GetReferencesUsedByConstraint (const ConstraintProto &ct)
 
void ApplyToAllVariableIndices (const std::function< void(int *)> &f, ConstraintProto *ct)
 
void ApplyToAllLiteralIndices (const std::function< void(int *)> &f, ConstraintProto *ct)
 
void ApplyToAllIntervalIndices (const std::function< void(int *)> &f, ConstraintProto *ct)
 
std::string ConstraintCaseName (ConstraintProto::ConstraintCase constraint_case)
 
std::vector< int > UsedVariables (const ConstraintProto &ct)
 
std::vector< int > UsedIntervals (const ConstraintProto &ct)
 
template<typename ProtoWithDomain >
bool DomainInProtoContains (const ProtoWithDomain &proto, int64_t value)
 
template<typename ProtoWithDomain >
void FillDomainInProto (const Domain &domain, ProtoWithDomain *proto)
 
template<typename ProtoWithDomain >
Domain ReadDomainFromProto (const ProtoWithDomain &proto)
 
template<typename ProtoWithDomain >
std::vector< int64_t > AllValuesInDomain (const ProtoWithDomain &proto)
 
double ScaleObjectiveValue (const CpObjectiveProto &proto, int64_t value)
 
int64_t ScaleInnerObjectiveValue (const CpObjectiveProto &proto, int64_t value)
 
double UnscaleObjectiveValue (const CpObjectiveProto &proto, double value)
 
int64_t ComputeInnerObjective (const CpObjectiveProto &objective, const CpSolverResponse &response)
 
bool ExpressionContainsSingleRef (const LinearExpressionProto &expr)
 
bool ExpressionIsAffine (const LinearExpressionProto &expr)
 
int GetSingleRefFromExpression (const LinearExpressionProto &expr)
 
void AddLinearExpressionToLinearConstraint (const LinearExpressionProto &expr, int64_t coefficient, LinearConstraintProto *linear)
 
bool LinearExpressionProtosAreEqual (const LinearExpressionProto &a, const LinearExpressionProto &b, int64_t b_scaling)