Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::IndicatorConstraintData Struct Reference

Detailed Description

Internal storage representation for a single indicator constraint.

Implements the interface specified for the ConstraintData parameter of AtomicConstraintStorage.

Definition at line 34 of file storage.h.

#include <storage.h>

Public Types

using IdType = IndicatorConstraintId
using ProtoType = IndicatorConstraintProto
using UpdatesProtoType = IndicatorConstraintUpdatesProto

Public Member Functions

ProtoType Proto () const
std::vector< VariableIdRelatedVariables () const
void DeleteVariable (VariableId var)

Static Public Member Functions

static IndicatorConstraintData FromProto (const ProtoType &in_proto)

Public Attributes

double lower_bound = -std::numeric_limits<double>::infinity()
double upper_bound = std::numeric_limits<double>::infinity()
SparseCoefficientMap linear_terms
std::optional< VariableIdindicator
bool activate_on_zero = false
std::string name

Static Public Attributes

static constexpr ElementType kElementType = ElementType::kIndicatorConstraint
static constexpr bool kSupportsElemental = true

Member Typedef Documentation

◆ IdType

◆ ProtoType

◆ UpdatesProtoType

Member Function Documentation

◆ DeleteVariable()

void operations_research::math_opt::IndicatorConstraintData::DeleteVariable ( VariableId var)

Definition at line 74 of file storage.cc.

◆ FromProto()

IndicatorConstraintData operations_research::math_opt::IndicatorConstraintData::FromProto ( const ProtoType & in_proto)
static

The in_proto must be in a valid state; see the inline comments on IndicatorConstraintProto for details.

Definition at line 29 of file storage.cc.

◆ Proto()

IndicatorConstraintData::ProtoType operations_research::math_opt::IndicatorConstraintData::Proto ( ) const

Definition at line 46 of file storage.cc.

◆ RelatedVariables()

std::vector< VariableId > operations_research::math_opt::IndicatorConstraintData::RelatedVariables ( ) const

Definition at line 63 of file storage.cc.

Member Data Documentation

◆ activate_on_zero

bool operations_research::math_opt::IndicatorConstraintData::activate_on_zero = false

Definition at line 54 of file storage.h.

◆ indicator

std::optional<VariableId> operations_research::math_opt::IndicatorConstraintData::indicator

The indicator variable may be unset, in which case the constraint is ignored.

Definition at line 53 of file storage.h.

◆ kElementType

ElementType operations_research::math_opt::IndicatorConstraintData::kElementType = ElementType::kIndicatorConstraint
staticconstexpr

Definition at line 38 of file storage.h.

◆ kSupportsElemental

bool operations_research::math_opt::IndicatorConstraintData::kSupportsElemental = true
staticconstexpr

Definition at line 39 of file storage.h.

◆ linear_terms

SparseCoefficientMap operations_research::math_opt::IndicatorConstraintData::linear_terms

Definition at line 50 of file storage.h.

◆ lower_bound

double operations_research::math_opt::IndicatorConstraintData::lower_bound = -std::numeric_limits<double>::infinity()

Definition at line 48 of file storage.h.

◆ name

std::string operations_research::math_opt::IndicatorConstraintData::name

Definition at line 55 of file storage.h.

◆ upper_bound

double operations_research::math_opt::IndicatorConstraintData::upper_bound = std::numeric_limits<double>::infinity()

Definition at line 49 of file storage.h.


The documentation for this struct was generated from the following files:
  • ortools/math_opt/constraints/indicator/storage.h
  • ortools/math_opt/constraints/indicator/storage.cc