OR-Tools  9.0
element.cc File Reference

Go to the source code of this file.

Classes

class  IfThenElseCt
 

Namespaces

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

Macros

#define UPDATE_BASE_ELEMENT_INDEX_BOUNDS(test)
 
#define UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS(test)
 
#define UPDATE_ELEMENT_INDEX_BOUNDS(test)
 

Functions

 ABSL_FLAG (bool, cp_disable_element_cache, true, "If true, caching for IntElement is disabled.")
 
void LinkVarExpr (Solver *const s, IntExpr *const expr, IntVar *const var)
 

Macro Definition Documentation

◆ UPDATE_BASE_ELEMENT_INDEX_BOUNDS

#define UPDATE_BASE_ELEMENT_INDEX_BOUNDS (   test)
Value:
const int64_t emin = ExprMin(); \
const int64_t emax = ExprMax(); \
int64_t nmin = emin; \
int64_t value = ElementValue(nmin); \
while (nmin < emax && test) { \
nmin++; \
value = ElementValue(nmin); \
} \
if (nmin == emax && test) { \
solver()->Fail(); \
} \
int64_t nmax = emax; \
value = ElementValue(nmax); \
while (nmax >= nmin && test) { \
nmax--; \
value = ElementValue(nmax); \
} \
expr_->SetRange(nmin, nmax);
int64_t value

Definition at line 129 of file element.cc.

◆ UPDATE_ELEMENT_INDEX_BOUNDS

#define UPDATE_ELEMENT_INDEX_BOUNDS (   test)

Definition at line 988 of file element.cc.

◆ UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS

#define UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS (   test)
Value:
const std::vector<int64_t>& values = min_rmq_.array(); \
int64_t index_min = IndexMin(); \
int64_t index_max = IndexMax(); \
int64_t value = values[index_min]; \
while (index_min < index_max && (test)) { \
index_min++; \
value = values[index_min]; \
} \
if (index_min == index_max && (test)) { \
solver()->Fail(); \
} \
value = values[index_max]; \
while (index_max >= index_min && (test)) { \
index_max--; \
value = values[index_max]; \
} \
index_->SetRange(index_min, index_max);

Definition at line 423 of file element.cc.

Function Documentation

◆ ABSL_FLAG()

ABSL_FLAG ( bool  ,
cp_disable_element_cache  ,
true  ,
"If  true,
caching for IntElement is disabled."   
)

Variable Documentation

◆ expr_

IntVar* const expr_
protected

Definition at line 87 of file element.cc.