OR-Tools  8.1
cp_model_utils.cc File Reference

Go to the source code of this file.

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 
 operations_research::sat
 

Macros

#define APPLY_TO_SINGULAR_FIELD(ct_name, field_name)
 
#define APPLY_TO_REPEATED_FIELD(ct_name, field_name)
 

Functions

void SetToNegatedLinearExpression (const LinearExpressionProto &input_expr, LinearExpressionProto *output_negated_expr)
 
IndexReferences GetReferencesUsedByConstraint (const ConstraintProto &ct)
 
void ApplyToAllLiteralIndices (const std::function< void(int *)> &f, ConstraintProto *ct)
 
void ApplyToAllVariableIndices (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)
 
int64 ComputeInnerObjective (const CpObjectiveProto &objective, const CpSolverResponse &response)
 

Macro Definition Documentation

◆ APPLY_TO_REPEATED_FIELD

#define APPLY_TO_REPEATED_FIELD (   ct_name,
  field_name 
)
Value:
{ \
for (int& r : *ct->mutable_##ct_name()->mutable_##field_name()) f(&r); \
}

Definition at line 152 of file cp_model_utils.cc.

◆ APPLY_TO_SINGULAR_FIELD

#define APPLY_TO_SINGULAR_FIELD (   ct_name,
  field_name 
)
Value:
{ \
int temp = ct->mutable_##ct_name()->field_name(); \
f(&temp); \
ct->mutable_##ct_name()->set_##field_name(temp); \
}

Definition at line 145 of file cp_model_utils.cc.

ct
const Constraint * ct
Definition: demon_profiler.cc:42