Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.CpObjectiveProto.Builder Class Reference
Inheritance diagram for com.google.ortools.sat.CpObjectiveProto.Builder:
com.google.ortools.sat.CpObjectiveProtoOrBuilder

Public Member Functions

Builder clear ()
 
com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
com.google.ortools.sat.CpObjectiveProto getDefaultInstanceForType ()
 
com.google.ortools.sat.CpObjectiveProto build ()
 
com.google.ortools.sat.CpObjectiveProto buildPartial ()
 
Builder mergeFrom (com.google.protobuf.Message other)
 
Builder mergeFrom (com.google.ortools.sat.CpObjectiveProto other)
 
final boolean isInitialized ()
 
Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
java.util.List< java.lang.Integer > getVarsList ()
 
int getVarsCount ()
 
int getVars (int index)
 
Builder setVars (int index, int value)
 
Builder addVars (int value)
 
Builder addAllVars (java.lang.Iterable<? extends java.lang.Integer > values)
 
Builder clearVars ()
 
java.util.List< java.lang.Long > getCoeffsList ()
 
int getCoeffsCount ()
 
long getCoeffs (int index)
 
Builder setCoeffs (int index, long value)
 
Builder addCoeffs (long value)
 
Builder addAllCoeffs (java.lang.Iterable<? extends java.lang.Long > values)
 
Builder clearCoeffs ()
 
double getOffset ()
 
Builder setOffset (double value)
 
Builder clearOffset ()
 
double getScalingFactor ()
 
Builder setScalingFactor (double value)
 
Builder clearScalingFactor ()
 
java.util.List< java.lang.Long > getDomainList ()
 
int getDomainCount ()
 
long getDomain (int index)
 
Builder setDomain (int index, long value)
 
Builder addDomain (long value)
 
Builder addAllDomain (java.lang.Iterable<? extends java.lang.Long > values)
 
Builder clearDomain ()
 
boolean getScalingWasExact ()
 
Builder setScalingWasExact (boolean value)
 
Builder clearScalingWasExact ()
 
long getIntegerBeforeOffset ()
 
Builder setIntegerBeforeOffset (long value)
 
Builder clearIntegerBeforeOffset ()
 
long getIntegerAfterOffset ()
 
Builder setIntegerAfterOffset (long value)
 
Builder clearIntegerAfterOffset ()
 
long getIntegerScalingFactor ()
 
Builder setIntegerScalingFactor (long value)
 
Builder clearIntegerScalingFactor ()
 
- Public Member Functions inherited from com.google.ortools.sat.CpObjectiveProtoOrBuilder

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
 

Protected Member Functions

com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable ()
 

Detailed Description

Optimization objective.

Protobuf type operations_research.sat.CpObjectiveProto

Definition at line 585 of file CpObjectiveProto.java.

Member Function Documentation

◆ addAllCoeffs()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addAllCoeffs ( java.lang.Iterable<? extends java.lang.Long > values)

repeated int64 coeffs = 4;

Parameters
valuesThe coeffs to add.
Returns
This builder for chaining.

Definition at line 1064 of file CpObjectiveProto.java.

◆ addAllDomain()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addAllDomain ( java.lang.Iterable<? extends java.lang.Long > values)
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Parameters
valuesThe domain to add.
Returns
This builder for chaining.

Definition at line 1278 of file CpObjectiveProto.java.

◆ addAllVars()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addAllVars ( java.lang.Iterable<? extends java.lang.Integer > values)
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Parameters
valuesThe vars to add.
Returns
This builder for chaining.

Definition at line 974 of file CpObjectiveProto.java.

◆ addCoeffs()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addCoeffs ( long value)

repeated int64 coeffs = 4;

Parameters
valueThe coeffs to add.
Returns
This builder for chaining.

Definition at line 1051 of file CpObjectiveProto.java.

◆ addDomain()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addDomain ( long value)
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Parameters
valueThe domain to add.
Returns
This builder for chaining.

Definition at line 1259 of file CpObjectiveProto.java.

◆ addVars()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.addVars ( int value)
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Parameters
valueThe vars to add.
Returns
This builder for chaining.

