Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::IndicatorConstraint Class Referencefinal

#include <indicator_constraint.h>

Inheritance diagram for operations_research::math_opt::IndicatorConstraint:
operations_research::math_opt::ModelStorageElement< ElementType::kIndicatorConstraint, IndicatorConstraint > operations_research::math_opt::ModelStorageItem

Public Member Functions

absl::string_view name () const
std::optional< Variableindicator_variable () const
bool activate_on_zero () const
 The value the indicator variable takes to activate the implied constraint.
BoundedLinearExpression ImpliedConstraint () const
std::vector< VariableNonzeroVariables () 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 >
ModelStorageElementoperator= (const ModelStorageElement &)=default
 ~ModelStorageElement ()=default
Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem
 ModelStorageItem (ModelStorageCPtr storage)
 ModelStorageItem (const ModelStorageItem &)=default
ModelStorageItemoperator= (const ModelStorageItem &)=default
 ModelStorageItem (ModelStorageItem &&)=default
ModelStorageItemoperator= (ModelStorageItem &&)=default
 ~ModelStorageItem ()=default

Detailed Description

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.

Member Function Documentation

◆ activate_on_zero()

bool operations_research::math_opt::IndicatorConstraint::activate_on_zero ( ) const
inline

The value the indicator variable takes to activate the implied constraint.

Definition at line 82 of file indicator_constraint.h.

◆ ImpliedConstraint()

BoundedLinearExpression operations_research::math_opt::IndicatorConstraint::ImpliedConstraint ( ) const
Note
The following makes a copy of data.linear_terms. This can be made more efficient if the need arises.

Definition at line 27 of file indicator_constraint.cc.

◆ indicator_variable()

std::optional< Variable > operations_research::math_opt::IndicatorConstraint::indicator_variable ( ) const
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.

◆ ModelStorageElement() [1/3]

operations_research::math_opt::ModelStorageElement< element_type, Derived, generate_equality >::ModelStorageElement ( const ModelStorageElement & )
default

◆ ModelStorageElement() [2/3]

operations_research::math_opt::ModelStorageElement< element_type, Derived, generate_equality >::ModelStorageElement ( ModelStorageCPtr storage,
IdType id )
inline

Definition at line 81 of file model_storage_item.h.

◆ ModelStorageElement() [3/3]

operations_research::math_opt::ModelStorageElement< element_type, Derived, generate_equality >::ModelStorageElement ( ModelStorageElement && )
default

◆ name()

absl::string_view operations_research::math_opt::IndicatorConstraint::name ( ) const
inline

Inline function implementations

Definition at line 66 of file indicator_constraint.h.

◆ NonzeroVariables()

std::vector< Variable > operations_research::math_opt::IndicatorConstraint::NonzeroVariables ( ) const
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.

◆ ToString()

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.


The documentation for this class was generated from the following files: