Java Reference
Java Reference
Detailed Description
Special Ordered Set (SOS) constraints of type 1 or 2. See https://en.wikipedia.org/wiki/Special_ordered_set As of 2019/04, only SCIP and Gurobi support this constraint type.
Protobuf type
Definition at line 15 of file MPSosConstraint.java.
Classes | |
| class | Builder |
| enum | Type |
| Protobuf enum. More... | |
Public Member Functions | |
| .lang.Override final com.google.protobuf.UnknownFieldSet | getUnknownFields () |
| .lang.Override boolean | hasType () |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; More... | |
| .lang.Override com.google.ortools.linearsolver.MPSosConstraint.Type | getType () |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; More... | |
| .lang.Override java.util.List< java.lang.Integer > | getVarIndexList () |
| int | getVarIndexCount () |
| int | getVarIndex (int index) |
| .lang.Override java.util.List< java.lang.Double > | getWeightList () |
| int | getWeightCount () |
| double | getWeight (int index) |
| .lang.Override final boolean | isInitialized () |
| .lang.Override void | writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException |
| .lang.Override int | getSerializedSize () |
| .lang.Override boolean | equals (final java.lang.Object obj) |
| .lang.Override int | hashCode () |
| .lang.Override Builder | newBuilderForType () |
| .lang.Override Builder | toBuilder () |
| .lang.Override com.google.protobuf.Parser< MPSosConstraint > | getParserForType () |
| .lang.Override com.google.ortools.linearsolver.MPSosConstraint | getDefaultInstanceForType () |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPSosConstraint | parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static Builder | newBuilder () |
| static Builder | newBuilder (com.google.ortools.linearsolver.MPSosConstraint prototype) |
| static com.google.ortools.linearsolver.MPSosConstraint | getDefaultInstance () |
| static com.google.protobuf.Parser< MPSosConstraint > | parser () |
Static Public Attributes | |
| static final int | TYPE_FIELD_NUMBER = 1 |
| static final int | VAR_INDEX_FIELD_NUMBER = 2 |
| static final int | WEIGHT_FIELD_NUMBER = 3 |
| .lang.Deprecated static final com.google.protobuf.Parser< MPSosConstraint > | PARSER |
Protected Member Functions | |
| .lang.Override java.lang.Object | newInstance (UnusedPrivateParameter unused) |
| .lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable () |
| .lang.Override Builder | newBuilderForType (com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
Member Function Documentation
◆ equals()
|
inline |
Definition at line 454 of file MPSosConstraint.java.
◆ getDefaultInstance()
|
inlinestatic |
Definition at line 1131 of file MPSosConstraint.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 1156 of file MPSosConstraint.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 141 of file MPSosConstraint.java.
◆ getParserForType()
|
inline |
Definition at line 1151 of file MPSosConstraint.java.
◆ getSerializedSize()
|
inline |
Definition at line 424 of file MPSosConstraint.java.
◆ getType()
|
inline |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
- Returns
- The type.
Implements MPSosConstraintOrBuilder.
Definition at line 283 of file MPSosConstraint.java.
◆ getUnknownFields()
|
inline |
Definition at line 39 of file MPSosConstraint.java.
◆ getVarIndex()
|
inline |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
- Parameters
-
index The index of the element to return.
- Returns
- The varIndex at the given index.
Implements MPSosConstraintOrBuilder.
Definition at line 327 of file MPSosConstraint.java.
◆ getVarIndexCount()
|
inline |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
- Returns
- The count of varIndex.
Implements MPSosConstraintOrBuilder.
Definition at line 314 of file MPSosConstraint.java.
◆ getVarIndexList()
|
inline |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
- Returns
- A list containing the varIndex.
Implements MPSosConstraintOrBuilder.
Definition at line 302 of file MPSosConstraint.java.
◆ getWeight()
|
inline |
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;
- Parameters
-
index The index of the element to return.
- Returns
- The weight at the given index.
Implements MPSosConstraintOrBuilder.
Definition at line 393 of file MPSosConstraint.java.
◆ getWeightCount()
|
inline |
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;
- Returns
- The count of weight.
Implements MPSosConstraintOrBuilder.
Definition at line 372 of file MPSosConstraint.java.
◆ getWeightList()
|
inline |
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;
- Returns
- A list containing the weight.
Implements MPSosConstraintOrBuilder.
Definition at line 352 of file MPSosConstraint.java.
◆ hashCode()
|
inline |
Definition at line 476 of file MPSosConstraint.java.
◆ hasType()
|
inline |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
- Returns
- Whether the type field is set.
Implements MPSosConstraintOrBuilder.
Definition at line 276 of file MPSosConstraint.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 147 of file MPSosConstraint.java.
◆ isInitialized()
|
inline |
Definition at line 399 of file MPSosConstraint.java.
◆ newBuilder() [1/2]
|
inlinestatic |
Definition at line 571 of file MPSosConstraint.java.
◆ newBuilder() [2/2]
|
inlinestatic |
Definition at line 574 of file MPSosConstraint.java.
◆ newBuilderForType() [1/2]
|
inline |
Definition at line 570 of file MPSosConstraint.java.
◆ newBuilderForType() [2/2]
|
inlineprotected |
Definition at line 584 of file MPSosConstraint.java.
◆ newInstance()
|
inlineprotected |
Definition at line 32 of file MPSosConstraint.java.
◆ parseDelimitedFrom() [1/2]
|
inlinestatic |
Definition at line 543 of file MPSosConstraint.java.
◆ parseDelimitedFrom() [2/2]
|
inlinestatic |
Definition at line 548 of file MPSosConstraint.java.
◆ parseFrom() [1/10]
|
inlinestatic |
Definition at line 521 of file MPSosConstraint.java.
◆ parseFrom() [2/10]
|
inlinestatic |
Definition at line 525 of file MPSosConstraint.java.
◆ parseFrom() [3/10]
|
inlinestatic |
Definition at line 510 of file MPSosConstraint.java.
◆ parseFrom() [4/10]
|
inlinestatic |
Definition at line 515 of file MPSosConstraint.java.
◆ parseFrom() [5/10]
|
inlinestatic |
Definition at line 555 of file MPSosConstraint.java.
◆ parseFrom() [6/10]
|
inlinestatic |
Definition at line 561 of file MPSosConstraint.java.
◆ parseFrom() [7/10]
|
inlinestatic |
Definition at line 531 of file MPSosConstraint.java.
◆ parseFrom() [8/10]
|
inlinestatic |
Definition at line 536 of file MPSosConstraint.java.
◆ parseFrom() [9/10]
|
inlinestatic |
Definition at line 499 of file MPSosConstraint.java.
◆ parseFrom() [10/10]
|
inlinestatic |
Definition at line 504 of file MPSosConstraint.java.
◆ parser()
|
inlinestatic |
Definition at line 1146 of file MPSosConstraint.java.
◆ toBuilder()
|
inline |
Definition at line 578 of file MPSosConstraint.java.
◆ writeTo()
|
inline |
Definition at line 409 of file MPSosConstraint.java.
Member Data Documentation
◆ PARSER
|
static |
Definition at line 1136 of file MPSosConstraint.java.
◆ TYPE_FIELD_NUMBER
|
static |
Definition at line 270 of file MPSosConstraint.java.
◆ VAR_INDEX_FIELD_NUMBER
|
static |
Definition at line 289 of file MPSosConstraint.java.
◆ WEIGHT_FIELD_NUMBER
|
static |
Definition at line 331 of file MPSosConstraint.java.
The documentation for this class was generated from the following file: