Java Reference
Java 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 typeoperations_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()
|
inline |
Must be finite.
repeated double coefficient = 7 [packed = true];
- Parameters
-
values The coefficient to add.
- Returns
- This builder for chaining.
Definition at line 1108 of file MPConstraintProto.java.
◆ addAllVarIndex()
|
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
-
values The varIndex to add.
- Returns
- This builder for chaining.
Definition at line 998 of file MPConstraintProto.java.
◆ addCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 7 [packed = true];
- Parameters
-
value The coefficient to add.
- Returns
- This builder for chaining.
Definition at line 1093 of file MPConstraintProto.java.
◆ addRepeatedField()
|
inline |
Definition at line 815 of file MPConstraintProto.java.
◆ addVarIndex()
|
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
-
value The varIndex to add.
- Returns
- This builder for chaining.
Definition at line 980 of file MPConstraintProto.java.
◆ build()
|
inline |
Definition at line 744 of file MPConstraintProto.java.
◆ buildPartial()
|
inline |
Definition at line 753 of file MPConstraintProto.java.
◆ clear()
|
inline |
Definition at line 715 of file MPConstraintProto.java.
◆ 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()
|
inline |
Definition at line 799 of file MPConstraintProto.java.
◆ 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()
|
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()
|
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()
|
inline |
Definition at line 804 of file MPConstraintProto.java.
◆ clearUpperBound()
|
inline |
optional double upper_bound = 3 [default = inf];
- Returns
- This builder for chaining.
Definition at line 1218 of file MPConstraintProto.java.
◆ 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()
|
inline |
Definition at line 789 of file MPConstraintProto.java.
◆ getCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 7 [packed = true];
- Parameters
-
index The index of the element to return.
- Returns
- The coefficient at the given index.
Implements MPConstraintProtoOrBuilder.
Definition at line 1064 of file MPConstraintProto.java.
◆ 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()
|
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()
|
inline |
Definition at line 739 of file MPConstraintProto.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 687 of file MPConstraintProto.java.
◆ getDescriptorForType()
|
inline |
Definition at line 734 of file MPConstraintProto.java.
◆ 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()
|
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()
|
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()
|
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()
|
inline |
optional double upper_bound = 3 [default = inf];
- Returns
- The upperBound.
Implements MPConstraintProtoOrBuilder.
Definition at line 1200 of file MPConstraintProto.java.
◆ getVarIndex()
|
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
-
index The index of the element to return.
- Returns
- The varIndex at the given index.
Implements MPConstraintProtoOrBuilder.
Definition at line 945 of file MPConstraintProto.java.
◆ 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()
|
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()
|
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()
|
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()
|
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()
|
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()
|
inlineprotected |
Definition at line 693 of file MPConstraintProto.java.
◆ isInitialized()
|
inline |
Definition at line 872 of file MPConstraintProto.java.
◆ mergeFrom() [1/3]
|
inline |
Definition at line 830 of file MPConstraintProto.java.
◆ mergeFrom() [2/3]
|
inline |
Definition at line 877 of file MPConstraintProto.java.
◆ mergeFrom() [3/3]
|
inline |
Definition at line 821 of file MPConstraintProto.java.
◆ mergeUnknownFields()
|
inline |
Definition at line 1406 of file MPConstraintProto.java.
◆ setCoefficient()
|
inline |
Must be finite.
repeated double coefficient = 7 [packed = true];
- Parameters
-
index The index to set the value at. value The coefficient to set.
- Returns
- This builder for chaining.
Definition at line 1077 of file MPConstraintProto.java.
◆ setField()
|
inline |
Definition at line 793 of file MPConstraintProto.java.
◆ setIsLazy()
|
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
-
value The isLazy to set.
- Returns
- This builder for chaining.
Definition at line 1376 of file MPConstraintProto.java.
◆ setLowerBound()
|
inline |
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
- Parameters
-
value The lowerBound to set.
- Returns
- This builder for chaining.
Definition at line 1165 of file MPConstraintProto.java.
◆ setName()
|
inline |
The name of the constraint.
optional string name = 4 [default = ""];
- Parameters
-
value The name to set.
- Returns
- This builder for chaining.
Definition at line 1289 of file MPConstraintProto.java.
◆ setNameBytes()
|
inline |
The name of the constraint.
optional string name = 4 [default = ""];
- Parameters
-
value The bytes for name to set.
- Returns
- This builder for chaining.
Definition at line 1322 of file MPConstraintProto.java.
◆ setRepeatedField()
|
inline |
Definition at line 809 of file MPConstraintProto.java.
◆ setUnknownFields()
|
inline |
Definition at line 1400 of file MPConstraintProto.java.
◆ setUpperBound()
|
inline |
optional double upper_bound = 3 [default = inf];
- Parameters
-
value The upperBound to set.
- Returns
- This builder for chaining.
Definition at line 1208 of file MPConstraintProto.java.
◆ setVarIndex()
|
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
-
index The index to set the value at. value The 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: