Class MPQuadraticObjective.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<MPQuadraticObjective.Builder>
com.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
com.google.ortools.linearsolver.MPQuadraticObjective.Builder
- All Implemented Interfaces:
MPQuadraticObjectiveOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
MPQuadraticObjective
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-
Method Summary
Modifier and TypeMethodDescriptionaddAllCoefficient(Iterable<? extends Double> values) Must be finite.addAllQvar1Index(Iterable<? extends Integer> values) Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].addAllQvar2Index(Iterable<? extends Integer> values) repeated int32 qvar2_index = 2;addCoefficient(double value) Must be finite.addQvar1Index(int value) Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].addQvar2Index(int value) repeated int32 qvar2_index = 2;build()clear()Must be finite.Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].repeated int32 qvar2_index = 2;doublegetCoefficient(int index) Must be finite.intMust be finite.Must be finite.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintgetQvar1Index(int index) Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].intSparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].Sparse representation of quadratic terms in the objective function, where term i is qvar1_index[i] * qvar2_index[i] * coefficient[i].intgetQvar2Index(int index) repeated int32 qvar2_index = 2;intrepeated int32 qvar2_index = 2;repeated int32 qvar2_index = 2;protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(MPQuadraticObjective other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setCoefficient(int index, double value) Must be finite.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].setQvar2Index(int index, int value) repeated int32 qvar2_index = 2;Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
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, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MPQuadraticObjective.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<MPQuadraticObjective.Builder>
-
mergeFrom
public MPQuadraticObjective.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MPQuadraticObjective.Builder>- Throws:
IOException
-
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;- Specified by:
getQvar1IndexListin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- A list containing the qvar1Index.
-
getQvar1IndexCount
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;- Specified by:
getQvar1IndexCountin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- The count of qvar1Index.
-
getQvar1Index
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;- Specified by:
getQvar1Indexin interfaceMPQuadraticObjectiveOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The qvar1Index at the given index.
-
setQvar1Index
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;- Parameters:
index- The index to set the value at.value- The qvar1Index to set.- Returns:
- This builder for chaining.
-
addQvar1Index
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;- Parameters:
value- The qvar1Index to add.- Returns:
- This builder for chaining.
-
addAllQvar1Index
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;- Parameters:
values- The qvar1Index to add.- Returns:
- This builder for chaining.
-
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;- Returns:
- This builder for chaining.
-
getQvar2IndexList
repeated int32 qvar2_index = 2;- Specified by:
getQvar2IndexListin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- A list containing the qvar2Index.
-
getQvar2IndexCount
public int getQvar2IndexCount()repeated int32 qvar2_index = 2;- Specified by:
getQvar2IndexCountin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- The count of qvar2Index.
-
getQvar2Index
public int getQvar2Index(int index) repeated int32 qvar2_index = 2;- Specified by:
getQvar2Indexin interfaceMPQuadraticObjectiveOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The qvar2Index at the given index.
-
setQvar2Index
repeated int32 qvar2_index = 2;- Parameters:
index- The index to set the value at.value- The qvar2Index to set.- Returns:
- This builder for chaining.
-
addQvar2Index
repeated int32 qvar2_index = 2;- Parameters:
value- The qvar2Index to add.- Returns:
- This builder for chaining.
-
addAllQvar2Index
repeated int32 qvar2_index = 2;- Parameters:
values- The qvar2Index to add.- Returns:
- This builder for chaining.
-
clearQvar2Index
repeated int32 qvar2_index = 2;- Returns:
- This builder for chaining.
-
getCoefficientList
Must be finite.
repeated double coefficient = 3;- Specified by:
getCoefficientListin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- A list containing the coefficient.
-
getCoefficientCount
public int getCoefficientCount()Must be finite.
repeated double coefficient = 3;- Specified by:
getCoefficientCountin interfaceMPQuadraticObjectiveOrBuilder- Returns:
- The count of coefficient.
-
getCoefficient
public double getCoefficient(int index) Must be finite.
repeated double coefficient = 3;- Specified by:
getCoefficientin interfaceMPQuadraticObjectiveOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The coefficient at the given index.
-
setCoefficient
Must be finite.
repeated double coefficient = 3;- Parameters:
index- The index to set the value at.value- The coefficient to set.- Returns:
- This builder for chaining.
-
addCoefficient
Must be finite.
repeated double coefficient = 3;- Parameters:
value- The coefficient to add.- Returns:
- This builder for chaining.
-
addAllCoefficient
Must be finite.
repeated double coefficient = 3;- Parameters:
values- The coefficient to add.- Returns:
- This builder for chaining.
-
clearCoefficient
Must be finite.
repeated double coefficient = 3;- Returns:
- This builder for chaining.
-