Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
OperationsResearch.MPIndicatorConstraint Class Referencesealed

Indicator constraints encode the activation or deactivation of linear constraints given the value of one Boolean variable in the model. For example: y = 0 => 2 * x1 + 3 * x2 >= 42 The 2 * x1 + 3 * x2 >= 42 constraint is only active if the variable y is equal to 0. As of 2019/04, only SCIP, CP-SAT and Gurobi support this constraint type. More...

Detailed Description

Indicator constraints encode the activation or deactivation of linear constraints given the value of one Boolean variable in the model. For example: y = 0 => 2 * x1 + 3 * x2 >= 42 The 2 * x1 + 3 * x2 >= 42 constraint is only active if the variable y is equal to 0. As of 2019/04, only SCIP, CP-SAT and Gurobi support this constraint type.

Definition at line 1946 of file LinearSolver.pb.cs.

Inheritance diagram for OperationsResearch.MPIndicatorConstraint:

Public Member Functions

 MPIndicatorConstraint ()
 MPIndicatorConstraint (MPIndicatorConstraint other)
MPIndicatorConstraint Clone ()
void ClearVarIndex ()
 Clears the value of the "var_index" field.
void ClearVarValue ()
 Clears the value of the "var_value" field.
override bool Equals (object other)
bool Equals (MPIndicatorConstraint other)
override int GetHashCode ()
override string ToString ()
void WriteTo (pb::CodedOutputStream output)
int CalculateSize ()
void MergeFrom (MPIndicatorConstraint other)
void MergeFrom (pb::CodedInputStream input)

Static Public Attributes

const int VarIndexFieldNumber = 1
 Field number for the "var_index" field.
const int VarValueFieldNumber = 2
 Field number for the "var_value" field.
const int ConstraintFieldNumber = 3
 Field number for the "constraint" field.

Properties

static pb::MessageParser< MPIndicatorConstraintParser [get]
static pbr::MessageDescriptor Descriptor [get]
int VarIndex [get, set]
 Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
bool HasVarIndex [get]
 Gets whether the "var_index" field is set.
int VarValue [get, set]
 Value the above variable should take. Must be 0 or 1.
bool HasVarValue [get]
 Gets whether the "var_value" field is set.
global::OperationsResearch.MPConstraintProto Constraint [get, set]
 The constraint activated by the indicator variable.

Constructor & Destructor Documentation

◆ MPIndicatorConstraint() [1/2]

OperationsResearch.MPIndicatorConstraint.MPIndicatorConstraint ( )
inline

Definition at line 1972 of file LinearSolver.pb.cs.

◆ MPIndicatorConstraint() [2/2]

OperationsResearch.MPIndicatorConstraint.MPIndicatorConstraint ( MPIndicatorConstraint other)
inline

Definition at line 1980 of file LinearSolver.pb.cs.

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPIndicatorConstraint.CalculateSize ( )
inline

Definition at line 2158 of file LinearSolver.pb.cs.

◆ ClearVarIndex()

void OperationsResearch.MPIndicatorConstraint.ClearVarIndex ( )
inline

Clears the value of the "var_index" field.

Definition at line 2021 of file LinearSolver.pb.cs.

◆ ClearVarValue()

void OperationsResearch.MPIndicatorConstraint.ClearVarValue ( )
inline

Clears the value of the "var_value" field.

Definition at line 2051 of file LinearSolver.pb.cs.

◆ Clone()

MPIndicatorConstraint OperationsResearch.MPIndicatorConstraint.Clone ( )
inline

Definition at line 1990 of file LinearSolver.pb.cs.

◆ Equals() [1/2]

bool OperationsResearch.MPIndicatorConstraint.Equals ( MPIndicatorConstraint other)
inline

Definition at line 2078 of file LinearSolver.pb.cs.

◆ Equals() [2/2]

override bool OperationsResearch.MPIndicatorConstraint.Equals ( object other)
inline

Definition at line 2072 of file LinearSolver.pb.cs.

◆ GetHashCode()

override int OperationsResearch.MPIndicatorConstraint.GetHashCode ( )
inline

Definition at line 2093 of file LinearSolver.pb.cs.

◆ MergeFrom() [1/2]

void OperationsResearch.MPIndicatorConstraint.MergeFrom ( MPIndicatorConstraint other)
inline

Definition at line 2177 of file LinearSolver.pb.cs.

◆ MergeFrom() [2/2]

void OperationsResearch.MPIndicatorConstraint.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 2198 of file LinearSolver.pb.cs.

◆ ToString()

override string OperationsResearch.MPIndicatorConstraint.ToString ( )
inline

Definition at line 2106 of file LinearSolver.pb.cs.

◆ WriteTo()

void OperationsResearch.MPIndicatorConstraint.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 2112 of file LinearSolver.pb.cs.

Member Data Documentation

◆ ConstraintFieldNumber

const int OperationsResearch.MPIndicatorConstraint.ConstraintFieldNumber = 3
static

Field number for the "constraint" field.

Definition at line 2056 of file LinearSolver.pb.cs.

◆ VarIndexFieldNumber

const int OperationsResearch.MPIndicatorConstraint.VarIndexFieldNumber = 1
static

Field number for the "var_index" field.

Definition at line 1995 of file LinearSolver.pb.cs.

◆ VarValueFieldNumber

const int OperationsResearch.MPIndicatorConstraint.VarValueFieldNumber = 2
static

Field number for the "var_value" field.

Definition at line 2026 of file LinearSolver.pb.cs.

Property Documentation

◆ Constraint

global.OperationsResearch.MPConstraintProto OperationsResearch.MPIndicatorConstraint.Constraint
getset

The constraint activated by the indicator variable.

Definition at line 2063 of file LinearSolver.pb.cs.

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPIndicatorConstraint.Descriptor
staticget

Definition at line 1960 of file LinearSolver.pb.cs.

◆ HasVarIndex

bool OperationsResearch.MPIndicatorConstraint.HasVarIndex
get

Gets whether the "var_index" field is set.

Definition at line 2015 of file LinearSolver.pb.cs.

◆ HasVarValue

bool OperationsResearch.MPIndicatorConstraint.HasVarValue
get

Gets whether the "var_value" field is set.

Definition at line 2045 of file LinearSolver.pb.cs.

◆ Parser

pb.MessageParser<MPIndicatorConstraint> OperationsResearch.MPIndicatorConstraint.Parser
staticget

Definition at line 1956 of file LinearSolver.pb.cs.

◆ VarIndex

int OperationsResearch.MPIndicatorConstraint.VarIndex
getset

Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.

Definition at line 2005 of file LinearSolver.pb.cs.

◆ VarValue

int OperationsResearch.MPIndicatorConstraint.VarValue
getset

Value the above variable should take. Must be 0 or 1.

Definition at line 2035 of file LinearSolver.pb.cs.


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