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

Detailed Description

Optimization objective.

Protobuf type operations_research.sat.CpObjectiveProto

Definition at line 16 of file CpObjectiveProto.java.

Inheritance diagram for com.google.ortools.sat.CpObjectiveProto:
com.google.ortools.sat.CpObjectiveProtoOrBuilder

Classes

class  Builder

Public Member Functions

java.util.List< java.lang.Integer > getVarsList ()
int getVarsCount ()
int getVars (int index)
java.util.List< java.lang.Long > getCoeffsList ()
int getCoeffsCount ()
long getCoeffs (int index)
double getOffset ()
double getScalingFactor ()
java.util.List< java.lang.Long > getDomainList ()
int getDomainCount ()
long getDomain (int index)
boolean getScalingWasExact ()
long getIntegerBeforeOffset ()
long getIntegerAfterOffset ()
long getIntegerScalingFactor ()
final boolean isInitialized ()
void writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException
int getSerializedSize ()
boolean equals (final java.lang.Object obj)
int hashCode ()
Builder newBuilderForType ()
Builder toBuilder ()
com.google.protobuf.Parser< CpObjectiveProtogetParserForType ()
com.google.ortools.sat.CpObjectiveProto getDefaultInstanceForType ()

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
static com.google.ortools.sat.CpObjectiveProto parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
static com.google.ortools.sat.CpObjectiveProto parseFrom (java.io.InputStream input) throws java.io.IOException
static com.google.ortools.sat.CpObjectiveProto parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static com.google.ortools.sat.CpObjectiveProto parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException
static com.google.ortools.sat.CpObjectiveProto parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static com.google.ortools.sat.CpObjectiveProto parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException
static com.google.ortools.sat.CpObjectiveProto parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
static Builder newBuilder ()
static Builder newBuilder (com.google.ortools.sat.CpObjectiveProto prototype)
static com.google.ortools.sat.CpObjectiveProto getDefaultInstance ()
static com.google.protobuf.Parser< CpObjectiveProtoparser ()

Static Public Attributes

static final int VARS_FIELD_NUMBER = 1
static final int COEFFS_FIELD_NUMBER = 4
static final int OFFSET_FIELD_NUMBER = 2
static final int SCALING_FACTOR_FIELD_NUMBER = 3
static final int DOMAIN_FIELD_NUMBER = 5
static final int SCALING_WAS_EXACT_FIELD_NUMBER = 6
static final int INTEGER_BEFORE_OFFSET_FIELD_NUMBER = 7
static final int INTEGER_AFTER_OFFSET_FIELD_NUMBER = 9
static final int INTEGER_SCALING_FACTOR_FIELD_NUMBER = 8

Protected Member Functions

com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable ()
Builder newBuilderForType (com.google.protobuf.GeneratedMessage.BuilderParent parent)

Member Function Documentation

◆ equals()

boolean com.google.ortools.sat.CpObjectiveProto.equals ( final java.lang.Object obj)

Definition at line 413 of file CpObjectiveProto.java.

◆ getCoeffs()

long com.google.ortools.sat.CpObjectiveProto.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 126 of file CpObjectiveProto.java.

◆ getCoeffsCount()

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

repeated int64 coeffs = 4;

Returns
The count of coeffs.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 118 of file CpObjectiveProto.java.

◆ getCoeffsList()

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

repeated int64 coeffs = 4;

Returns
A list containing the coeffs.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 111 of file CpObjectiveProto.java.

◆ getDefaultInstance()

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.getDefaultInstance ( )
static

Definition at line 1512 of file CpObjectiveProto.java.

◆ getDefaultInstanceForType()

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

Definition at line 1548 of file CpObjectiveProto.java.

◆ getDescriptor()

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

Definition at line 41 of file CpObjectiveProto.java.

◆ getDomain()

long com.google.ortools.sat.CpObjectiveProto.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 206 of file CpObjectiveProto.java.

◆ getDomainCount()

int com.google.ortools.sat.CpObjectiveProto.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 192 of file CpObjectiveProto.java.

◆ getDomainList()

java.util.List< java.lang.Long > com.google.ortools.sat.CpObjectiveProto.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 179 of file CpObjectiveProto.java.

◆ getIntegerAfterOffset()

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

int64 integer_after_offset = 9;

Returns
The integerAfterOffset.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 263 of file CpObjectiveProto.java.

◆ getIntegerBeforeOffset()

long com.google.ortools.sat.CpObjectiveProto.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 252 of file CpObjectiveProto.java.

◆ getIntegerScalingFactor()

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

int64 integer_scaling_factor = 8;

Returns
The integerScalingFactor.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 274 of file CpObjectiveProto.java.

◆ getOffset()

double com.google.ortools.sat.CpObjectiveProto.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 148 of file CpObjectiveProto.java.

◆ getParserForType()

com.google.protobuf.Parser< CpObjectiveProto > com.google.ortools.sat.CpObjectiveProto.getParserForType ( )

Definition at line 1543 of file CpObjectiveProto.java.

◆ getScalingFactor()

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

double scaling_factor = 3;

Returns
The scalingFactor.

