Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPSosConstraintOrBuilder Interface Reference
Inheritance diagram for com.google.ortools.linearsolver.MPSosConstraintOrBuilder:
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder

Public Member Functions

boolean hasType ()
 
com.google.ortools.linearsolver.MPSosConstraint.Type getType ()
 
java.util.List< java.lang.Integer > getVarIndexList ()
 
int getVarIndexCount ()
 
int getVarIndex (int index)
 
java.util.List< java.lang.Double > getWeightList ()
 
int getWeightCount ()
 
double getWeight (int index)
 

Detailed Description

Definition at line 7 of file MPSosConstraintOrBuilder.java.

Member Function Documentation

◆ getType()

com.google.ortools.linearsolver.MPSosConstraint.Type com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getType ( )

optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];

Returns
The type.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getVarIndex()

int com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getVarIndex ( int index)
Variable index (w.r.t. the "variable" field of MPModelProto) of the
variables in the SOS.

repeated int32 var_index = 2;

Parameters
indexThe index of the element to return.
Returns
The varIndex at the given index.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getVarIndexCount()

int com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getVarIndexCount ( )
Variable index (w.r.t. the "variable" field of MPModelProto) of the
variables in the SOS.

repeated int32 var_index = 2;

Returns
The count of varIndex.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getVarIndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getVarIndexList ( )
Variable index (w.r.t. the "variable" field of MPModelProto) of the
variables in the SOS.

repeated int32 var_index = 2;

Returns
A list containing the varIndex.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getWeight()

double com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getWeight ( int index)
Optional: SOS weights. If non-empty, must be of the same size as
"var_index", and strictly increasing. If empty and required by the
underlying solver, the 1..n sequence will be given as weights.
SUBTLE: The weights can help the solver make branch-and-bound decisions
that fit the underlying optimization model: after each LP relaxation, it
will compute the "average weight" of the SOS variables, weighted by value
(this is confusing: here we're using the values as weights), and the binary
branch decision will be: is the non-zero variable above or below that?
(weights are strictly monotonous, so the "cutoff" average weight
corresponds to a "cutoff" index in the var_index sequence).

repeated double weight = 3;

Parameters
indexThe index of the element to return.
Returns
The weight at the given index.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getWeightCount()

int com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getWeightCount ( )
Optional: SOS weights. If non-empty, must be of the same size as
"var_index", and strictly increasing. If empty and required by the
underlying solver, the 1..n sequence will be given as weights.
SUBTLE: The weights can help the solver make branch-and-bound decisions
that fit the underlying optimization model: after each LP relaxation, it
will compute the "average weight" of the SOS variables, weighted by value
(this is confusing: here we're using the values as weights), and the binary
branch decision will be: is the non-zero variable above or below that?
(weights are strictly monotonous, so the "cutoff" average weight
corresponds to a "cutoff" index in the var_index sequence).

repeated double weight = 3;

Returns
The count of weight.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ getWeightList()

java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPSosConstraintOrBuilder.getWeightList ( )
Optional: SOS weights. If non-empty, must be of the same size as
"var_index", and strictly increasing. If empty and required by the
underlying solver, the 1..n sequence will be given as weights.
SUBTLE: The weights can help the solver make branch-and-bound decisions
that fit the underlying optimization model: after each LP relaxation, it
will compute the "average weight" of the SOS variables, weighted by value
(this is confusing: here we're using the values as weights), and the binary
branch decision will be: is the non-zero variable above or below that?
(weights are strictly monotonous, so the "cutoff" average weight
corresponds to a "cutoff" index in the var_index sequence).

repeated double weight = 3;

Returns
A list containing the weight.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.

◆ hasType()

boolean com.google.ortools.linearsolver.MPSosConstraintOrBuilder.hasType ( )

optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];

Returns
Whether the type field is set.

Implemented in com.google.ortools.linearsolver.MPSosConstraint, and com.google.ortools.linearsolver.MPSosConstraint.Builder.


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