Google OR-Tools v9.9
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 clone ()
 
Builder setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
Builder clearField (com.google.protobuf.Descriptors.FieldDescriptor field)
 
Builder clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof)
 
Builder setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
 
Builder addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
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 ()
 
final Builder setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 
final Builder mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 

Static Public Member Functions

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

Protected Member Functions

com.google.protobuf.GeneratedMessageV3.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 578 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 1079 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 958 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 1062 of file MPConstraintProto.java.

◆ addRepeatedField()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

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

◆ build()

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

Definition at line 630 of file MPConstraintProto.java.

◆ buildPartial()

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

Definition at line 639 of file MPConstraintProto.java.

◆ clear()

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

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

◆ clearField()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearField ( com.google.protobuf.Descriptors.FieldDescriptor field)

Definition at line 687 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 1364 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 1152 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 1279 of file MPConstraintProto.java.

◆ clearOneof()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor oneof)

Definition at line 692 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 1192 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 978 of file MPConstraintProto.java.

◆ clone()

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

Definition at line 677 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 1031 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 1019 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 1007 of file MPConstraintProto.java.

◆ getDefaultInstanceForType()

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

Definition at line 625 of file MPConstraintProto.java.

◆ getDescriptor()

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

Definition at line 583 of file MPConstraintProto.java.

◆ getDescriptorForType()

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

Definition at line 620 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 1331 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 1125 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 1219 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 1242 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 1173 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 901 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 886 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 871 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 1316 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 1113 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 1208 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 1165 of file MPConstraintProto.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 589 of file MPConstraintProto.java.

◆ isInitialized()

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

Definition at line 762 of file MPConstraintProto.java.

◆ mergeFrom() [1/3]

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

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

◆ mergeFrom() [3/3]

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

Definition at line 709 of file MPConstraintProto.java.

◆ mergeUnknownFields()

final Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

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

◆ setField()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

Definition at line 681 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 1346 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 1137 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 1263 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 1294 of file MPConstraintProto.java.

◆ setRepeatedField()

Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value )

Definition at line 697 of file MPConstraintProto.java.

◆ setUnknownFields()

final Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

Definition at line 1371 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 1181 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 917 of file MPConstraintProto.java.


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