OR-Tools  8.1
element.cc File Reference

Go to the source code of this file.

Classes

class  IfThenElseCt
 

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.
 

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 emin = ExprMin(); \
const int64 emax = ExprMax(); \
int64 nmin = emin; \
int64 value = ElementValue(nmin); \
while (nmin < emax && test) { \
nmin++; \
value = ElementValue(nmin); \
} \
if (nmin == emax && test) { \
solver()->Fail(); \
} \
int64 nmax = emax; \
value = ElementValue(nmax); \
while (nmax >= nmin && test) { \
nmax--; \
value = ElementValue(nmax); \
} \
expr_->SetRange(nmin, nmax);

Definition at line 127 of file element.cc.

◆ UPDATE_ELEMENT_INDEX_BOUNDS

#define UPDATE_ELEMENT_INDEX_BOUNDS (   test)

Definition at line 977 of file element.cc.

◆ UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS

#define UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS (   test)
Value:
const std::vector<int64>& values = min_rmq_.array(); \
int64 index_min = IndexMin(); \
int64 index_max = IndexMax(); \
int64 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 417 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 85 of file element.cc.

value
int64 value
Definition: demon_profiler.cc:43
int64
int64_t int64
Definition: integral_types.h:34