Java Reference
Java Reference
Detailed Description
An integer variable. It will be referred to by an int32 corresponding to its index in a CpModelProto variables field. Depending on the context, a reference to a variable whose domain is in [0, 1] can also be seen as a Boolean that will be true if the variable value is 1 and false if it is 0. When used in this context, the field name will always contain the word "literal". Negative reference (advanced usage): to simplify the creation of a model and for efficiency reasons, all the "literal" or "variable" fields can also contain a negative index. A negative index i will refer to the negation of the integer variable at index -i -1 or to NOT the literal at the same index. Ex: A variable index 4 will refer to the integer variable model.variables(4) and an index of -5 will refer to the negation of the same variable. A literal index 4 will refer to the logical fact that model.variable(4) == 1 and a literal index of -5 will refer to the logical fact model.variable(4) == 0.
Protobuf type
Definition at line 27 of file IntegerVariableProto.java.
Classes | |
| class | Builder |
Public Member Functions | |
| .lang.Override final com.google.protobuf.UnknownFieldSet | getUnknownFields () |
| .lang.Override java.lang.String | getName () |
| .lang.Override com.google.protobuf.ByteString | getNameBytes () |
| .lang.Override java.util.List< java.lang.Long > | getDomainList () |
| int | getDomainCount () |
| long | getDomain (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< IntegerVariableProto > | getParserForType () |
| .lang.Override com.google.ortools.sat.IntegerVariableProto | getDefaultInstanceForType () |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.sat.IntegerVariableProto | parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.sat.IntegerVariableProto | parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException |
| static com.google.ortools.sat.IntegerVariableProto | parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static Builder | newBuilder () |
| static Builder | newBuilder (com.google.ortools.sat.IntegerVariableProto prototype) |
| static com.google.ortools.sat.IntegerVariableProto | getDefaultInstance () |
| static com.google.protobuf.Parser< IntegerVariableProto > | parser () |
Static Public Attributes | |
| static final int | NAME_FIELD_NUMBER = 1 |
| static final int | DOMAIN_FIELD_NUMBER = 2 |
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 316 of file IntegerVariableProto.java.
◆ getDefaultInstance()
|
inlinestatic |
Definition at line 941 of file IntegerVariableProto.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 966 of file IntegerVariableProto.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 122 of file IntegerVariableProto.java.
◆ getDomain()
|
inline |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}. Note that we check at validation that a variable domain is small enough so that we don't run into integer overflow in our algorithms. Because of that, you cannot just have "unbounded" variable like [0, kint64max] and should try to specify tighter domains.
repeated int64 domain = 2;
- Parameters
-
index The index of the element to return.
- Returns
- The domain at the given index.
Implements IntegerVariableProtoOrBuilder.
Definition at line 254 of file IntegerVariableProto.java.
◆ getDomainCount()
|
inline |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}. Note that we check at validation that a variable domain is small enough so that we don't run into integer overflow in our algorithms. Because of that, you cannot just have "unbounded" variable like [0, kint64max] and should try to specify tighter domains.
repeated int64 domain = 2;
- Returns
- The count of domain.
Implements IntegerVariableProtoOrBuilder.
Definition at line 229 of file IntegerVariableProto.java.
◆ getDomainList()
|
inline |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}. Note that we check at validation that a variable domain is small enough so that we don't run into integer overflow in our algorithms. Because of that, you cannot just have "unbounded" variable like [0, kint64max] and should try to specify tighter domains.
repeated int64 domain = 2;
- Returns
- A list containing the domain.
Implements IntegerVariableProtoOrBuilder.
Definition at line 205 of file IntegerVariableProto.java.
◆ getName()
|
inline |
For debug/logging only. Can be empty.
string name = 1;
- Returns
- The name.
Implements IntegerVariableProtoOrBuilder.
Definition at line 145 of file IntegerVariableProto.java.
◆ getNameBytes()
|
inline |
For debug/logging only. Can be empty.
string name = 1;
- Returns
- The bytes for name.
Implements IntegerVariableProtoOrBuilder.
Definition at line 167 of file IntegerVariableProto.java.
◆ getParserForType()
|
inline |
Definition at line 961 of file IntegerVariableProto.java.
◆ getSerializedSize()
|
inline |
Definition at line 288 of file IntegerVariableProto.java.
◆ getUnknownFields()
|
inline |
Definition at line 50 of file IntegerVariableProto.java.
◆ hashCode()
|
inline |
Definition at line 334 of file IntegerVariableProto.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 128 of file IntegerVariableProto.java.
◆ isInitialized()
|
inline |
Definition at line 261 of file IntegerVariableProto.java.
◆ newBuilder() [1/2]
|
inlinestatic |
Definition at line 423 of file IntegerVariableProto.java.
◆ newBuilder() [2/2]
|
inlinestatic |
Definition at line 426 of file IntegerVariableProto.java.
◆ newBuilderForType() [1/2]
|
inline |
Definition at line 422 of file IntegerVariableProto.java.
◆ newBuilderForType() [2/2]
|
inlineprotected |
Definition at line 436 of file IntegerVariableProto.java.
◆ newInstance()
|
inlineprotected |
Definition at line 43 of file IntegerVariableProto.java.
◆ parseDelimitedFrom() [1/2]
|
inlinestatic |
Definition at line 395 of file IntegerVariableProto.java.
◆ parseDelimitedFrom() [2/2]
|
inlinestatic |
Definition at line 400 of file IntegerVariableProto.java.
◆ parseFrom() [1/10]
|
inlinestatic |
Definition at line 373 of file IntegerVariableProto.java.
◆ parseFrom() [2/10]
|
inlinestatic |
Definition at line 377 of file IntegerVariableProto.java.
◆ parseFrom() [3/10]
|
inlinestatic |
Definition at line 362 of file IntegerVariableProto.java.
◆ parseFrom() [4/10]
|
inlinestatic |
Definition at line 367 of file IntegerVariableProto.java.
◆ parseFrom() [5/10]
|
inlinestatic |
Definition at line 407 of file IntegerVariableProto.java.
◆ parseFrom() [6/10]
|
inlinestatic |
Definition at line 413 of file IntegerVariableProto.java.
◆ parseFrom() [7/10]
|
inlinestatic |
Definition at line 383 of file IntegerVariableProto.java.
◆ parseFrom() [8/10]
|
inlinestatic |
Definition at line 388 of file IntegerVariableProto.java.
◆ parseFrom() [9/10]
|
inlinestatic |
Definition at line 351 of file IntegerVariableProto.java.
◆ parseFrom() [10/10]
|
inlinestatic |
Definition at line 356 of file IntegerVariableProto.java.
◆ parser()
|
inlinestatic |
Definition at line 956 of file IntegerVariableProto.java.
◆ toBuilder()
|
inline |
Definition at line 430 of file IntegerVariableProto.java.
◆ writeTo()
|
inline |
Definition at line 271 of file IntegerVariableProto.java.
Member Data Documentation
◆ DOMAIN_FIELD_NUMBER
|
static |
Definition at line 180 of file IntegerVariableProto.java.
◆ NAME_FIELD_NUMBER
|
static |
Definition at line 134 of file IntegerVariableProto.java.
The documentation for this class was generated from the following file: