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

Public Member Functions

Builder clear ()
 
com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType ()
 
com.google.ortools.linearsolver.MPConstraintProto build ()
 
com.google.ortools.linearsolver.MPConstraintProto buildPartial ()
 
Builder mergeFrom (com.google.protobuf.Message other)
 
Builder mergeFrom (com.google.ortools.linearsolver.MPConstraintProto 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 > getVarIndexList ()
 
int getVarIndexCount ()
 
int getVarIndex (int index)
 
Builder setVarIndex (int index, int value)
 
Builder addVarIndex (int value)
 
Builder addAllVarIndex (java.lang.Iterable<? extends java.lang.Integer > values)
 
Builder clearVarIndex ()
 
java.util.List< java.lang.Double > getCoefficientList ()
 
int getCoefficientCount ()
 
double getCoefficient (int index)
 
Builder setCoefficient (int index, double value)
 
Builder addCoefficient (double value)
 
Builder addAllCoefficient (java.lang.Iterable<? extends java.lang.Double > values)
 
Builder clearCoefficient ()
 
boolean hasLowerBound ()
 
double getLowerBound ()
 
Builder setLowerBound (double value)
 
Builder clearLowerBound ()
 
boolean hasUpperBound ()
 
double getUpperBound ()
 
Builder setUpperBound (double value)
 
Builder clearUpperBound ()
 
boolean hasName ()
 
java.lang.String getName ()
 
com.google.protobuf.ByteString getNameBytes ()
 
Builder setName (java.lang.String value)
 
Builder clearName ()
 
Builder setNameBytes (com.google.protobuf.ByteString value)
 
boolean hasIsLazy ()
 
boolean getIsLazy ()
 
Builder setIsLazy (boolean value)
 
Builder clearIsLazy ()
 
- Public Member Functions inherited from com.google.ortools.linearsolver.MPConstraintProtoOrBuilder

Static Public Member Functions

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

Protected Member Functions

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

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

Member Function Documentation

◆ addAllCoefficient()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addAllCoefficient ( java.lang.Iterable<? extends java.lang.Double > values)
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Definition at line 1049 of file MPConstraintProto.java.

◆ addAllVarIndex()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addAllVarIndex ( java.lang.Iterable<? extends java.lang.Integer > values)
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
valuesThe varIndex to add.
Returns
This builder for chaining.

Definition at line 928 of file MPConstraintProto.java.

◆ addCoefficient()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addCoefficient ( double value)
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Definition at line 1032 of file MPConstraintProto.java.

◆ addVarIndex()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addVarIndex ( int value)
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
valueThe varIndex to add.
Returns
This builder for chaining.

Definition at line 908 of file MPConstraintProto.java.

◆ build()

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

Definition at line 632 of file MPConstraintProto.java.

◆ buildPartial()

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

Definition at line 641 of file MPConstraintProto.java.

◆ clear()

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

Definition at line 608 of file MPConstraintProto.java.

◆ clearCoefficient()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearCoefficient ( )
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
This builder for chaining.

Definition at line 1066 of file MPConstraintProto.java.

◆ clearIsLazy()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearIsLazy ( )
[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
This builder for chaining.

Definition at line 1334 of file MPConstraintProto.java.

◆ clearLowerBound()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearLowerBound ( )
lower_bound must be <= upper_bound.

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

Returns
This builder for chaining.

Definition at line 1122 of file MPConstraintProto.java.

◆ clearName()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearName ( )
The name of the constraint.

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

Returns
This builder for chaining.

Definition at line 1249 of file MPConstraintProto.java.

◆ clearUpperBound()

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

optional double upper_bound = 3 [default = inf];

Returns
This builder for chaining.

Definition at line 1162 of file MPConstraintProto.java.

◆ clearVarIndex()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearVarIndex ( )
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
This builder for chaining.

Definition at line 948 of file MPConstraintProto.java.

◆ getCoefficient()

double com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1001 of file MPConstraintProto.java.

◆ getCoefficientCount()

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

repeated double coefficient = 7 [packed = true];

Returns
The count of coefficient.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 989 of file MPConstraintProto.java.

◆ getCoefficientList()

java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPConstraintProto.Builder.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 977 of file MPConstraintProto.java.

◆ getDefaultInstanceForType()

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

Definition at line 627 of file MPConstraintProto.java.

◆ getDescriptor()

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

Definition at line 585 of file MPConstraintProto.java.

◆ getDescriptorForType()

com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPConstraintProto.Builder.getDescriptorForType ( )

Definition at line 622 of file MPConstraintProto.java.

◆ getIsLazy()

boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1301 of file MPConstraintProto.java.

◆ getLowerBound()

double com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1095 of file MPConstraintProto.java.

◆ getName()

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

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

Returns
The name.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 1189 of file MPConstraintProto.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1212 of file MPConstraintProto.java.

◆ getUpperBound()

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

optional double upper_bound = 3 [default = inf];

Returns
The upperBound.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 1143 of file MPConstraintProto.java.

◆ getVarIndex()

int com.google.ortools.linearsolver.MPConstraintProto.Builder.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 871 of file MPConstraintProto.java.

◆ getVarIndexCount()

int com.google.ortools.linearsolver.MPConstraintProto.Builder.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 856 of file MPConstraintProto.java.

◆ getVarIndexList()

java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPConstraintProto.Builder.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 841 of file MPConstraintProto.java.

◆ hasIsLazy()

boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1286 of file MPConstraintProto.java.

◆ hasLowerBound()

boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1083 of file MPConstraintProto.java.

◆ hasName()

boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.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 1178 of file MPConstraintProto.java.

◆ hasUpperBound()

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

optional double upper_bound = 3 [default = inf];

Returns
Whether the upperBound field is set.

Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.

Definition at line 1135 of file MPConstraintProto.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 591 of file MPConstraintProto.java.

◆ isInitialized()

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

Definition at line 732 of file MPConstraintProto.java.

◆ mergeFrom() [1/3]

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.mergeFrom ( com.google.ortools.linearsolver.MPConstraintProto other)

Definition at line 688 of file MPConstraintProto.java.

◆ mergeFrom() [2/3]

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

Definition at line 737 of file MPConstraintProto.java.

◆ mergeFrom() [3/3]

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.mergeFrom ( com.google.protobuf.Message other)

Definition at line 679 of file MPConstraintProto.java.

◆ setCoefficient()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setCoefficient ( int index,
double value )
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Definition at line 1014 of file MPConstraintProto.java.

◆ setIsLazy()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setIsLazy ( boolean value)
[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];

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

Definition at line 1316 of file MPConstraintProto.java.

◆ setLowerBound()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setLowerBound ( double value)
lower_bound must be <= upper_bound.

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

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

Definition at line 1107 of file MPConstraintProto.java.

◆ setName()

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

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

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

Definition at line 1233 of file MPConstraintProto.java.

◆ setNameBytes()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setNameBytes ( com.google.protobuf.ByteString value)
The name of the constraint.

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

Parameters
valueThe bytes for name to set.
Returns
This builder for chaining.

Definition at line 1264 of file MPConstraintProto.java.

◆ setUpperBound()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setUpperBound ( double value)

optional double upper_bound = 3 [default = inf];

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

Definition at line 1151 of file MPConstraintProto.java.

◆ setVarIndex()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setVarIndex ( int index,
int value )
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 to set the value at.
valueThe varIndex to set.
Returns
This builder for chaining.

Definition at line 887 of file MPConstraintProto.java.


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