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

Detailed Description

A linear constraint is always of the form:
lower_bound <= sum of linear term elements <= upper_bound,
where lower_bound and upper_bound:
- Can form a singleton: lower_bound == upper_bound. The constraint is an
equation.
- Can form a finite interval [lower_bound, upper_bound]. The constraint is
both lower- and upper-bounded, i.e. "boxed".
- Can form a semi-infinite interval. lower_bound = -infinity: the constraint
is upper-bounded. upper_bound = +infinity: the constraint is lower-bounded.
- Can form the infinite interval: lower_bound = -infinity and
upper_bound = +infinity. The constraint is free.

Protobuf type operations_research.MPConstraintProto

Definition at line 26 of file MPConstraintProto.java.

Inheritance diagram for com.google.ortools.linearsolver.MPConstraintProto:
com.google.ortools.linearsolver.MPConstraintProtoOrBuilder

Classes

class  Builder

Public Member Functions

java.util.List< java.lang.Integer > getVarIndexList ()
int getVarIndexCount ()
int getVarIndex (int index)
java.util.List< java.lang.Double > getCoefficientList ()
int getCoefficientCount ()
double getCoefficient (int index)
boolean hasLowerBound ()
double getLowerBound ()
boolean hasUpperBound ()
double getUpperBound ()
boolean hasName ()
java.lang.String getName ()
com.google.protobuf.ByteString getNameBytes ()
boolean hasIsLazy ()
boolean getIsLazy ()
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< MPConstraintProtogetParserForType ()
com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType ()

Static Public Member Functions

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

Static Public Attributes

static final int VAR_INDEX_FIELD_NUMBER = 6
static final int COEFFICIENT_FIELD_NUMBER = 7
static final int LOWER_BOUND_FIELD_NUMBER = 2
static final int UPPER_BOUND_FIELD_NUMBER = 3
static final int NAME_FIELD_NUMBER = 4
static final int IS_LAZY_FIELD_NUMBER = 5

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.linearsolver.MPConstraintProto.equals ( final java.lang.Object obj)

Definition at line 395 of file MPConstraintProto.java.

◆ getCoefficient()

double com.google.ortools.linearsolver.MPConstraintProto.getCoefficient ( int index)
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 154 of file MPConstraintProto.java.

◆ getCoefficientCount()

int com.google.ortools.linearsolver.MPConstraintProto.getCoefficientCount ( )
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
The count of coefficient.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 142 of file MPConstraintProto.java.

◆ getCoefficientList()

java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPConstraintProto.getCoefficientList ( )
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
A list containing the coefficient.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 131 of file MPConstraintProto.java.

◆ getDefaultInstance()

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance ( )
static

Definition at line 1352 of file MPConstraintProto.java.

◆ getDefaultInstanceForType()

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstanceForType ( )

Definition at line 1388 of file MPConstraintProto.java.

◆ getDescriptor()

final com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPConstraintProto.getDescriptor ( )
static

Definition at line 53 of file MPConstraintProto.java.

◆ getIsLazy()

boolean com.google.ortools.linearsolver.MPConstraintProto.getIsLazy ( )
[Advanced usage: do not use this if you don't know what you're doing.]
A lazy constraint is handled differently by the core solving engine, but
it does not change the result. It may or may not impact the performance.
For more info see: http://tinyurl.com/lazy-constraints.

optional bool is_lazy = 5 [default = false];

Returns
The isLazy.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 295 of file MPConstraintProto.java.

◆ getLowerBound()

double com.google.ortools.linearsolver.MPConstraintProto.getLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 2 [default = -inf];

Returns
The lowerBound.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 182 of file MPConstraintProto.java.

◆ getName()

java.lang.String com.google.ortools.linearsolver.MPConstraintProto.getName ( )
The name of the constraint.

optional string name = 4 [default = ""];

Returns
The name.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 229 of file MPConstraintProto.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.linearsolver.MPConstraintProto.getNameBytes ( )
The name of the constraint.

optional string name = 4 [default = ""];

Returns
The bytes for name.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 253 of file MPConstraintProto.java.

◆ getParserForType()

com.google.protobuf.Parser< MPConstraintProto > com.google.ortools.linearsolver.MPConstraintProto.getParserForType ( )

Definition at line 1383 of file MPConstraintProto.java.

◆ getSerializedSize()

int com.google.ortools.linearsolver.MPConstraintProto.getSerializedSize ( )

Definition at line 344 of file MPConstraintProto.java.

◆ getUpperBound()

double com.google.ortools.linearsolver.MPConstraintProto.getUpperBound ( )

optional double upper_bound = 3 [default = inf];

Returns
The upperBound.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 201 of file MPConstraintProto.java.

◆ getVarIndex()

int com.google.ortools.linearsolver.MPConstraintProto.getVarIndex ( int index)
var_index[i] is the variable index (w.r.t. to "variable" field of
MPModelProto) of the i-th linear term involved in this constraint, and
coefficient[i] is its coefficient. Only the terms with non-zero
coefficients need to appear. var_index may not contain duplicates.

repeated int32 var_index = 6 [packed = true];

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

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 112 of file MPConstraintProto.java.

◆ getVarIndexCount()

int com.google.ortools.linearsolver.MPConstraintProto.getVarIndexCount ( )
var_index[i] is the variable index (w.r.t. to "variable" field of
MPModelProto) of the i-th linear term involved in this constraint, and
coefficient[i] is its coefficient. Only the terms with non-zero
coefficients need to appear. var_index may not contain duplicates.

repeated int32 var_index = 6 [packed = true];

Returns
The count of varIndex.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 97 of file MPConstraintProto.java.