Implements com.google.ortools.sat.CpObjectiveProtoOrBuilder.

Definition at line 159 of file CpObjectiveProto.java.

◆ getScalingWasExact()

boolean com.google.ortools.sat.CpObjectiveProto.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 226 of file CpObjectiveProto.java.

◆ getSerializedSize()

int com.google.ortools.sat.CpObjectiveProto.getSerializedSize ( )

Definition at line 336 of file CpObjectiveProto.java.

◆ getVars()

int com.google.ortools.sat.CpObjectiveProto.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 96 of file CpObjectiveProto.java.

◆ getVarsCount()

int com.google.ortools.sat.CpObjectiveProto.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 82 of file CpObjectiveProto.java.

◆ getVarsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.CpObjectiveProto.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 69 of file CpObjectiveProto.java.

◆ hashCode()

int com.google.ortools.sat.CpObjectiveProto.hashCode ( )

Definition at line 447 of file CpObjectiveProto.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 47 of file CpObjectiveProto.java.

◆ isInitialized()

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

Definition at line 280 of file CpObjectiveProto.java.

◆ newBuilder() [1/2]

Builder com.google.ortools.sat.CpObjectiveProto.newBuilder ( )
static

Definition at line 562 of file CpObjectiveProto.java.

◆ newBuilder() [2/2]

Builder com.google.ortools.sat.CpObjectiveProto.newBuilder ( com.google.ortools.sat.CpObjectiveProto prototype)
static

Definition at line 565 of file CpObjectiveProto.java.

◆ newBuilderForType() [1/2]

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

Definition at line 561 of file CpObjectiveProto.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.sat.CpObjectiveProto.newBuilderForType ( com.google.protobuf.GeneratedMessage.BuilderParent parent)
protected

Definition at line 575 of file CpObjectiveProto.java.

◆ parseDelimitedFrom() [1/2]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseDelimitedFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 533 of file CpObjectiveProto.java.

◆ parseDelimitedFrom() [2/2]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseDelimitedFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 539 of file CpObjectiveProto.java.

◆ parseFrom() [1/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 510 of file CpObjectiveProto.java.

◆ parseFrom() [2/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 514 of file CpObjectiveProto.java.

◆ parseFrom() [3/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 499 of file CpObjectiveProto.java.

◆ parseFrom() [4/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 504 of file CpObjectiveProto.java.

◆ parseFrom() [5/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( com.google.protobuf.CodedInputStream input) throws java.io.IOException
static

Definition at line 546 of file CpObjectiveProto.java.

◆ parseFrom() [6/10]

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

Definition at line 552 of file CpObjectiveProto.java.

◆ parseFrom() [7/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 520 of file CpObjectiveProto.java.

◆ parseFrom() [8/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 525 of file CpObjectiveProto.java.

◆ parseFrom() [9/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 488 of file CpObjectiveProto.java.

◆ parseFrom() [10/10]

com.google.ortools.sat.CpObjectiveProto com.google.ortools.sat.CpObjectiveProto.parseFrom ( java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 493 of file CpObjectiveProto.java.

◆ parser()

com.google.protobuf.Parser< CpObjectiveProto > com.google.ortools.sat.CpObjectiveProto.parser ( )
static

Definition at line 1538 of file CpObjectiveProto.java.

◆ toBuilder()

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

Definition at line 569 of file CpObjectiveProto.java.

◆ writeTo()

void com.google.ortools.sat.CpObjectiveProto.writeTo ( com.google.protobuf.CodedOutputStream output) throws java.io.IOException

Definition at line 290 of file CpObjectiveProto.java.

Member Data Documentation

◆ COEFFS_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.COEFFS_FIELD_NUMBER = 4
static

Definition at line 101 of file CpObjectiveProto.java.

◆ DOMAIN_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.DOMAIN_FIELD_NUMBER = 5
static

Definition at line 163 of file CpObjectiveProto.java.

◆ INTEGER_AFTER_OFFSET_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.INTEGER_AFTER_OFFSET_FIELD_NUMBER = 9
static

Definition at line 256 of file CpObjectiveProto.java.

◆ INTEGER_BEFORE_OFFSET_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.INTEGER_BEFORE_OFFSET_FIELD_NUMBER = 7
static

Definition at line 230 of file CpObjectiveProto.java.

◆ INTEGER_SCALING_FACTOR_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.INTEGER_SCALING_FACTOR_FIELD_NUMBER = 8
static

Definition at line 267 of file CpObjectiveProto.java.

◆ OFFSET_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.OFFSET_FIELD_NUMBER = 2
static

Definition at line 131 of file CpObjectiveProto.java.

◆ SCALING_FACTOR_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.SCALING_FACTOR_FIELD_NUMBER = 3
static

Definition at line 152 of file CpObjectiveProto.java.

◆ SCALING_WAS_EXACT_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.SCALING_WAS_EXACT_FIELD_NUMBER = 6
static

Definition at line 211 of file CpObjectiveProto.java.

◆ VARS_FIELD_NUMBER

final int com.google.ortools.sat.CpObjectiveProto.VARS_FIELD_NUMBER = 1
static

Definition at line 53 of file CpObjectiveProto.java.


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