Definition at line 955 of file CpObjectiveProto.java.

◆ build()

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.Builder.build ( )

Definition at line 640 of file CpObjectiveProto.java.

◆ buildPartial()

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.Builder.buildPartial ( )

Definition at line 649 of file CpObjectiveProto.java.

◆ clear()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clear ( )

Definition at line 613 of file CpObjectiveProto.java.

◆ clearCoeffs()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearCoeffs ( )

repeated int64 coeffs = 4;

Returns
This builder for chaining.

Definition at line 1077 of file CpObjectiveProto.java.

◆ clearDomain()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearDomain ( )
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Returns
This builder for chaining.

Definition at line 1297 of file CpObjectiveProto.java.

◆ clearIntegerAfterOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearIntegerAfterOffset ( )

int64 integer_after_offset = 9;

Returns
This builder for chaining.

Definition at line 1462 of file CpObjectiveProto.java.

◆ clearIntegerBeforeOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearIntegerBeforeOffset ( )
Internal fields to recover a bound on the original integer objective from
the presolved one. Basically, initially the integer objective fit on an
int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change
the linear expression to have a new domain [Presolved_lb, Presolved_ub]
that will also always fit on an int64.

The two domain will always be linked with an affine transformation between
the two of the form:
old = (new + before_offset) * integer_scaling_factor + after_offset.
Note that we use both offsets to always be able to do the computation while
staying in the int64 domain. In particular, the after_offset will always
be in (-integer_scaling_factor, integer_scaling_factor).

int64 integer_before_offset = 7;

Returns
This builder for chaining.

Definition at line 1430 of file CpObjectiveProto.java.

◆ clearIntegerScalingFactor()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearIntegerScalingFactor ( )

int64 integer_scaling_factor = 8;

Returns
This builder for chaining.

Definition at line 1494 of file CpObjectiveProto.java.

◆ clearOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearOffset ( )
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
This is needed to have a consistent objective after presolve or when
scaling a double problem to express it with integers.

Note that if scaling_factor is zero, then it is assumed to be 1, so that by
default these fields have no effect.

double offset = 2;

Returns
This builder for chaining.

Definition at line 1139 of file CpObjectiveProto.java.

◆ clearScalingFactor()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearScalingFactor ( )

double scaling_factor = 3;

Returns
This builder for chaining.

Definition at line 1171 of file CpObjectiveProto.java.

◆ clearScalingWasExact()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearScalingWasExact ( )
Internal field. Do not set. When we scale a FloatObjectiveProto to a
integer version, we set this to true if the scaling was exact (i.e. all
original coeff were integer for instance).

TODO(user): Put the error bounds we computed instead?

bool scaling_was_exact = 6;

Returns
This builder for chaining.

Definition at line 1353 of file CpObjectiveProto.java.

◆ clearVars()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.clearVars ( )
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Returns
This builder for chaining.

Definition at line 993 of file CpObjectiveProto.java.

◆ getCoeffs()

long com.google.ortools.sat.CpObjectiveProto.Builder.getCoeffs ( int index)

repeated int64 coeffs = 4;

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

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1028 of file CpObjectiveProto.java.

◆ getCoeffsCount()

int com.google.ortools.sat.CpObjectiveProto.Builder.getCoeffsCount ( )

repeated int64 coeffs = 4;

Returns
The count of coeffs.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1020 of file CpObjectiveProto.java.

◆ getCoeffsList()

java.util.List< java.lang.Long > com.google.ortools.sat.CpObjectiveProto.Builder.getCoeffsList ( )

repeated int64 coeffs = 4;

Returns
A list containing the coeffs.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1012 of file CpObjectiveProto.java.

◆ getDefaultInstanceForType()

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.Builder.getDefaultInstanceForType ( )

Definition at line 635 of file CpObjectiveProto.java.

◆ getDescriptor()

static final com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.CpObjectiveProto.Builder.getDescriptor ( )
static

Definition at line 590 of file CpObjectiveProto.java.

◆ getDescriptorForType()

com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.CpObjectiveProto.Builder.getDescriptorForType ( )

