![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
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 582 of file MPConstraintProto.java.
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 () |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
| com.google.protobuf.GeneratedMessage.FieldAccessorTable | internalGetFieldAccessorTable () |
| 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];
| values | The coefficient to add. |
Definition at line 1051 of file MPConstraintProto.java.
| 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];
| values | The varIndex to add. |
Definition at line 930 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.addCoefficient | ( | double | value | ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
| value | The coefficient to add. |
Definition at line 1034 of file MPConstraintProto.java.
| 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];
| value | The varIndex to add. |
Definition at line 910 of file MPConstraintProto.java.
| com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.Builder.build | ( | ) |
Definition at line 634 of file MPConstraintProto.java.
| com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.Builder.buildPartial | ( | ) |
Definition at line 643 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clear | ( | ) |
Definition at line 610 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearCoefficient | ( | ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
Definition at line 1068 of file MPConstraintProto.java.
| 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];
Definition at line 1336 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearLowerBound | ( | ) |
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
Definition at line 1124 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearName | ( | ) |
The name of the constraint.
optional string name = 4 [default = ""];
Definition at line 1251 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.clearUpperBound | ( | ) |
optional double upper_bound = 3 [default = inf];
Definition at line 1164 of file MPConstraintProto.java.
| 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];
Definition at line 950 of file MPConstraintProto.java.
| double com.google.ortools.linearsolver.MPConstraintProto.Builder.getCoefficient | ( | int | index | ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
| index | The index of the element to return. |
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1003 of file MPConstraintProto.java.
| int com.google.ortools.linearsolver.MPConstraintProto.Builder.getCoefficientCount | ( | ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 991 of file MPConstraintProto.java.
| java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPConstraintProto.Builder.getCoefficientList | ( | ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 979 of file MPConstraintProto.java.
| com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPConstraintProto.Builder.getDefaultInstanceForType | ( | ) |
Definition at line 629 of file MPConstraintProto.java.
|
static |
Definition at line 587 of file MPConstraintProto.java.
| com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPConstraintProto.Builder.getDescriptorForType | ( | ) |
Definition at line 624 of file MPConstraintProto.java.
| 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];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1303 of file MPConstraintProto.java.
| double com.google.ortools.linearsolver.MPConstraintProto.Builder.getLowerBound | ( | ) |
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1097 of file MPConstraintProto.java.
| java.lang.String com.google.ortools.linearsolver.MPConstraintProto.Builder.getName | ( | ) |
The name of the constraint.
optional string name = 4 [default = ""];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1191 of file MPConstraintProto.java.
| com.google.protobuf.ByteString com.google.ortools.linearsolver.MPConstraintProto.Builder.getNameBytes | ( | ) |
The name of the constraint.
optional string name = 4 [default = ""];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1214 of file MPConstraintProto.java.
| double com.google.ortools.linearsolver.MPConstraintProto.Builder.getUpperBound | ( | ) |
optional double upper_bound = 3 [default = inf];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1145 of file MPConstraintProto.java.
| 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];
| index | The index of the element to return. |
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 873 of file MPConstraintProto.java.
| 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];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 858 of file MPConstraintProto.java.
| 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];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 843 of file MPConstraintProto.java.
| 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];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1288 of file MPConstraintProto.java.
| boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.hasLowerBound | ( | ) |
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1085 of file MPConstraintProto.java.
| boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.hasName | ( | ) |
The name of the constraint.
optional string name = 4 [default = ""];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1180 of file MPConstraintProto.java.
| boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.hasUpperBound | ( | ) |
optional double upper_bound = 3 [default = inf];
Implements com.google.ortools.linearsolver.MPConstraintProtoOrBuilder.
Definition at line 1137 of file MPConstraintProto.java.
|
protected |
Definition at line 593 of file MPConstraintProto.java.
| final boolean com.google.ortools.linearsolver.MPConstraintProto.Builder.isInitialized | ( | ) |
Definition at line 734 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.mergeFrom | ( | com.google.ortools.linearsolver.MPConstraintProto | other | ) |
Definition at line 690 of file MPConstraintProto.java.
| 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 739 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.mergeFrom | ( | com.google.protobuf.Message | other | ) |
Definition at line 681 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setCoefficient | ( | int | index, |
| double | value ) |
Must be finite.
repeated double coefficient = 7 [packed = true];
| index | The index to set the value at. |
| value | The coefficient to set. |
Definition at line 1016 of file MPConstraintProto.java.
| 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];
| value | The isLazy to set. |
Definition at line 1318 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setLowerBound | ( | double | value | ) |
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
| value | The lowerBound to set. |
Definition at line 1109 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setName | ( | java.lang.String | value | ) |
The name of the constraint.
optional string name = 4 [default = ""];
| value | The name to set. |
Definition at line 1235 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setNameBytes | ( | com.google.protobuf.ByteString | value | ) |
The name of the constraint.
optional string name = 4 [default = ""];
| value | The bytes for name to set. |
Definition at line 1266 of file MPConstraintProto.java.
| Builder com.google.ortools.linearsolver.MPConstraintProto.Builder.setUpperBound | ( | double | value | ) |
optional double upper_bound = 3 [default = inf];
| value | The upperBound to set. |
Definition at line 1153 of file MPConstraintProto.java.
| 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];
| index | The index to set the value at. |
| value | The varIndex to set. |
Definition at line 889 of file MPConstraintProto.java.