Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.ModelBuilder.EnforcedLinearConstraint Class Reference

Wrapper around an enforced linear constraint stored in the ModelBuilderHelper instance. More...

Public Member Functions

 EnforcedLinearConstraint (ModelBuilderHelper helper)
 
 EnforcedLinearConstraint (ModelBuilderHelper helper, int index)
 
void AddTerm (Variable var, double coeff)
 Adds var * coeff to the constraint.
 
void SetVariableCoefficient (Variable var, double coeff)
 Sets the coefficient of var to coeff, adding or removing a term if needed.
 
void ClearTerms ()
 Clear all terms of the constraint.
 
EnforcedLinearConstraint WithName (String name)
 Inline setter.
 

Properties

int Index [get]
 Returns the index of the constraint in the model.
 
ModelBuilderHelper Helper [get]
 Returns the constraint builder.
 
double LowerBound [get, set]
 The lower bound of the constraint.
 
double UpperBound [get, set]
 The upper bound of the constraint.
 
Variable IndicatorVariable [get, set]
 The indicator variable of the constraint.
 
bool IndicatorValue [get, set]
 The indicator value of the constraint.
 
String Name [get, set]
 The name of the variable given upon creation.
 

Detailed Description

Wrapper around an enforced linear constraint stored in the ModelBuilderHelper instance.

Definition at line 146 of file ModelBuilderConstraint.cs.

Constructor & Destructor Documentation

◆ EnforcedLinearConstraint() [1/2]

Google.OrTools.ModelBuilder.EnforcedLinearConstraint.EnforcedLinearConstraint ( ModelBuilderHelper helper)
inline

Definition at line 148 of file ModelBuilderConstraint.cs.

◆ EnforcedLinearConstraint() [2/2]

Google.OrTools.ModelBuilder.EnforcedLinearConstraint.EnforcedLinearConstraint ( ModelBuilderHelper helper,
int index )
inline

Definition at line 154 of file ModelBuilderConstraint.cs.

Member Function Documentation

◆ AddTerm()

void Google.OrTools.ModelBuilder.EnforcedLinearConstraint.AddTerm ( Variable var,
double coeff )
inline

Adds var * coeff to the constraint.

Parameters
varthe variable of the term to add
coeffthe coefficient of the term to add

Definition at line 254 of file ModelBuilderConstraint.cs.

◆ ClearTerms()

void Google.OrTools.ModelBuilder.EnforcedLinearConstraint.ClearTerms ( )
inline

Clear all terms of the constraint.

Definition at line 272 of file ModelBuilderConstraint.cs.

◆ SetVariableCoefficient()

void Google.OrTools.ModelBuilder.EnforcedLinearConstraint.SetVariableCoefficient ( Variable var,
double coeff )
inline

Sets the coefficient of var to coeff, adding or removing a term if needed.

Parameters
varthe variable of the term to set
coeffthe coefficient of the term to set

Definition at line 264 of file ModelBuilderConstraint.cs.

◆ WithName()

EnforcedLinearConstraint Google.OrTools.ModelBuilder.EnforcedLinearConstraint.WithName ( String name)
inline

Inline setter.

Parameters
nameThe name to assign
Returns
this

Definition at line 282 of file ModelBuilderConstraint.cs.

Property Documentation

◆ Helper

ModelBuilderHelper Google.OrTools.ModelBuilder.EnforcedLinearConstraint.Helper
get

Returns the constraint builder.

Definition at line 177 of file ModelBuilderConstraint.cs.

◆ Index

int Google.OrTools.ModelBuilder.EnforcedLinearConstraint.Index
get

Returns the index of the constraint in the model.

Definition at line 167 of file ModelBuilderConstraint.cs.

◆ IndicatorValue

bool Google.OrTools.ModelBuilder.EnforcedLinearConstraint.IndicatorValue
getset

The indicator value of the constraint.

Definition at line 226 of file ModelBuilderConstraint.cs.

◆ IndicatorVariable

Variable Google.OrTools.ModelBuilder.EnforcedLinearConstraint.IndicatorVariable
getset

The indicator variable of the constraint.

Definition at line 213 of file ModelBuilderConstraint.cs.

◆ LowerBound

double Google.OrTools.ModelBuilder.EnforcedLinearConstraint.LowerBound
getset

The lower bound of the constraint.

Definition at line 187 of file ModelBuilderConstraint.cs.

◆ Name

String Google.OrTools.ModelBuilder.EnforcedLinearConstraint.Name
getset

The name of the variable given upon creation.

Definition at line 239 of file ModelBuilderConstraint.cs.

◆ UpperBound

double Google.OrTools.ModelBuilder.EnforcedLinearConstraint.UpperBound
getset

The upper bound of the constraint.

Definition at line 200 of file ModelBuilderConstraint.cs.


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