com.google.ortools.linearsolver.MPQuadraticObjective Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ortools/linear_solver/linear_solver.proto
package com.google.ortools.linearsolver;
/**
*
* 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 {@code operations_research.MPQuadraticObjective}
*/
public final class MPQuadraticObjective extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:operations_research.MPQuadraticObjective)
MPQuadraticObjectiveOrBuilder {
private static final long serialVersionUID = 0L;
// Use MPQuadraticObjective.newBuilder() to construct.
private MPQuadraticObjective(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MPQuadraticObjective() {
qvar1Index_ = emptyIntList();
qvar2Index_ = emptyIntList();
coefficient_ = emptyDoubleList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new MPQuadraticObjective();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MPQuadraticObjective(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
qvar1Index_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
qvar1Index_.addInt(input.readInt32());
break;
}
case 10: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
qvar1Index_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
qvar1Index_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
}
case 16: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
qvar2Index_ = newIntList();
mutable_bitField0_ |= 0x00000002;
}
qvar2Index_.addInt(input.readInt32());
break;
}
case 18: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
qvar2Index_ = newIntList();
mutable_bitField0_ |= 0x00000002;
}
while (input.getBytesUntilLimit() > 0) {
qvar2Index_.addInt(input.readInt32());
}
input.popLimit(limit);
break;
}
case 25: {
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
coefficient_ = newDoubleList();
mutable_bitField0_ |= 0x00000004;
}
coefficient_.addDouble(input.readDouble());
break;
}
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) {
coefficient_ = newDoubleList();
mutable_bitField0_ |= 0x00000004;
}
while (input.getBytesUntilLimit() > 0) {
coefficient_.addDouble(input.readDouble());
}
input.popLimit(limit);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
qvar1Index_.makeImmutable(); // C
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
qvar2Index_.makeImmutable(); // C
}
if (((mutable_bitField0_ & 0x00000004) != 0)) {
coefficient_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
}
public static final int QVAR1_INDEX_FIELD_NUMBER = 1;
private com.google.protobuf.Internal.IntList qvar1Index_;
/**
*
* 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;
* @return A list containing the qvar1Index.
*/
@java.lang.Override
public java.util.List
getQvar1IndexList() {
return qvar1Index_;
}
/**
*
* 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;
* @return The count of qvar1Index.
*/
public int getQvar1IndexCount() {
return qvar1Index_.size();
}
/**
*
* 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;
* @param index The index of the element to return.
* @return The qvar1Index at the given index.
*/
public int getQvar1Index(int index) {
return qvar1Index_.getInt(index);
}
public static final int QVAR2_INDEX_FIELD_NUMBER = 2;
private com.google.protobuf.Internal.IntList qvar2Index_;
/**
* repeated int32 qvar2_index = 2;
* @return A list containing the qvar2Index.
*/
@java.lang.Override
public java.util.List
getQvar2IndexList() {
return qvar2Index_;
}
/**
* repeated int32 qvar2_index = 2;
* @return The count of qvar2Index.
*/
public int getQvar2IndexCount() {
return qvar2Index_.size();
}
/**
* repeated int32 qvar2_index = 2;
* @param index The index of the element to return.
* @return The qvar2Index at the given index.
*/
public int getQvar2Index(int index) {
return qvar2Index_.getInt(index);
}
public static final int COEFFICIENT_FIELD_NUMBER = 3;
private com.google.protobuf.Internal.DoubleList coefficient_;
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @return A list containing the coefficient.
*/
@java.lang.Override
public java.util.List
getCoefficientList() {
return coefficient_;
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @return The count of coefficient.
*/
public int getCoefficientCount() {
return coefficient_.size();
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @param index The index of the element to return.
* @return The coefficient at the given index.
*/
public double getCoefficient(int index) {
return coefficient_.getDouble(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < qvar1Index_.size(); i++) {
output.writeInt32(1, qvar1Index_.getInt(i));
}
for (int i = 0; i < qvar2Index_.size(); i++) {
output.writeInt32(2, qvar2Index_.getInt(i));
}
for (int i = 0; i < coefficient_.size(); i++) {
output.writeDouble(3, coefficient_.getDouble(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < qvar1Index_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(qvar1Index_.getInt(i));
}
size += dataSize;
size += 1 * getQvar1IndexList().size();
}
{
int dataSize = 0;
for (int i = 0; i < qvar2Index_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(qvar2Index_.getInt(i));
}
size += dataSize;
size += 1 * getQvar2IndexList().size();
}
{
int dataSize = 0;
dataSize = 8 * getCoefficientList().size();
size += dataSize;
size += 1 * getCoefficientList().size();
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticObjective)) {
return super.equals(obj);
}
com.google.ortools.linearsolver.MPQuadraticObjective other = (com.google.ortools.linearsolver.MPQuadraticObjective) obj;
if (!getQvar1IndexList()
.equals(other.getQvar1IndexList())) return false;
if (!getQvar2IndexList()
.equals(other.getQvar2IndexList())) return false;
if (!getCoefficientList()
.equals(other.getCoefficientList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getQvar1IndexCount() > 0) {
hash = (37 * hash) + QVAR1_INDEX_FIELD_NUMBER;
hash = (53 * hash) + getQvar1IndexList().hashCode();
}
if (getQvar2IndexCount() > 0) {
hash = (37 * hash) + QVAR2_INDEX_FIELD_NUMBER;
hash = (53 * hash) + getQvar2IndexList().hashCode();
}
if (getCoefficientCount() > 0) {
hash = (37 * hash) + COEFFICIENT_FIELD_NUMBER;
hash = (53 * hash) + getCoefficientList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPQuadraticObjective parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticObjective prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* 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 {@code operations_research.MPQuadraticObjective}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:operations_research.MPQuadraticObjective)
com.google.ortools.linearsolver.MPQuadraticObjectiveOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
}
// Construct using com.google.ortools.linearsolver.MPQuadraticObjective.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
qvar1Index_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
qvar2Index_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000002);
coefficient_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPQuadraticObjective getDefaultInstanceForType() {
return com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance();
}
@java.lang.Override
public com.google.ortools.linearsolver.MPQuadraticObjective build() {
com.google.ortools.linearsolver.MPQuadraticObjective result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPQuadraticObjective buildPartial() {
com.google.ortools.linearsolver.MPQuadraticObjective result = new com.google.ortools.linearsolver.MPQuadraticObjective(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) != 0)) {
qvar1Index_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.qvar1Index_ = qvar1Index_;
if (((bitField0_ & 0x00000002) != 0)) {
qvar2Index_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.qvar2Index_ = qvar2Index_;
if (((bitField0_ & 0x00000004) != 0)) {
coefficient_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000004);
}
result.coefficient_ = coefficient_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ortools.linearsolver.MPQuadraticObjective) {
return mergeFrom((com.google.ortools.linearsolver.MPQuadraticObjective)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ortools.linearsolver.MPQuadraticObjective other) {
if (other == com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance()) return this;
if (!other.qvar1Index_.isEmpty()) {
if (qvar1Index_.isEmpty()) {
qvar1Index_ = other.qvar1Index_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureQvar1IndexIsMutable();
qvar1Index_.addAll(other.qvar1Index_);
}
onChanged();
}
if (!other.qvar2Index_.isEmpty()) {
if (qvar2Index_.isEmpty()) {
qvar2Index_ = other.qvar2Index_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureQvar2IndexIsMutable();
qvar2Index_.addAll(other.qvar2Index_);
}
onChanged();
}
if (!other.coefficient_.isEmpty()) {
if (coefficient_.isEmpty()) {
coefficient_ = other.coefficient_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureCoefficientIsMutable();
coefficient_.addAll(other.coefficient_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ortools.linearsolver.MPQuadraticObjective parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ortools.linearsolver.MPQuadraticObjective) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
private void ensureQvar1IndexIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
qvar1Index_ = mutableCopy(qvar1Index_);
bitField0_ |= 0x00000001;
}
}
/**
*
* 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;
* @return A list containing the qvar1Index.
*/
public java.util.List
getQvar1IndexList() {
return ((bitField0_ & 0x00000001) != 0) ?
java.util.Collections.unmodifiableList(qvar1Index_) : qvar1Index_;
}
/**
*
* 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;
* @return The count of qvar1Index.
*/
public int getQvar1IndexCount() {
return qvar1Index_.size();
}
/**
*
* 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;
* @param index The index of the element to return.
* @return The qvar1Index at the given index.
*/
public int getQvar1Index(int index) {
return qvar1Index_.getInt(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;
* @param index The index to set the value at.
* @param value The qvar1Index to set.
* @return This builder for chaining.
*/
public Builder setQvar1Index(
int index, int value) {
ensureQvar1IndexIsMutable();
qvar1Index_.setInt(index, value);
onChanged();
return this;
}
/**
*
* 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;
* @param value The qvar1Index to add.
* @return This builder for chaining.
*/
public Builder addQvar1Index(int value) {
ensureQvar1IndexIsMutable();
qvar1Index_.addInt(value);
onChanged();
return this;
}
/**
*
* 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;
* @param values The qvar1Index to add.
* @return This builder for chaining.
*/
public Builder addAllQvar1Index(
java.lang.Iterable extends java.lang.Integer> values) {
ensureQvar1IndexIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, qvar1Index_);
onChanged();
return this;
}
/**
*
* 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;
* @return This builder for chaining.
*/
public Builder clearQvar1Index() {
qvar1Index_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
private void ensureQvar2IndexIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
qvar2Index_ = mutableCopy(qvar2Index_);
bitField0_ |= 0x00000002;
}
}
/**
* repeated int32 qvar2_index = 2;
* @return A list containing the qvar2Index.
*/
public java.util.List
getQvar2IndexList() {
return ((bitField0_ & 0x00000002) != 0) ?
java.util.Collections.unmodifiableList(qvar2Index_) : qvar2Index_;
}
/**
* repeated int32 qvar2_index = 2;
* @return The count of qvar2Index.
*/
public int getQvar2IndexCount() {
return qvar2Index_.size();
}
/**
* repeated int32 qvar2_index = 2;
* @param index The index of the element to return.
* @return The qvar2Index at the given index.
*/
public int getQvar2Index(int index) {
return qvar2Index_.getInt(index);
}
/**
* repeated int32 qvar2_index = 2;
* @param index The index to set the value at.
* @param value The qvar2Index to set.
* @return This builder for chaining.
*/
public Builder setQvar2Index(
int index, int value) {
ensureQvar2IndexIsMutable();
qvar2Index_.setInt(index, value);
onChanged();
return this;
}
/**
* repeated int32 qvar2_index = 2;
* @param value The qvar2Index to add.
* @return This builder for chaining.
*/
public Builder addQvar2Index(int value) {
ensureQvar2IndexIsMutable();
qvar2Index_.addInt(value);
onChanged();
return this;
}
/**
* repeated int32 qvar2_index = 2;
* @param values The qvar2Index to add.
* @return This builder for chaining.
*/
public Builder addAllQvar2Index(
java.lang.Iterable extends java.lang.Integer> values) {
ensureQvar2IndexIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, qvar2Index_);
onChanged();
return this;
}
/**
* repeated int32 qvar2_index = 2;
* @return This builder for chaining.
*/
public Builder clearQvar2Index() {
qvar2Index_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
private void ensureCoefficientIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
coefficient_ = mutableCopy(coefficient_);
bitField0_ |= 0x00000004;
}
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @return A list containing the coefficient.
*/
public java.util.List
getCoefficientList() {
return ((bitField0_ & 0x00000004) != 0) ?
java.util.Collections.unmodifiableList(coefficient_) : coefficient_;
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @return The count of coefficient.
*/
public int getCoefficientCount() {
return coefficient_.size();
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @param index The index of the element to return.
* @return The coefficient at the given index.
*/
public double getCoefficient(int index) {
return coefficient_.getDouble(index);
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @param index The index to set the value at.
* @param value The coefficient to set.
* @return This builder for chaining.
*/
public Builder setCoefficient(
int index, double value) {
ensureCoefficientIsMutable();
coefficient_.setDouble(index, value);
onChanged();
return this;
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @param value The coefficient to add.
* @return This builder for chaining.
*/
public Builder addCoefficient(double value) {
ensureCoefficientIsMutable();
coefficient_.addDouble(value);
onChanged();
return this;
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @param values The coefficient to add.
* @return This builder for chaining.
*/
public Builder addAllCoefficient(
java.lang.Iterable extends java.lang.Double> values) {
ensureCoefficientIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, coefficient_);
onChanged();
return this;
}
/**
*
* Must be finite.
*
*
* repeated double coefficient = 3;
* @return This builder for chaining.
*/
public Builder clearCoefficient() {
coefficient_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:operations_research.MPQuadraticObjective)
}
// @@protoc_insertion_point(class_scope:operations_research.MPQuadraticObjective)
private static final com.google.ortools.linearsolver.MPQuadraticObjective DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPQuadraticObjective();
}
public static com.google.ortools.linearsolver.MPQuadraticObjective getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MPQuadraticObjective parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MPQuadraticObjective(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPQuadraticObjective getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy