Java Reference

Java Reference

MPConstraintProto.Builder

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

Public Member Functions

.lang.Override Builder clear ()
 
.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
.lang.Override com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType ()
 
.lang.Override com.google.ortools.linearsolver.MPConstraintProto build ()
 
.lang.Override com.google.ortools.linearsolver.MPConstraintProto buildPartial ()
 
.lang.Override Builder clone ()
 
.lang.Override Builder setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
.lang.Override Builder clearField (com.google.protobuf.Descriptors.FieldDescriptor field)
 
.lang.Override Builder clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof)
 
.lang.Override Builder setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
 
.lang.Override Builder addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
.lang.Override Builder mergeFrom (com.google.protobuf.Message other)
 
Builder mergeFrom (com.google.ortools.linearsolver.MPConstraintProto other)
 
.lang.Override final boolean isInitialized ()
 
.lang.Override 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 ()
 
.lang.Override boolean hasLowerBound ()
 
.lang.Override double getLowerBound ()
 
Builder setLowerBound (double value)
 
Builder clearLowerBound ()
 
.lang.Override boolean hasUpperBound ()
 optional double upper_bound = 3 [default = inf]; More...
 
.lang.Override double getUpperBound ()
 optional double upper_bound = 3 [default = inf]; More...
 
Builder setUpperBound (double value)
 optional double upper_bound = 3 [default = inf]; More...
 
Builder clearUpperBound ()
 optional double upper_bound = 3 [default = inf]; More...
 
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)
 
.lang.Override boolean hasIsLazy ()
 
.lang.Override boolean getIsLazy ()
 
Builder setIsLazy (boolean value)
 
Builder clearIsLazy ()
 
.lang.Override final Builder setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 
.lang.Override final Builder mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 

Static Public Member Functions

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

Protected Member Functions

.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ()
 

Member Function Documentation

◆ addAllCoefficient()

Builder addAllCoefficient ( java.lang.Iterable<? extends java.lang.Double >  values)
inline
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Definition at line 1108 of file MPConstraintProto.java.

◆ addAllVarIndex()

Builder addAllVarIndex ( java.lang.Iterable<? extends java.lang.Integer >  values)
inline
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 998 of file MPConstraintProto.java.

◆ addCoefficient()

Builder addCoefficient ( double  value)
inline
Must be finite.

repeated double coefficient = 7 [packed = true];

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

Definition at line 1093 of file MPConstraintProto.java.

◆ addRepeatedField()

.lang.Override Builder addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 815 of file MPConstraintProto.java.

◆ addVarIndex()

Builder addVarIndex ( int  value)
inline
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 980 of file MPConstraintProto.java.

◆ build()

.lang.Override com.google.ortools.linearsolver.MPConstraintProto build ( )
inline

Definition at line 744 of file MPConstraintProto.java.

◆ buildPartial()

.lang.Override com.google.ortools.linearsolver.MPConstraintProto buildPartial ( )
inline

Definition at line 753 of file MPConstraintProto.java.

◆ clear()

.lang.Override Builder clear ( )
inline

Definition at line 715 of file MPConstraintProto.java.

◆ clearCoefficient()

Builder clearCoefficient ( )
inline
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
This builder for chaining.

Definition at line 1124 of file MPConstraintProto.java.

◆ clearField()

.lang.Override Builder clearField ( com.google.protobuf.Descriptors.FieldDescriptor  field)
inline

Definition at line 799 of file MPConstraintProto.java.

◆ clearIsLazy()

Builder clearIsLazy ( )
inline
[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 1393 of file MPConstraintProto.java.

◆ clearLowerBound()

Builder clearLowerBound ( )
inline
lower_bound must be <= upper_bound.

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

Returns
This builder for chaining.

Definition at line 1179 of file MPConstraintProto.java.

◆ clearName()

Builder clearName ( )
inline
The name of the constraint.

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

Returns
This builder for chaining.

Definition at line 1307 of file MPConstraintProto.java.

◆ clearOneof()

.lang.Override Builder clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor  oneof)
inline

Definition at line 804 of file MPConstraintProto.java.

◆ clearUpperBound()

Builder clearUpperBound ( )
inline

optional double upper_bound = 3 [default = inf];

Returns
This builder for chaining.

Definition at line 1218 of file MPConstraintProto.java.

◆ clearVarIndex()

Builder clearVarIndex ( )
inline
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 1017 of file MPConstraintProto.java.

◆ clone()

.lang.Override Builder clone ( )
inline

Definition at line 789 of file MPConstraintProto.java.

◆ getCoefficient()

double getCoefficient ( int  index)
inline
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 MPConstraintProtoOrBuilder.

Definition at line 1064 of file MPConstraintProto.java.

◆ getCoefficientCount()

int getCoefficientCount ( )
inline
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
The count of coefficient.

Implements MPConstraintProtoOrBuilder.

Definition at line 1052 of file MPConstraintProto.java.

◆ getCoefficientList()

java.util.List<java.lang.Double> getCoefficientList ( )
inline
Must be finite.

repeated double coefficient = 7 [packed = true];

Returns
A list containing the coefficient.

Implements MPConstraintProtoOrBuilder.

Definition at line 1040 of file MPConstraintProto.java.

◆ getDefaultInstanceForType()