Definition at line 630 of file CpObjectiveProto.java.

◆ getDomain()

long com.google.ortools.sat.CpObjectiveProto.Builder.getDomain ( int index)
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

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

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1224 of file CpObjectiveProto.java.

◆ getDomainCount()

int com.google.ortools.sat.CpObjectiveProto.Builder.getDomainCount ( )
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Returns
The count of domain.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1210 of file CpObjectiveProto.java.

◆ getDomainList()

java.util.List< java.lang.Long > com.google.ortools.sat.CpObjectiveProto.Builder.getDomainList ( )
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Returns
A list containing the domain.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1196 of file CpObjectiveProto.java.

◆ getIntegerAfterOffset()

long com.google.ortools.sat.CpObjectiveProto.Builder.getIntegerAfterOffset ( )

int64 integer_after_offset = 9;

Returns
The integerAfterOffset.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1443 of file CpObjectiveProto.java.

◆ getIntegerBeforeOffset()

long com.google.ortools.sat.CpObjectiveProto.Builder.getIntegerBeforeOffset ( )
Internal fields to recover a bound on the original integer objective from
the presolved one. Basically, initially the integer objective fit on an
int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change
the linear expression to have a new domain [Presolved_lb, Presolved_ub]
that will also always fit on an int64.

The two domain will always be linked with an affine transformation between
the two of the form:
old = (new + before_offset) * integer_scaling_factor + after_offset.
Note that we use both offsets to always be able to do the computation while
staying in the int64 domain. In particular, the after_offset will always
be in (-integer_scaling_factor, integer_scaling_factor).

int64 integer_before_offset = 7;

Returns
The integerBeforeOffset.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1381 of file CpObjectiveProto.java.

◆ getIntegerScalingFactor()

long com.google.ortools.sat.CpObjectiveProto.Builder.getIntegerScalingFactor ( )

int64 integer_scaling_factor = 8;

Returns
The integerScalingFactor.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1475 of file CpObjectiveProto.java.

◆ getOffset()

double com.google.ortools.sat.CpObjectiveProto.Builder.getOffset ( )
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
This is needed to have a consistent objective after presolve or when
scaling a double problem to express it with integers.

Note that if scaling_factor is zero, then it is assumed to be 1, so that by
default these fields have no effect.

double offset = 2;

Returns
The offset.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1100 of file CpObjectiveProto.java.

◆ getScalingFactor()

double com.google.ortools.sat.CpObjectiveProto.Builder.getScalingFactor ( )

double scaling_factor = 3;

Returns
The scalingFactor.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1152 of file CpObjectiveProto.java.

◆ getScalingWasExact()

boolean com.google.ortools.sat.CpObjectiveProto.Builder.getScalingWasExact ( )
Internal field. Do not set. When we scale a FloatObjectiveProto to a
integer version, we set this to true if the scaling was exact (i.e. all
original coeff were integer for instance).

TODO(user): Put the error bounds we computed instead?

bool scaling_was_exact = 6;

Returns
The scalingWasExact.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 1318 of file CpObjectiveProto.java.

◆ getVars()

int com.google.ortools.sat.CpObjectiveProto.Builder.getVars ( int index)
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

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

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 920 of file CpObjectiveProto.java.

◆ getVarsCount()

int com.google.ortools.sat.CpObjectiveProto.Builder.getVarsCount ( )
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Returns
The count of vars.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 906 of file CpObjectiveProto.java.

◆ getVarsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.CpObjectiveProto.Builder.getVarsList ( )
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Returns
A list containing the vars.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 892 of file CpObjectiveProto.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.sat.CpObjectiveProto.Builder.internalGetFieldAccessorTable ( )
protected

Definition at line 596 of file CpObjectiveProto.java.

◆ isInitialized()

final boolean com.google.ortools.sat.CpObjectiveProto.Builder.isInitialized ( )

Definition at line 759 of file CpObjectiveProto.java.

◆ mergeFrom() [1/3]

Builder com.google.ortools.sat.CpObjectiveProto.Builder.mergeFrom ( com.google.ortools.sat.CpObjectiveProto other)