◆ getVarIndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPConstraintProto.getVarIndexList ( )
var_index[i] is the variable index (w.r.t. to "variable" field of
MPModelProto) of the i-th linear term involved in this constraint, and
coefficient[i] is its coefficient. Only the terms with non-zero
coefficients need to appear. var_index may not contain duplicates.

repeated int32 var_index = 6 [packed = true];

Returns
A list containing the varIndex.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 83 of file MPConstraintProto.java.

◆ hashCode()

int com.google.ortools.linearsolver.MPConstraintProto.hashCode ( )

Definition at line 435 of file MPConstraintProto.java.

◆ hasIsLazy()

boolean com.google.ortools.linearsolver.MPConstraintProto.hasIsLazy ( )
[Advanced usage: do not use this if you don't know what you're doing.]
A lazy constraint is handled differently by the core solving engine, but
it does not change the result. It may or may not impact the performance.
For more info see: http://tinyurl.com/lazy-constraints.

optional bool is_lazy = 5 [default = false];

Returns
Whether the isLazy field is set.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 280 of file MPConstraintProto.java.

◆ hasLowerBound()

boolean com.google.ortools.linearsolver.MPConstraintProto.hasLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 2 [default = -inf];

Returns
Whether the lowerBound field is set.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 170 of file MPConstraintProto.java.

◆ hasName()

boolean com.google.ortools.linearsolver.MPConstraintProto.hasName ( )
The name of the constraint.

optional string name = 4 [default = ""];

Returns
Whether the name field is set.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 217 of file MPConstraintProto.java.

◆ hasUpperBound()

boolean com.google.ortools.linearsolver.MPConstraintProto.hasUpperBound ( )

optional double upper_bound = 3 [default = inf];

Returns
Whether the upperBound field is set.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 193 of file MPConstraintProto.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.linearsolver.MPConstraintProto.internalGetFieldAccessorTable ( )
protected

Definition at line 59 of file MPConstraintProto.java.

◆ isInitialized()

final boolean com.google.ortools.linearsolver.MPConstraintProto.isInitialized ( )

Definition at line 301 of file MPConstraintProto.java.

◆ newBuilder() [1/2]

Builder com.google.ortools.linearsolver.MPConstraintProto.newBuilder ( )
static

Definition at line 547 of file MPConstraintProto.java.

◆ newBuilder() [2/2]

Builder com.google.ortools.linearsolver.MPConstraintProto.newBuilder ( com.google.ortools.linearsolver.MPConstraintProto prototype)
static

Definition at line 550 of file MPConstraintProto.java.

◆ newBuilderForType() [1/2]

Builder com.google.ortools.linearsolver.MPConstraintProto.newBuilderForType ( )

Definition at line 546 of file MPConstraintProto.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.linearsolver.MPConstraintProto.newBuilderForType ( com.google.protobuf.GeneratedMessage.BuilderParent parent)
protected

Definition at line 560 of file MPConstraintProto.java.

◆ parseDelimitedFrom() [1/2]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseDelimitedFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 518 of file MPConstraintProto.java.

◆ parseDelimitedFrom() [2/2]

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

Definition at line 524 of file MPConstraintProto.java.

◆ parseFrom() [1/10]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseFrom ( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 495 of file MPConstraintProto.java.

◆ parseFrom() [2/10]

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

Definition at line 499 of file MPConstraintProto.java.

◆ parseFrom() [3/10]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseFrom ( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 484 of file MPConstraintProto.java.

◆ parseFrom() [4/10]

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

Definition at line 489 of file MPConstraintProto.java.

◆ parseFrom() [5/10]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseFrom ( com.google.protobuf.CodedInputStream input) throws java.io.IOException
static

Definition at line 531 of file MPConstraintProto.java.

◆ parseFrom() [6/10]

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

Definition at line 537 of file MPConstraintProto.java.

◆ parseFrom() [7/10]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 505 of file MPConstraintProto.java.

◆ parseFrom() [8/10]

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

Definition at line 510 of file MPConstraintProto.java.

◆ parseFrom() [9/10]

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.parseFrom ( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 473 of file MPConstraintProto.java.

◆ parseFrom() [10/10]

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

Definition at line 478 of file MPConstraintProto.java.

◆ parser()

com.google.protobuf.Parser< MPConstraintProto > com.google.ortools.linearsolver.MPConstraintProto.parser ( )
static

Definition at line 1378 of file MPConstraintProto.java.

◆ toBuilder()

Builder com.google.ortools.linearsolver.MPConstraintProto.toBuilder ( )

Definition at line 554 of file MPConstraintProto.java.

◆ writeTo()

void com.google.ortools.linearsolver.MPConstraintProto.writeTo ( com.google.protobuf.CodedOutputStream output) throws java.io.IOException

Definition at line 311 of file MPConstraintProto.java.

Member Data Documentation

◆ COEFFICIENT_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.COEFFICIENT_FIELD_NUMBER = 7
static

Definition at line 117 of file MPConstraintProto.java.

◆ IS_LAZY_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.IS_LAZY_FIELD_NUMBER = 5
static

Definition at line 266 of file MPConstraintProto.java.

◆ LOWER_BOUND_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.LOWER_BOUND_FIELD_NUMBER = 2
static

Definition at line 159 of file MPConstraintProto.java.

◆ NAME_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.NAME_FIELD_NUMBER = 4
static

Definition at line 205 of file MPConstraintProto.java.

◆ UPPER_BOUND_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.UPPER_BOUND_FIELD_NUMBER = 3
static

Definition at line 186 of file MPConstraintProto.java.

◆ VAR_INDEX_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPConstraintProto.VAR_INDEX_FIELD_NUMBER = 6
static

Definition at line 66 of file MPConstraintProto.java.


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