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

Public Member Functions

java.util.List< java.lang.Integer > getLiteralsList ()
 
int getLiteralsCount ()
 
int getLiterals (int index)
 
java.util.List< java.lang.Long > getCoefficientsList ()
 
int getCoefficientsCount ()
 
long getCoefficients (int index)
 
boolean hasOffset ()
 
double getOffset ()
 
boolean hasScalingFactor ()
 
double getScalingFactor ()
 

Detailed Description

Definition at line 7 of file LinearObjectiveOrBuilder.java.

Member Function Documentation

◆ getCoefficients()

long com.google.ortools.sat.LinearObjectiveOrBuilder.getCoefficients ( int index)

repeated int64 coefficients = 2;

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

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getCoefficientsCount()

int com.google.ortools.sat.LinearObjectiveOrBuilder.getCoefficientsCount ( )

repeated int64 coefficients = 2;

Returns
The count of coefficients.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getCoefficientsList()

java.util.List< java.lang.Long > com.google.ortools.sat.LinearObjectiveOrBuilder.getCoefficientsList ( )

repeated int64 coefficients = 2;

Returns
A list containing the coefficients.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getLiterals()

int com.google.ortools.sat.LinearObjectiveOrBuilder.getLiterals ( int index)
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

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

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getLiteralsCount()

int com.google.ortools.sat.LinearObjectiveOrBuilder.getLiteralsCount ( )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
The count of literals.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getLiteralsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.LinearObjectiveOrBuilder.getLiteralsList ( )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
A list containing the literals.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getOffset()

double com.google.ortools.sat.LinearObjectiveOrBuilder.getOffset ( )
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

Returns
The offset.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ getScalingFactor()

double com.google.ortools.sat.LinearObjectiveOrBuilder.getScalingFactor ( )

optional double scaling_factor = 4 [default = 1];

Returns
The scalingFactor.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ hasOffset()

boolean com.google.ortools.sat.LinearObjectiveOrBuilder.hasOffset ( )
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

Returns
Whether the offset field is set.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.

◆ hasScalingFactor()

boolean com.google.ortools.sat.LinearObjectiveOrBuilder.hasScalingFactor ( )

optional double scaling_factor = 4 [default = 1];

Returns
Whether the scalingFactor field is set.

Implemented in com.google.ortools.sat.LinearObjective, and com.google.ortools.sat.LinearObjective.Builder.


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