.lang.Override com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType ( )
inline

Definition at line 739 of file MPConstraintProto.java.

◆ getDescriptor()

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

Definition at line 687 of file MPConstraintProto.java.

◆ getDescriptorForType()

.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType ( )
inline

Definition at line 734 of file MPConstraintProto.java.

◆ getIsLazy()

.lang.Override boolean getIsLazy ( )
inline
[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 MPConstraintProtoOrBuilder.

Definition at line 1361 of file MPConstraintProto.java.

◆ getLowerBound()

.lang.Override double getLowerBound ( )
inline
lower_bound must be <= upper_bound.

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

Returns
The lowerBound.

Implements MPConstraintProtoOrBuilder.

Definition at line 1153 of file MPConstraintProto.java.

◆ getName()

java.lang.String getName ( )
inline
The name of the constraint.

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

Returns
The name.

Implements MPConstraintProtoOrBuilder.

Definition at line 1245 of file MPConstraintProto.java.

◆ getNameBytes()

com.google.protobuf.ByteString getNameBytes ( )
inline
The name of the constraint.

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

Returns
The bytes for name.

Implements MPConstraintProtoOrBuilder.

Definition at line 1268 of file MPConstraintProto.java.

◆ getUpperBound()

.lang.Override double getUpperBound ( )
inline

optional double upper_bound = 3 [default = inf];

Returns
The upperBound.

Implements MPConstraintProtoOrBuilder.

Definition at line 1200 of file MPConstraintProto.java.

◆ getVarIndex()

int getVarIndex ( int  index)
inline
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 MPConstraintProtoOrBuilder.

Definition at line 945 of file MPConstraintProto.java.

◆ getVarIndexCount()

int getVarIndexCount ( )
inline
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 MPConstraintProtoOrBuilder.

Definition at line 930 of file MPConstraintProto.java.

◆ getVarIndexList()

java.util.List<java.lang.Integer> getVarIndexList ( )
inline
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 MPConstraintProtoOrBuilder.

Definition at line 915 of file MPConstraintProto.java.

◆ hasIsLazy()

.lang.Override boolean hasIsLazy ( )
inline
[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 MPConstraintProtoOrBuilder.

Definition at line 1346 of file MPConstraintProto.java.

◆ hasLowerBound()

.lang.Override boolean hasLowerBound ( )
inline
lower_bound must be <= upper_bound.

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

Returns
Whether the lowerBound field is set.

Implements MPConstraintProtoOrBuilder.

Definition at line 1141 of file MPConstraintProto.java.

◆ hasName()

boolean hasName ( )
inline
The name of the constraint.

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

Returns
Whether the name field is set.

Implements MPConstraintProtoOrBuilder.

Definition at line 1234 of file MPConstraintProto.java.

◆ hasUpperBound()

.lang.Override boolean hasUpperBound ( )
inline

optional double upper_bound = 3 [default = inf];

Returns
Whether the upperBound field is set.

Implements MPConstraintProtoOrBuilder.

Definition at line 1192 of file MPConstraintProto.java.

◆ internalGetFieldAccessorTable()

.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ( )
inlineprotected

Definition at line 693 of file MPConstraintProto.java.

◆ isInitialized()

.lang.Override final boolean isInitialized ( )
inline

Definition at line 872 of file MPConstraintProto.java.

◆ mergeFrom() [1/3]

Definition at line 830 of file MPConstraintProto.java.

◆ mergeFrom() [2/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.CodedInputStream  input,
com.google.protobuf.ExtensionRegistryLite  extensionRegistry 
) throws java.io.IOException
inline

Definition at line 877 of file MPConstraintProto.java.

◆ mergeFrom() [3/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.Message  other)
inline

Definition at line 821 of file MPConstraintProto.java.

◆ mergeUnknownFields()

.lang.Override final Builder mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 1406 of file MPConstraintProto.java.

◆ setCoefficient()

Builder setCoefficient ( int  index,
double  value 
)
inline
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 1077 of file MPConstraintProto.java.

◆ setField()

.lang.Override Builder setField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 793 of file MPConstraintProto.java.

◆ setIsLazy()

Builder setIsLazy ( boolean  value)
inline
[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 1376 of file MPConstraintProto.java.

◆ setLowerBound()

Builder setLowerBound ( double  value)
inline
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 1165 of file MPConstraintProto.java.

◆ setName()

Builder setName ( java.lang.String  value)
inline
The name of the constraint.

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

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

Definition at line 1289 of file MPConstraintProto.java.

◆ setNameBytes()

Builder setNameBytes ( com.google.protobuf.ByteString  value)
inline
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 1322 of file MPConstraintProto.java.

◆ setRepeatedField()

.lang.Override Builder setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
int  index,
java.lang.Object  value 
)
inline

Definition at line 809 of file MPConstraintProto.java.

◆ setUnknownFields()

.lang.Override final Builder setUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 1400 of file MPConstraintProto.java.

◆ setUpperBound()

Builder setUpperBound ( double  value)
inline

optional double upper_bound = 3 [default = inf];

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

Definition at line 1208 of file MPConstraintProto.java.

◆ setVarIndex()

Builder setVarIndex ( int  index,
int  value 
)
inline
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 961 of file MPConstraintProto.java.


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