![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <indicator_constraint.h>
Public Member Functions | |
absl::string_view | name () const |
std::optional< Variable > | indicator_variable () const |
bool | activate_on_zero () const |
The value the indicator variable takes to activate the implied constraint. | |
BoundedLinearExpression | ImpliedConstraint () const |
std::vector< Variable > | NonzeroVariables () const |
std::string | ToString () const |
ModelStorageElement (ModelStorageCPtr storage, IdType id) | |
ModelStorageElement (const ModelStorageElement &)=default | |
ModelStorageElement (ModelStorageElement &&)=default | |
Public Member Functions inherited from operations_research::math_opt::ModelStorageElement< ElementType::kIndicatorConstraint, IndicatorConstraint > | |
ModelStorageElement (ModelStorageCPtr storage, IdType id) | |
int64_t | id () const |
IdType | typed_id () const |
Public Member Functions inherited from operations_research::math_opt::ModelStorageItem | |
ModelStorageCPtr | storage () const |
Additional Inherited Members | |
Public Types inherited from operations_research::math_opt::ModelStorageElement< ElementType::kIndicatorConstraint, IndicatorConstraint > | |
using | IdType |
The typed integer used for ids. | |
Protected Member Functions inherited from operations_research::math_opt::ModelStorageElement< ElementType::kIndicatorConstraint, IndicatorConstraint > | |
ModelStorageElement & | operator= (const ModelStorageElement &)=default |
~ModelStorageElement ()=default | |
Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem | |
ModelStorageItem (ModelStorageCPtr storage) | |
ModelStorageItem (const ModelStorageItem &)=default | |
ModelStorageItem & | operator= (const ModelStorageItem &)=default |
ModelStorageItem (ModelStorageItem &&)=default | |
ModelStorageItem & | operator= (ModelStorageItem &&)=default |
~ModelStorageItem ()=default |
A value type that references an indicator constraint from ModelStorage. Usually this type is passed by copy.
Definition at line 34 of file indicator_constraint.h.
|
inline |
The value the indicator variable takes to activate the implied constraint.
Definition at line 82 of file indicator_constraint.h.
BoundedLinearExpression operations_research::math_opt::IndicatorConstraint::ImpliedConstraint | ( | ) | const |
Definition at line 27 of file indicator_constraint.cc.
|
inline |
Returns nullopt if the indicator variable is unset (this is a valid state, in which the constraint is functionally ignored).
Definition at line 73 of file indicator_constraint.h.
|
default |
Disallow slicing (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-copy-virtual):
|
inline |
Definition at line 81 of file model_storage_item.h.
|
default |
|
inline |
Inline function implementations
Definition at line 66 of file indicator_constraint.h.
|
inline |
Returns all variables that appear in the indicator constraint with a nonzero coefficient. Order is not defined.
Definition at line 86 of file indicator_constraint.h.
std::string operations_research::math_opt::IndicatorConstraint::ToString | ( | ) | const |
Returns a detailed string description of the contents of the constraint (not its name, use << for that instead).
Definition at line 36 of file indicator_constraint.cc.