public static final class LinearBooleanConstraint.Builder extends com.google.protobuf.GeneratedMessage.Builder<LinearBooleanConstraint.Builder> implements LinearBooleanConstraintOrBuilder
A linear Boolean constraint which is a bounded sum of linear terms. Each term beeing a literal times an integer coefficient. If we assume that a literal takes the value 1 if it is true and 0 otherwise, the constraint is: lower_bound <= ... + coefficients[i] * literals[i] + ... <= upper_boundProtobuf type
operations_research.sat.LinearBooleanConstraint
Modifier and Type | Method and Description |
---|---|
LinearBooleanConstraint.Builder |
addAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coefficients = 2; |
LinearBooleanConstraint.Builder |
addAllLiterals(java.lang.Iterable<? extends java.lang.Integer> values)
Linear terms involved in this constraint.
|
LinearBooleanConstraint.Builder |
addCoefficients(long value)
repeated int64 coefficients = 2; |
LinearBooleanConstraint.Builder |
addLiterals(int value)
Linear terms involved in this constraint.
|
LinearBooleanConstraint |
build() |
LinearBooleanConstraint |
buildPartial() |
LinearBooleanConstraint.Builder |
clear() |
LinearBooleanConstraint.Builder |
clearCoefficients()
repeated int64 coefficients = 2; |
LinearBooleanConstraint.Builder |
clearLiterals()
Linear terms involved in this constraint.
|
LinearBooleanConstraint.Builder |
clearLowerBound()
Optional lower (resp. upper) bound of the constraint.
|
LinearBooleanConstraint.Builder |
clearName()
The name of this constraint.
|
LinearBooleanConstraint.Builder |
clearUpperBound()
optional int64 upper_bound = 4; |
long |
getCoefficients(int index)
repeated int64 coefficients = 2; |
int |
getCoefficientsCount()
repeated int64 coefficients = 2; |
java.util.List<java.lang.Long> |
getCoefficientsList()
repeated int64 coefficients = 2; |
LinearBooleanConstraint |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
int |
getLiterals(int index)
Linear terms involved in this constraint.
|
int |
getLiteralsCount()
Linear terms involved in this constraint.
|
java.util.List<java.lang.Integer> |
getLiteralsList()
Linear terms involved in this constraint.
|
long |
getLowerBound()
Optional lower (resp. upper) bound of the constraint.
|
java.lang.String |
getName()
The name of this constraint.
|
com.google.protobuf.ByteString |
getNameBytes()
The name of this constraint.
|
long |
getUpperBound()
optional int64 upper_bound = 4; |
boolean |
hasLowerBound()
Optional lower (resp. upper) bound of the constraint.
|
boolean |
hasName()
The name of this constraint.
|
boolean |
hasUpperBound()
optional int64 upper_bound = 4; |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
LinearBooleanConstraint.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
LinearBooleanConstraint.Builder |
mergeFrom(LinearBooleanConstraint other) |
LinearBooleanConstraint.Builder |
mergeFrom(com.google.protobuf.Message other) |
LinearBooleanConstraint.Builder |
setCoefficients(int index,
long value)
repeated int64 coefficients = 2; |
LinearBooleanConstraint.Builder |
setLiterals(int index,
int value)
Linear terms involved in this constraint.
|
LinearBooleanConstraint.Builder |
setLowerBound(long value)
Optional lower (resp. upper) bound of the constraint.
|
LinearBooleanConstraint.Builder |
setName(java.lang.String value)
The name of this constraint.
|
LinearBooleanConstraint.Builder |
setNameBytes(com.google.protobuf.ByteString value)
The name of this constraint.
|
LinearBooleanConstraint.Builder |
setUpperBound(long value)
optional int64 upper_bound = 4; |
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanConstraint.Builder>
public LinearBooleanConstraint.Builder clear()
clear
in interface com.google.protobuf.Message.Builder
clear
in interface com.google.protobuf.MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanConstraint.Builder>
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.Message.Builder
getDescriptorForType
in interface com.google.protobuf.MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanConstraint.Builder>
public LinearBooleanConstraint getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public LinearBooleanConstraint build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public LinearBooleanConstraint buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public LinearBooleanConstraint.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<LinearBooleanConstraint.Builder>
public LinearBooleanConstraint.Builder mergeFrom(LinearBooleanConstraint other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage.Builder<LinearBooleanConstraint.Builder>
public LinearBooleanConstraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in interface com.google.protobuf.MessageLite.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<LinearBooleanConstraint.Builder>
java.io.IOException
public java.util.List<java.lang.Integer> getLiteralsList()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
getLiteralsList
in interface LinearBooleanConstraintOrBuilder
public int getLiteralsCount()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
getLiteralsCount
in interface LinearBooleanConstraintOrBuilder
public int getLiterals(int index)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
getLiterals
in interface LinearBooleanConstraintOrBuilder
index
- The index of the element to return.public LinearBooleanConstraint.Builder setLiterals(int index, int value)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
index
- The index to set the value at.value
- The literals to set.public LinearBooleanConstraint.Builder addLiterals(int value)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
value
- The literals to add.public LinearBooleanConstraint.Builder addAllLiterals(java.lang.Iterable<? extends java.lang.Integer> values)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
values
- The literals to add.public LinearBooleanConstraint.Builder clearLiterals()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;
public java.util.List<java.lang.Long> getCoefficientsList()
repeated int64 coefficients = 2;
getCoefficientsList
in interface LinearBooleanConstraintOrBuilder
public int getCoefficientsCount()
repeated int64 coefficients = 2;
getCoefficientsCount
in interface LinearBooleanConstraintOrBuilder
public long getCoefficients(int index)
repeated int64 coefficients = 2;
getCoefficients
in interface LinearBooleanConstraintOrBuilder
index
- The index of the element to return.public LinearBooleanConstraint.Builder setCoefficients(int index, long value)
repeated int64 coefficients = 2;
index
- The index to set the value at.value
- The coefficients to set.public LinearBooleanConstraint.Builder addCoefficients(long value)
repeated int64 coefficients = 2;
value
- The coefficients to add.public LinearBooleanConstraint.Builder addAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coefficients = 2;
values
- The coefficients to add.public LinearBooleanConstraint.Builder clearCoefficients()
repeated int64 coefficients = 2;
public boolean hasLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;
hasLowerBound
in interface LinearBooleanConstraintOrBuilder
public long getLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;
getLowerBound
in interface LinearBooleanConstraintOrBuilder
public LinearBooleanConstraint.Builder setLowerBound(long value)
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;
value
- The lowerBound to set.public LinearBooleanConstraint.Builder clearLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;
public boolean hasUpperBound()
optional int64 upper_bound = 4;
hasUpperBound
in interface LinearBooleanConstraintOrBuilder
public long getUpperBound()
optional int64 upper_bound = 4;
getUpperBound
in interface LinearBooleanConstraintOrBuilder
public LinearBooleanConstraint.Builder setUpperBound(long value)
optional int64 upper_bound = 4;
value
- The upperBound to set.public LinearBooleanConstraint.Builder clearUpperBound()
optional int64 upper_bound = 4;
public boolean hasName()
The name of this constraint.
optional string name = 5 [default = ""];
hasName
in interface LinearBooleanConstraintOrBuilder
public java.lang.String getName()
The name of this constraint.
optional string name = 5 [default = ""];
getName
in interface LinearBooleanConstraintOrBuilder
public com.google.protobuf.ByteString getNameBytes()
The name of this constraint.
optional string name = 5 [default = ""];
getNameBytes
in interface LinearBooleanConstraintOrBuilder
public LinearBooleanConstraint.Builder setName(java.lang.String value)
The name of this constraint.
optional string name = 5 [default = ""];
value
- The name to set.public LinearBooleanConstraint.Builder clearName()
The name of this constraint.
optional string name = 5 [default = ""];
public LinearBooleanConstraint.Builder setNameBytes(com.google.protobuf.ByteString value)
The name of this constraint.
optional string name = 5 [default = ""];
value
- The bytes for name to set.Copyright © 2025. All rights reserved.