Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPConstraintProto Class Reference
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
 
static final com.google.protobuf.Parser< MPConstraintProtoPARSER
 

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

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 24 of file MPConstraintProto.java.

Member Function Documentation

◆ equals()

boolean com.google.ortools.linearsolver.MPConstraintProto.equals ( final java.lang.Object obj)

Definition at line 391 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 150 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 138 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 127 of file MPConstraintProto.java.

◆ getDefaultInstance()

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

Definition at line 1392 of file MPConstraintProto.java.

◆ getDefaultInstanceForType()

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

Definition at line 1428 of file MPConstraintProto.java.

◆ getDescriptor()

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

Definition at line 49 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 291 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 178 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 225 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 249 of file MPConstraintProto.java.

◆ getParserForType()

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

Definition at line 1423 of file MPConstraintProto.java.

◆ getSerializedSize()

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

Definition at line 340 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 197 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 108 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 93 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 79 of file MPConstraintProto.java.

◆ hashCode()

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

Definition at line 431 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 276 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 166 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 213 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 189 of file MPConstraintProto.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 55 of file MPConstraintProto.java.

◆ isInitialized()

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

Definition at line 297 of file MPConstraintProto.java.

◆ newBuilder() [1/2]

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

Definition at line 543 of file MPConstraintProto.java.

◆ newBuilder() [2/2]

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

Definition at line 546 of file MPConstraintProto.java.

◆ newBuilderForType() [1/2]

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

Definition at line 542 of file MPConstraintProto.java.

◆ newBuilderForType() [2/2]

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

Definition at line 556 of file MPConstraintProto.java.

◆ newInstance()

java.lang.Object com.google.ortools.linearsolver.MPConstraintProto.newInstance ( UnusedPrivateParameter unused)
protected

Definition at line 43 of file MPConstraintProto.java.

◆ parseDelimitedFrom() [1/2]

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

Definition at line 514 of file MPConstraintProto.java.

◆ parseDelimitedFrom() [2/2]

static 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 520 of file MPConstraintProto.java.

◆ parseFrom() [1/10]

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

Definition at line 491 of file MPConstraintProto.java.

◆ parseFrom() [2/10]

static 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 495 of file MPConstraintProto.java.

◆ parseFrom() [3/10]

static 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 480 of file MPConstraintProto.java.

◆ parseFrom() [4/10]

static 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 485 of file MPConstraintProto.java.

◆ parseFrom() [5/10]

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

Definition at line 527 of file MPConstraintProto.java.

◆ parseFrom() [6/10]

static 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 533 of file MPConstraintProto.java.

◆ parseFrom() [7/10]

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

Definition at line 501 of file MPConstraintProto.java.

◆ parseFrom() [8/10]

static 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 506 of file MPConstraintProto.java.

◆ parseFrom() [9/10]

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

Definition at line 469 of file MPConstraintProto.java.

◆ parseFrom() [10/10]

static 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 474 of file MPConstraintProto.java.

◆ parser()

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

Definition at line 1418 of file MPConstraintProto.java.

◆ toBuilder()

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

Definition at line 550 of file MPConstraintProto.java.

◆ writeTo()

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

Definition at line 307 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 113 of file MPConstraintProto.java.

◆ IS_LAZY_FIELD_NUMBER

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

Definition at line 262 of file MPConstraintProto.java.

◆ LOWER_BOUND_FIELD_NUMBER

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

Definition at line 155 of file MPConstraintProto.java.

◆ NAME_FIELD_NUMBER

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

Definition at line 201 of file MPConstraintProto.java.

◆ PARSER

final com.google.protobuf.Parser<MPConstraintProto> com.google.ortools.linearsolver.MPConstraintProto.PARSER
static
Initial value:
= new com.google.protobuf.AbstractParser<MPConstraintProto>() {
@java.lang.Override
public MPConstraintProto 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 1397 of file MPConstraintProto.java.

◆ UPPER_BOUND_FIELD_NUMBER

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

Definition at line 182 of file MPConstraintProto.java.

◆ VAR_INDEX_FIELD_NUMBER

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

Definition at line 62 of file MPConstraintProto.java.


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