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

Classes

class  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 ()
 
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< LinearObjectivegetParserForType ()
 
com.google.ortools.sat.LinearObjective getDefaultInstanceForType ()
 

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
 
static com.google.ortools.sat.LinearObjective parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
 
static com.google.ortools.sat.LinearObjective parseFrom (java.io.InputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearObjective parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
static com.google.ortools.sat.LinearObjective parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearObjective parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
static com.google.ortools.sat.LinearObjective parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException
 
static com.google.ortools.sat.LinearObjective 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.LinearObjective prototype)
 
static com.google.ortools.sat.LinearObjective getDefaultInstance ()
 
static com.google.protobuf.Parser< LinearObjectiveparser ()
 

Static Public Attributes

static final int LITERALS_FIELD_NUMBER = 1
 
static final int COEFFICIENTS_FIELD_NUMBER = 2
 
static final int OFFSET_FIELD_NUMBER = 3
 
static final int SCALING_FACTOR_FIELD_NUMBER = 4
 
static final com.google.protobuf.Parser< LinearObjectivePARSER
 

Protected Member Functions

java.lang.Object newInstance (UnusedPrivateParameter unused)
 
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ()
 
Builder newBuilderForType (com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
 

Detailed Description

The objective of an optimization problem.

Protobuf type operations_research.sat.LinearObjective

Definition at line 14 of file LinearObjective.java.

Member Function Documentation

◆ equals()

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

Definition at line 260 of file LinearObjective.java.

◆ getCoefficients()

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

repeated int64 coefficients = 2;

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

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 131 of file LinearObjective.java.

◆ getCoefficientsCount()

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

repeated int64 coefficients = 2;

Returns
The count of coefficients.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 123 of file LinearObjective.java.

◆ getCoefficientsList()

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

repeated int64 coefficients = 2;

Returns
A list containing the coefficients.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 116 of file LinearObjective.java.

◆ getDefaultInstance()

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

Definition at line 1035 of file LinearObjective.java.

◆ getDefaultInstanceForType()

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

Definition at line 1071 of file LinearObjective.java.

◆ getDescriptor()

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

Definition at line 37 of file LinearObjective.java.

◆ getLiterals()

int com.google.ortools.sat.LinearObjective.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.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 102 of file LinearObjective.java.

◆ getLiteralsCount()

int com.google.ortools.sat.LinearObjective.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.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 85 of file LinearObjective.java.

◆ getLiteralsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.LinearObjective.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.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 69 of file LinearObjective.java.

◆ getOffset()

double com.google.ortools.sat.LinearObjective.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.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 170 of file LinearObjective.java.

◆ getParserForType()

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

Definition at line 1066 of file LinearObjective.java.

◆ getScalingFactor()

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

optional double scaling_factor = 4 [default = 1];

Returns
The scalingFactor.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 189 of file LinearObjective.java.

◆ getSerializedSize()

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

Definition at line 223 of file LinearObjective.java.

◆ hashCode()

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

Definition at line 290 of file LinearObjective.java.

◆ hasOffset()

boolean com.google.ortools.sat.LinearObjective.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.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 152 of file LinearObjective.java.

◆ hasScalingFactor()

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

optional double scaling_factor = 4 [default = 1];

Returns
Whether the scalingFactor field is set.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 181 of file LinearObjective.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessageV3.FieldAccessorTable com.google.ortools.sat.LinearObjective.internalGetFieldAccessorTable ( )
protected

Definition at line 43 of file LinearObjective.java.

◆ isInitialized()

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

Definition at line 195 of file LinearObjective.java.

◆ newBuilder() [1/2]

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

Definition at line 393 of file LinearObjective.java.

◆ newBuilder() [2/2]

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

Definition at line 396 of file LinearObjective.java.

◆ newBuilderForType() [1/2]

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

Definition at line 392 of file LinearObjective.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.sat.LinearObjective.newBuilderForType ( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
protected

Definition at line 406 of file LinearObjective.java.

◆ newInstance()

java.lang.Object com.google.ortools.sat.LinearObjective.newInstance ( UnusedPrivateParameter unused)
protected

Definition at line 31 of file LinearObjective.java.

◆ parseDelimitedFrom() [1/2]

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

Definition at line 364 of file LinearObjective.java.

◆ parseDelimitedFrom() [2/2]

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

Definition at line 370 of file LinearObjective.java.

◆ parseFrom() [1/10]

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

Definition at line 341 of file LinearObjective.java.

◆ parseFrom() [2/10]

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

Definition at line 345 of file LinearObjective.java.

◆ parseFrom() [3/10]

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

Definition at line 330 of file LinearObjective.java.

◆ parseFrom() [4/10]

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

Definition at line 335 of file LinearObjective.java.

◆ parseFrom() [5/10]

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

Definition at line 377 of file LinearObjective.java.

◆ parseFrom() [6/10]

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

Definition at line 383 of file LinearObjective.java.

◆ parseFrom() [7/10]

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

Definition at line 351 of file LinearObjective.java.

◆ parseFrom() [8/10]

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

Definition at line 356 of file LinearObjective.java.

◆ parseFrom() [9/10]

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

Definition at line 319 of file LinearObjective.java.

◆ parseFrom() [10/10]

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

Definition at line 324 of file LinearObjective.java.

◆ parser()

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

Definition at line 1061 of file LinearObjective.java.

◆ toBuilder()

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

Definition at line 400 of file LinearObjective.java.

◆ writeTo()

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

Definition at line 205 of file LinearObjective.java.

Member Data Documentation

◆ COEFFICIENTS_FIELD_NUMBER

final int com.google.ortools.sat.LinearObjective.COEFFICIENTS_FIELD_NUMBER = 2
static

Definition at line 106 of file LinearObjective.java.

◆ LITERALS_FIELD_NUMBER

final int com.google.ortools.sat.LinearObjective.LITERALS_FIELD_NUMBER = 1
static

Definition at line 50 of file LinearObjective.java.

◆ OFFSET_FIELD_NUMBER

final int com.google.ortools.sat.LinearObjective.OFFSET_FIELD_NUMBER = 3
static

Definition at line 135 of file LinearObjective.java.

◆ PARSER

final com.google.protobuf.Parser<LinearObjective> com.google.ortools.sat.LinearObjective.PARSER
static
Initial value:
= new com.google.protobuf.AbstractParser<LinearObjective>() {
@java.lang.Override
public LinearObjective parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
}

Definition at line 1040 of file LinearObjective.java.

◆ SCALING_FACTOR_FIELD_NUMBER

final int com.google.ortools.sat.LinearObjective.SCALING_FACTOR_FIELD_NUMBER = 4
static

Definition at line 174 of file LinearObjective.java.


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