public static final class MPConstraintProto.Builder extends com.google.protobuf.GeneratedMessage.Builder<MPConstraintProto.Builder> implements MPConstraintProtoOrBuilder
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
Modifier and Type | Method and Description |
---|---|
MPConstraintProto.Builder |
addAllCoefficient(java.lang.Iterable<? extends java.lang.Double> values)
Must be finite.
|
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.
|
MPConstraintProto.Builder |
addCoefficient(double value)
Must be finite.
|
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.
|
MPConstraintProto |
build() |
MPConstraintProto |
buildPartial() |
MPConstraintProto.Builder |
clear() |
MPConstraintProto.Builder |
clearCoefficient()
Must be finite.
|
MPConstraintProto.Builder |
clearIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.]
|
MPConstraintProto.Builder |
clearLowerBound()
lower_bound must be <= upper_bound.
|
MPConstraintProto.Builder |
clearName()
The name of the constraint.
|
MPConstraintProto.Builder |
clearUpperBound()
optional double upper_bound = 3 [default = inf]; |
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.
|
double |
getCoefficient(int index)
Must be finite.
|
int |
getCoefficientCount()
Must be finite.
|
java.util.List<java.lang.Double> |
getCoefficientList()
Must be finite.
|
MPConstraintProto |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
boolean |
getIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.]
|
double |
getLowerBound()
lower_bound must be <= upper_bound.
|
java.lang.String |
getName()
The name of the constraint.
|
com.google.protobuf.ByteString |
getNameBytes()
The name of the constraint.
|
double |
getUpperBound()
optional double upper_bound = 3 [default = inf]; |
int |
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.
|
int |
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.
|
java.util.List<java.lang.Integer> |
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.
|
boolean |
hasIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.]
|
boolean |
hasLowerBound()
lower_bound must be <= upper_bound.
|
boolean |
hasName()
The name of the constraint.
|
boolean |
hasUpperBound()
optional double upper_bound = 3 [default = inf]; |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
MPConstraintProto.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
MPConstraintProto.Builder |
mergeFrom(com.google.protobuf.Message other) |
MPConstraintProto.Builder |
mergeFrom(MPConstraintProto other) |
MPConstraintProto.Builder |
setCoefficient(int index,
double value)
Must be finite.
|
MPConstraintProto.Builder |
setIsLazy(boolean value)
[Advanced usage: do not use this if you don't know what you're doing.]
|
MPConstraintProto.Builder |
setLowerBound(double value)
lower_bound must be <= upper_bound.
|
MPConstraintProto.Builder |
setName(java.lang.String value)
The name of the constraint.
|
MPConstraintProto.Builder |
setNameBytes(com.google.protobuf.ByteString value)
The name of the constraint.
|
MPConstraintProto.Builder |
setUpperBound(double value)
optional double upper_bound = 3 [default = inf]; |
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.
|
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<MPConstraintProto.Builder>
public MPConstraintProto.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<MPConstraintProto.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<MPConstraintProto.Builder>
public MPConstraintProto getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public MPConstraintProto build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public MPConstraintProto buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public MPConstraintProto.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<MPConstraintProto.Builder>
public MPConstraintProto.Builder mergeFrom(MPConstraintProto other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage.Builder<MPConstraintProto.Builder>
public MPConstraintProto.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<MPConstraintProto.Builder>
java.io.IOException
public java.util.List<java.lang.Integer> 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];
getVarIndexList
in interface MPConstraintProtoOrBuilder
public int 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];
getVarIndexCount
in interface MPConstraintProtoOrBuilder
public int 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];
getVarIndex
in interface MPConstraintProtoOrBuilder
index
- The index of the element to return.public 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.public 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.public 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.public 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];
public java.util.List<java.lang.Double> getCoefficientList()
Must be finite.
repeated double coefficient = 7 [packed = true];
getCoefficientList
in interface MPConstraintProtoOrBuilder
public int getCoefficientCount()
Must be finite.
repeated double coefficient = 7 [packed = true];
getCoefficientCount
in interface MPConstraintProtoOrBuilder
public double getCoefficient(int index)
Must be finite.
repeated double coefficient = 7 [packed = true];
getCoefficient
in interface MPConstraintProtoOrBuilder
index
- The index of the element to return.public 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.public MPConstraintProto.Builder addCoefficient(double value)
Must be finite.
repeated double coefficient = 7 [packed = true];
value
- The coefficient to add.public 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.public MPConstraintProto.Builder clearCoefficient()
Must be finite.
repeated double coefficient = 7 [packed = true];
public boolean hasLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
hasLowerBound
in interface MPConstraintProtoOrBuilder
public double getLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
getLowerBound
in interface MPConstraintProtoOrBuilder
public MPConstraintProto.Builder setLowerBound(double value)
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
value
- The lowerBound to set.public MPConstraintProto.Builder clearLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];
public boolean hasUpperBound()
optional double upper_bound = 3 [default = inf];
hasUpperBound
in interface MPConstraintProtoOrBuilder
public double getUpperBound()
optional double upper_bound = 3 [default = inf];
getUpperBound
in interface MPConstraintProtoOrBuilder
public MPConstraintProto.Builder setUpperBound(double value)
optional double upper_bound = 3 [default = inf];
value
- The upperBound to set.public MPConstraintProto.Builder clearUpperBound()
optional double upper_bound = 3 [default = inf];
public boolean hasName()
The name of the constraint.
optional string name = 4 [default = ""];
hasName
in interface MPConstraintProtoOrBuilder
public java.lang.String getName()
The name of the constraint.
optional string name = 4 [default = ""];
getName
in interface MPConstraintProtoOrBuilder
public com.google.protobuf.ByteString getNameBytes()
The name of the constraint.
optional string name = 4 [default = ""];
getNameBytes
in interface MPConstraintProtoOrBuilder
public MPConstraintProto.Builder setName(java.lang.String value)
The name of the constraint.
optional string name = 4 [default = ""];
value
- The name to set.public MPConstraintProto.Builder clearName()
The name of the constraint.
optional string name = 4 [default = ""];
public 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.public boolean 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];
hasIsLazy
in interface MPConstraintProtoOrBuilder
public boolean 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];
getIsLazy
in interface MPConstraintProtoOrBuilder
public 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.public 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];
Copyright © 2025. All rights reserved.