Definition at line 700 of file CpObjectiveProto.java.

◆ mergeFrom() [2/3]

Builder com.google.ortools.sat.CpObjectiveProto.Builder.mergeFrom ( com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException

Definition at line 764 of file CpObjectiveProto.java.

◆ mergeFrom() [3/3]

Builder com.google.ortools.sat.CpObjectiveProto.Builder.mergeFrom ( com.google.protobuf.Message other)

Definition at line 691 of file CpObjectiveProto.java.

◆ setCoeffs()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setCoeffs ( int index,
long value )

repeated int64 coeffs = 4;

Parameters
indexThe index to set the value at.
valueThe coeffs to set.
Returns
This builder for chaining.

Definition at line 1037 of file CpObjectiveProto.java.

◆ setDomain()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setDomain ( int index,
long value )
If non-empty, only look for an objective value in the given domain.
Note that this does not depend on the offset or scaling factor, it is a
domain on the sum of the objective terms only.

repeated int64 domain = 5;

Parameters
indexThe index to set the value at.
valueThe domain to set.
Returns
This builder for chaining.

Definition at line 1239 of file CpObjectiveProto.java.

◆ setIntegerAfterOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setIntegerAfterOffset ( long value)

int64 integer_after_offset = 9;

Parameters
valueThe integerAfterOffset to set.
Returns
This builder for chaining.

Definition at line 1451 of file CpObjectiveProto.java.

◆ setIntegerBeforeOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setIntegerBeforeOffset ( long value)
Internal fields to recover a bound on the original integer objective from
the presolved one. Basically, initially the integer objective fit on an
int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change
the linear expression to have a new domain [Presolved_lb, Presolved_ub]
that will also always fit on an int64.

The two domain will always be linked with an affine transformation between
the two of the form:
old = (new + before_offset) * integer_scaling_factor + after_offset.
Note that we use both offsets to always be able to do the computation while
staying in the int64 domain. In particular, the after_offset will always
be in (-integer_scaling_factor, integer_scaling_factor).

int64 integer_before_offset = 7;

Parameters
valueThe integerBeforeOffset to set.
Returns
This builder for chaining.

Definition at line 1404 of file CpObjectiveProto.java.

◆ setIntegerScalingFactor()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setIntegerScalingFactor ( long value)

int64 integer_scaling_factor = 8;

Parameters
valueThe integerScalingFactor to set.
Returns
This builder for chaining.

Definition at line 1483 of file CpObjectiveProto.java.

◆ setOffset()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setOffset ( double value)
The displayed objective is always:
scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
This is needed to have a consistent objective after presolve or when
scaling a double problem to express it with integers.

Note that if scaling_factor is zero, then it is assumed to be 1, so that by
default these fields have no effect.

double offset = 2;

Parameters
valueThe offset to set.
Returns
This builder for chaining.

Definition at line 1118 of file CpObjectiveProto.java.

◆ setScalingFactor()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setScalingFactor ( double value)

double scaling_factor = 3;

Parameters
valueThe scalingFactor to set.
Returns
This builder for chaining.

Definition at line 1160 of file CpObjectiveProto.java.

◆ setScalingWasExact()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setScalingWasExact ( boolean value)
Internal field. Do not set. When we scale a FloatObjectiveProto to a
integer version, we set this to true if the scaling was exact (i.e. all
original coeff were integer for instance).

TODO(user): Put the error bounds we computed instead?

bool scaling_was_exact = 6;

Parameters
valueThe scalingWasExact to set.
Returns
This builder for chaining.

Definition at line 1334 of file CpObjectiveProto.java.

◆ setVars()

Builder com.google.ortools.sat.CpObjectiveProto.Builder.setVars ( int index,
int value )
The linear terms of the objective to minimize.
For a maximization problem, one can negate all coefficients in the
objective and set scaling_factor to -1.

repeated int32 vars = 1;

Parameters
indexThe index to set the value at.
valueThe vars to set.
Returns
This builder for chaining.

Definition at line 935 of file CpObjectiveProto.java.


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