Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.modelbuilder.LinearConstraint Class Reference

Public Member Functions

 LinearConstraint (ModelBuilderHelper helper)
 
int getIndex ()
 
ModelBuilderHelper getHelper ()
 
double getLowerBound ()
 
void setLowerBound (double lb)
 
double getUpperBound ()
 
void setUpperBound (double ub)
 
String getName ()
 
void setName (String name)
 
void addTerm (Variable v, double coeff)
 
void setCoefficient (Variable v, double coeff)
 
void clearTerms ()
 
LinearConstraint withName (String name)
 
 LinearConstraint (ModelBuilderHelper helper)
 
int getIndex ()
 
ModelBuilderHelper getHelper ()
 
double getLowerBound ()
 
void setLowerBound (double lb)
 
double getUpperBound ()
 
void setUpperBound (double ub)
 
String getName ()
 
void setName (String name)
 
void addTerm (Variable v, double coeff)
 
void setCoefficient (Variable v, double coeff)
 
void clearTerms ()
 
LinearConstraint withName (String name)
 

Detailed Description

Wrapper around a linear constraint stored in the ModelBuilderHelper instance.

Definition at line 17 of file LinearConstraint.java.

Constructor & Destructor Documentation

◆ LinearConstraint() [1/2]

com.google.ortools.modelbuilder.LinearConstraint.LinearConstraint ( ModelBuilderHelper helper)

Definition at line 18 of file LinearConstraint.java.

◆ LinearConstraint() [2/2]

com.google.ortools.modelbuilder.LinearConstraint.LinearConstraint ( ModelBuilderHelper helper)

Definition at line 18 of file LinearConstraint.java.

Member Function Documentation

◆ addTerm() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.addTerm ( Variable v,
double coeff )

Adds var * coeff to the constraint.

Definition at line 69 of file LinearConstraint.java.

◆ addTerm() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.addTerm ( Variable v,
double coeff )

Adds var * coeff to the constraint.

Definition at line 69 of file LinearConstraint.java.

◆ clearTerms() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.clearTerms ( )

Clear all terms.

Definition at line 79 of file LinearConstraint.java.

◆ clearTerms() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.clearTerms ( )

Clear all terms.

Definition at line 79 of file LinearConstraint.java.

◆ getHelper() [1/2]

ModelBuilderHelper com.google.ortools.modelbuilder.LinearConstraint.getHelper ( )

Returns the constraint builder.

Definition at line 34 of file LinearConstraint.java.

◆ getHelper() [2/2]

ModelBuilderHelper com.google.ortools.modelbuilder.LinearConstraint.getHelper ( )

Returns the constraint builder.

Definition at line 34 of file LinearConstraint.java.

◆ getIndex() [1/2]

int com.google.ortools.modelbuilder.LinearConstraint.getIndex ( )

Returns the index of the constraint in the model.

Definition at line 29 of file LinearConstraint.java.

◆ getIndex() [2/2]

int com.google.ortools.modelbuilder.LinearConstraint.getIndex ( )

Returns the index of the constraint in the model.

Definition at line 29 of file LinearConstraint.java.

◆ getLowerBound() [1/2]

double com.google.ortools.modelbuilder.LinearConstraint.getLowerBound ( )

Returns the lower bound of the constraint.

Definition at line 39 of file LinearConstraint.java.

◆ getLowerBound() [2/2]

double com.google.ortools.modelbuilder.LinearConstraint.getLowerBound ( )

Returns the lower bound of the constraint.

Definition at line 39 of file LinearConstraint.java.

◆ getName() [1/2]

String com.google.ortools.modelbuilder.LinearConstraint.getName ( )

Returns the name of the constraint given upon creation.

Definition at line 59 of file LinearConstraint.java.

◆ getName() [2/2]

String com.google.ortools.modelbuilder.LinearConstraint.getName ( )

Returns the name of the constraint given upon creation.

Definition at line 59 of file LinearConstraint.java.

◆ getUpperBound() [1/2]

double com.google.ortools.modelbuilder.LinearConstraint.getUpperBound ( )

Returns the upper bound of the constraint.

Definition at line 49 of file LinearConstraint.java.

◆ getUpperBound() [2/2]

double com.google.ortools.modelbuilder.LinearConstraint.getUpperBound ( )

Returns the upper bound of the constraint.

Definition at line 49 of file LinearConstraint.java.

◆ setCoefficient() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.setCoefficient ( Variable v,
double coeff )

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

Definition at line 74 of file LinearConstraint.java.

◆ setCoefficient() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.setCoefficient ( Variable v,
double coeff )

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

Definition at line 74 of file LinearConstraint.java.

◆ setLowerBound() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.setLowerBound ( double lb)

Returns the lower bound of the constraint.

Definition at line 44 of file LinearConstraint.java.

◆ setLowerBound() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.setLowerBound ( double lb)

Returns the lower bound of the constraint.

Definition at line 44 of file LinearConstraint.java.

◆ setName() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.setName ( String name)

Sets the name of the constraint.

Definition at line 64 of file LinearConstraint.java.

◆ setName() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.setName ( String name)

Sets the name of the constraint.

Definition at line 64 of file LinearConstraint.java.

◆ setUpperBound() [1/2]

void com.google.ortools.modelbuilder.LinearConstraint.setUpperBound ( double ub)

Returns the upper bound of the constraint.

Definition at line 54 of file LinearConstraint.java.

◆ setUpperBound() [2/2]

void com.google.ortools.modelbuilder.LinearConstraint.setUpperBound ( double ub)

Returns the upper bound of the constraint.

Definition at line 54 of file LinearConstraint.java.

◆ withName() [1/2]

LinearConstraint com.google.ortools.modelbuilder.LinearConstraint.withName ( String name)

Inline setter

Definition at line 84 of file LinearConstraint.java.

◆ withName() [2/2]

LinearConstraint com.google.ortools.modelbuilder.LinearConstraint.withName ( String name)

Inline setter

Definition at line 84 of file LinearConstraint.java.


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