public static final class MPQuadraticObjective.Builder extends com.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder> implements MPQuadraticObjectiveOrBuilder
Quadratic part of a model's objective. Added with other objectives (such as linear), this creates the model's objective function to be optimized. Note: the linear part of the objective currently needs to be specified in the MPVariableProto.objective_coefficient fields. If you'd rather have a dedicated linear array here, talk to or-core-team@Protobuf type
operations_research.MPQuadraticObjective
Modifier and Type | Method and Description |
---|---|
MPQuadraticObjective.Builder |
addAllCoefficient(java.lang.Iterable<? extends java.lang.Double> values)
Must be finite.
|
MPQuadraticObjective.Builder |
addAllQvar1Index(java.lang.Iterable<? extends java.lang.Integer> values)
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
MPQuadraticObjective.Builder |
addAllQvar2Index(java.lang.Iterable<? extends java.lang.Integer> values)
repeated int32 qvar2_index = 2; |
MPQuadraticObjective.Builder |
addCoefficient(double value)
Must be finite.
|
MPQuadraticObjective.Builder |
addQvar1Index(int value)
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
MPQuadraticObjective.Builder |
addQvar2Index(int value)
repeated int32 qvar2_index = 2; |
MPQuadraticObjective |
build() |
MPQuadraticObjective |
buildPartial() |
MPQuadraticObjective.Builder |
clear() |
MPQuadraticObjective.Builder |
clearCoefficient()
Must be finite.
|
MPQuadraticObjective.Builder |
clearQvar1Index()
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
MPQuadraticObjective.Builder |
clearQvar2Index()
repeated int32 qvar2_index = 2; |
double |
getCoefficient(int index)
Must be finite.
|
int |
getCoefficientCount()
Must be finite.
|
java.util.List<java.lang.Double> |
getCoefficientList()
Must be finite.
|
MPQuadraticObjective |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
int |
getQvar1Index(int index)
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
int |
getQvar1IndexCount()
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
java.util.List<java.lang.Integer> |
getQvar1IndexList()
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
int |
getQvar2Index(int index)
repeated int32 qvar2_index = 2; |
int |
getQvar2IndexCount()
repeated int32 qvar2_index = 2; |
java.util.List<java.lang.Integer> |
getQvar2IndexList()
repeated int32 qvar2_index = 2; |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
MPQuadraticObjective.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
MPQuadraticObjective.Builder |
mergeFrom(com.google.protobuf.Message other) |
MPQuadraticObjective.Builder |
mergeFrom(MPQuadraticObjective other) |
MPQuadraticObjective.Builder |
setCoefficient(int index,
double value)
Must be finite.
|
MPQuadraticObjective.Builder |
setQvar1Index(int index,
int value)
Sparse representation of quadratic terms in the objective function, where
term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].
|
MPQuadraticObjective.Builder |
setQvar2Index(int index,
int value)
repeated int32 qvar2_index = 2; |
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<MPQuadraticObjective.Builder>
public MPQuadraticObjective.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<MPQuadraticObjective.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<MPQuadraticObjective.Builder>
public MPQuadraticObjective getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public MPQuadraticObjective build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public MPQuadraticObjective buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public MPQuadraticObjective.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<MPQuadraticObjective.Builder>
public MPQuadraticObjective.Builder mergeFrom(MPQuadraticObjective other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
public MPQuadraticObjective.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<MPQuadraticObjective.Builder>
java.io.IOException
public java.util.List<java.lang.Integer> getQvar1IndexList()
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
getQvar1IndexList
in interface MPQuadraticObjectiveOrBuilder
public int getQvar1IndexCount()
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
getQvar1IndexCount
in interface MPQuadraticObjectiveOrBuilder
public int getQvar1Index(int index)
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
getQvar1Index
in interface MPQuadraticObjectiveOrBuilder
index
- The index of the element to return.public MPQuadraticObjective.Builder setQvar1Index(int index, int value)
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
index
- The index to set the value at.value
- The qvar1Index to set.public MPQuadraticObjective.Builder addQvar1Index(int value)
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
value
- The qvar1Index to add.public MPQuadraticObjective.Builder addAllQvar1Index(java.lang.Iterable<? extends java.lang.Integer> values)
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
values
- The qvar1Index to add.public MPQuadraticObjective.Builder clearQvar1Index()
Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i]. `qvar1_index` and `qvar2_index` are variable indices w.r.t the "variable" field in MPModelProto. `qvar1_index`, `qvar2_index` and `coefficients` must have the same size. If the same unordered pair (qvar1_index, qvar2_index) appears several times, the sum of all of the associated coefficients will be applied.
repeated int32 qvar1_index = 1;
public java.util.List<java.lang.Integer> getQvar2IndexList()
repeated int32 qvar2_index = 2;
getQvar2IndexList
in interface MPQuadraticObjectiveOrBuilder
public int getQvar2IndexCount()
repeated int32 qvar2_index = 2;
getQvar2IndexCount
in interface MPQuadraticObjectiveOrBuilder
public int getQvar2Index(int index)
repeated int32 qvar2_index = 2;
getQvar2Index
in interface MPQuadraticObjectiveOrBuilder
index
- The index of the element to return.public MPQuadraticObjective.Builder setQvar2Index(int index, int value)
repeated int32 qvar2_index = 2;
index
- The index to set the value at.value
- The qvar2Index to set.public MPQuadraticObjective.Builder addQvar2Index(int value)
repeated int32 qvar2_index = 2;
value
- The qvar2Index to add.public MPQuadraticObjective.Builder addAllQvar2Index(java.lang.Iterable<? extends java.lang.Integer> values)
repeated int32 qvar2_index = 2;
values
- The qvar2Index to add.public MPQuadraticObjective.Builder clearQvar2Index()
repeated int32 qvar2_index = 2;
public java.util.List<java.lang.Double> getCoefficientList()
Must be finite.
repeated double coefficient = 3;
getCoefficientList
in interface MPQuadraticObjectiveOrBuilder
public int getCoefficientCount()
Must be finite.
repeated double coefficient = 3;
getCoefficientCount
in interface MPQuadraticObjectiveOrBuilder
public double getCoefficient(int index)
Must be finite.
repeated double coefficient = 3;
getCoefficient
in interface MPQuadraticObjectiveOrBuilder
index
- The index of the element to return.public MPQuadraticObjective.Builder setCoefficient(int index, double value)
Must be finite.
repeated double coefficient = 3;
index
- The index to set the value at.value
- The coefficient to set.public MPQuadraticObjective.Builder addCoefficient(double value)
Must be finite.
repeated double coefficient = 3;
value
- The coefficient to add.public MPQuadraticObjective.Builder addAllCoefficient(java.lang.Iterable<? extends java.lang.Double> values)
Must be finite.
repeated double coefficient = 3;
values
- The coefficient to add.public MPQuadraticObjective.Builder clearCoefficient()
Must be finite.
repeated double coefficient = 3;
Copyright © 2025. All rights reserved.