#include <indicator_constraint.h>
|
using | IdType = IndicatorConstraintId |
| The typed integer used for ids.
|
|
A value type that references an indicator constraint from ModelStorage. Usually this type is passed by copy.
This type implements https://abseil.io/docs/cpp/guides/hash.
Definition at line 37 of file indicator_constraint.h.
◆ IdType
◆ IndicatorConstraint()
operations_research::math_opt::IndicatorConstraint::IndicatorConstraint |
( |
const ModelStorage * | storage, |
|
|
IndicatorConstraintId | id ) |
|
inline |
◆ 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 116 of file indicator_constraint.h.
◆ id()
int64_t operations_research::math_opt::IndicatorConstraint::id |
( |
| ) |
const |
|
inline |
◆ ImpliedConstraint()
- Note
- The following makes a copy of
data.linear_terms
. This can be made more efficient if the need arises.
Definition at line 29 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 107 of file indicator_constraint.h.
◆ name()
absl::string_view operations_research::math_opt::IndicatorConstraint::name |
( |
| ) |
const |
|
inline |
◆ 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 120 of file indicator_constraint.h.
◆ storage()
const ModelStorage * operations_research::math_opt::IndicatorConstraint::storage |
( |
| ) |
const |
|
inline |
◆ 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 38 of file indicator_constraint.cc.
◆ typed_id()
IndicatorConstraintId operations_research::math_opt::IndicatorConstraint::typed_id |
( |
| ) |
const |
|
inline |
◆ AbslHashValue
◆ operator!=
◆ operator<<
Streams the name of the constraint, as registered upon constraint creation, or a short default if none was provided.
- Todo
- (b/170992529): handle quoting of invalid characters in the name.
Definition at line 139 of file indicator_constraint.h.
◆ operator==
The documentation for this class was generated from the following files: