6package com.google.ortools.linearsolver;
19@com.google.protobuf.Generated
20public final class MPQuadraticObjective
extends
21 com.google.protobuf.GeneratedMessage implements
24private static final long serialVersionUID = 0L;
26 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
27 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
32 MPQuadraticObjective.class.getName());
35 private MPQuadraticObjective(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
38 private MPQuadraticObjective() {
39 qvar1Index_ = emptyIntList();
40 qvar2Index_ = emptyIntList();
41 coefficient_ = emptyDoubleList();
44 public static final com.google.protobuf.Descriptors.Descriptor
46 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
50 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
52 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
53 .ensureFieldAccessorsInitialized(
54 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
58 @SuppressWarnings(
"serial")
59 private com.google.protobuf.Internal.IntList qvar1Index_ =
76 public java.
util.List<java.lang.Integer>
95 return qvar1Index_.size();
113 return qvar1Index_.getInt(index);
117 @SuppressWarnings(
"serial")
118 private com.google.protobuf.Internal.IntList qvar2Index_ =
125 public java.
util.List<java.lang.Integer>
134 return qvar2Index_.size();
142 return qvar2Index_.getInt(index);
146 @SuppressWarnings(
"serial")
147 private com.google.protobuf.Internal.DoubleList coefficient_ =
158 public java.
util.List<java.lang.Double>
171 return coefficient_.size();
183 return coefficient_.getDouble(index);
186 private byte memoizedIsInitialized = -1;
193 memoizedIsInitialized = 1;
198 public void writeTo(com.google.protobuf.CodedOutputStream output)
199 throws java.io.IOException {
200 for (
int i = 0; i < qvar1Index_.size(); i++) {
201 output.writeInt32(1, qvar1Index_.getInt(i));
203 for (
int i = 0; i < qvar2Index_.size(); i++) {
204 output.writeInt32(2, qvar2Index_.getInt(i));
206 for (
int i = 0; i < coefficient_.size(); i++) {
207 output.writeDouble(3, coefficient_.getDouble(i));
209 getUnknownFields().writeTo(output);
214 int size = memoizedSize;
215 if (size != -1)
return size;
220 for (
int i = 0; i < qvar1Index_.size(); i++) {
221 dataSize += com.google.protobuf.CodedOutputStream
222 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
229 for (
int i = 0; i < qvar2Index_.size(); i++) {
230 dataSize += com.google.protobuf.CodedOutputStream
231 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
242 size += getUnknownFields().getSerializedSize();
248 public boolean equals(
final java.lang.Object obj) {
252 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticObjective)) {
253 return super.equals(obj);
263 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
269 if (memoizedHashCode != 0) {
270 return memoizedHashCode;
286 hash = (29 * hash) + getUnknownFields().hashCode();
287 memoizedHashCode = hash;
292 java.nio.ByteBuffer data)
293 throws com.google.protobuf.InvalidProtocolBufferException {
294 return PARSER.parseFrom(data);
297 java.nio.ByteBuffer data,
298 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
299 throws com.google.protobuf.InvalidProtocolBufferException {
300 return PARSER.parseFrom(data, extensionRegistry);
303 com.google.protobuf.ByteString data)
304 throws com.google.protobuf.InvalidProtocolBufferException {
305 return PARSER.parseFrom(data);
308 com.google.protobuf.ByteString data,
309 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
310 throws com.google.protobuf.InvalidProtocolBufferException {
311 return PARSER.parseFrom(data, extensionRegistry);
314 throws com.google.protobuf.InvalidProtocolBufferException {
315 return PARSER.parseFrom(data);
319 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
320 throws com.google.protobuf.InvalidProtocolBufferException {
321 return PARSER.parseFrom(data, extensionRegistry);
324 throws java.io.IOException {
325 return com.google.protobuf.GeneratedMessage
326 .parseWithIOException(PARSER, input);
329 java.io.InputStream input,
330 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
331 throws java.io.IOException {
332 return com.google.protobuf.GeneratedMessage
333 .parseWithIOException(PARSER, input, extensionRegistry);
337 throws java.io.IOException {
338 return com.google.protobuf.GeneratedMessage
339 .parseDelimitedWithIOException(PARSER, input);
343 java.io.InputStream input,
344 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
345 throws java.io.IOException {
346 return com.google.protobuf.GeneratedMessage
347 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
350 com.google.protobuf.CodedInputStream input)
351 throws java.io.IOException {
352 return com.google.protobuf.GeneratedMessage
353 .parseWithIOException(PARSER, input);
356 com.google.protobuf.CodedInputStream input,
357 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
358 throws java.io.IOException {
359 return com.google.protobuf.GeneratedMessage
360 .parseWithIOException(PARSER, input, extensionRegistry);
366 return DEFAULT_INSTANCE.toBuilder();
368 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticObjective prototype) {
369 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
373 return this == DEFAULT_INSTANCE
379 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
394 public static final class Builder
extends
395 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
398 public static final com.google.protobuf.Descriptors.Descriptor
400 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
404 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
406 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
407 .ensureFieldAccessorsInitialized(
408 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
417 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
425 qvar1Index_ = emptyIntList();
426 qvar2Index_ = emptyIntList();
427 coefficient_ = emptyDoubleList();
432 public com.google.protobuf.Descriptors.Descriptor
434 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
439 return com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance();
446 throw newUninitializedMessageException(result);
454 if (bitField0_ != 0) { buildPartial0(result); }
459 private void buildPartial0(com.google.ortools.linearsolver.MPQuadraticObjective result) {
460 int from_bitField0_ = bitField0_;
461 if (((from_bitField0_ & 0x00000001) != 0)) {
462 qvar1Index_.makeImmutable();
463 result.qvar1Index_ = qvar1Index_;
465 if (((from_bitField0_ & 0x00000002) != 0)) {
466 qvar2Index_.makeImmutable();
467 result.qvar2Index_ = qvar2Index_;
469 if (((from_bitField0_ & 0x00000004) != 0)) {
470 coefficient_.makeImmutable();
471 result.coefficient_ = coefficient_;
476 public Builder
mergeFrom(com.google.protobuf.Message other) {
477 if (other instanceof com.google.ortools.linearsolver.MPQuadraticObjective) {
478 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticObjective)other);
480 super.mergeFrom(other);
485 public Builder
mergeFrom(com.google.ortools.linearsolver.MPQuadraticObjective other) {
486 if (other == com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance())
return this;
487 if (!other.qvar1Index_.isEmpty()) {
488 if (qvar1Index_.isEmpty()) {
489 qvar1Index_ = other.qvar1Index_;
490 qvar1Index_.makeImmutable();
491 bitField0_ |= 0x00000001;
493 ensureQvar1IndexIsMutable();
494 qvar1Index_.addAll(other.qvar1Index_);
498 if (!other.qvar2Index_.isEmpty()) {
499 if (qvar2Index_.isEmpty()) {
500 qvar2Index_ = other.qvar2Index_;
501 qvar2Index_.makeImmutable();
502 bitField0_ |= 0x00000002;
504 ensureQvar2IndexIsMutable();
505 qvar2Index_.addAll(other.qvar2Index_);
509 if (!other.coefficient_.isEmpty()) {
510 if (coefficient_.isEmpty()) {
511 coefficient_ = other.coefficient_;
512 coefficient_.makeImmutable();
513 bitField0_ |= 0x00000004;
515 ensureCoefficientIsMutable();
516 coefficient_.addAll(other.coefficient_);
520 this.mergeUnknownFields(other.getUnknownFields());
532 com.google.protobuf.CodedInputStream input,
533 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
534 throws java.io.IOException {
535 if (extensionRegistry ==
null) {
536 throw new java.lang.NullPointerException();
539 boolean done =
false;
541 int tag = input.readTag();
547 int v = input.readInt32();
548 ensureQvar1IndexIsMutable();
549 qvar1Index_.addInt(v);
553 int length = input.readRawVarint32();
554 int limit = input.pushLimit(length);
555 ensureQvar1IndexIsMutable();
556 while (input.getBytesUntilLimit() > 0) {
557 qvar1Index_.addInt(input.readInt32());
559 input.popLimit(limit);
563 int v = input.readInt32();
564 ensureQvar2IndexIsMutable();
565 qvar2Index_.addInt(v);
569 int length = input.readRawVarint32();
570 int limit = input.pushLimit(length);
571 ensureQvar2IndexIsMutable();
572 while (input.getBytesUntilLimit() > 0) {
573 qvar2Index_.addInt(input.readInt32());
575 input.popLimit(limit);
579 double v = input.readDouble();
580 ensureCoefficientIsMutable();
581 coefficient_.addDouble(v);
585 int length = input.readRawVarint32();
586 int limit = input.pushLimit(length);
587 int alloc = length > 4096 ? 4096 : length;
588 ensureCoefficientIsMutable(alloc / 8);
589 while (input.getBytesUntilLimit() > 0) {
590 coefficient_.addDouble(input.readDouble());
592 input.popLimit(limit);
596 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
603 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
604 throw e.unwrapIOException();
610 private int bitField0_;
612 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
613 private void ensureQvar1IndexIsMutable() {
614 if (!qvar1Index_.isModifiable()) {
615 qvar1Index_ = makeMutableCopy(qvar1Index_);
617 bitField0_ |= 0x00000001;
633 public java.util.List<java.lang.Integer>
635 qvar1Index_.makeImmutable();
653 return qvar1Index_.size();
671 return qvar1Index_.getInt(index);
690 int index,
int value) {
692 ensureQvar1IndexIsMutable();
693 qvar1Index_.setInt(index, value);
694 bitField0_ |= 0x00000001;
715 ensureQvar1IndexIsMutable();
716 qvar1Index_.addInt(value);
717 bitField0_ |= 0x00000001;
737 java.lang.Iterable<? extends java.lang.Integer> values) {
738 ensureQvar1IndexIsMutable();
739 com.google.protobuf.AbstractMessageLite.Builder.addAll(
740 values, qvar1Index_);
741 bitField0_ |= 0x00000001;
760 qvar1Index_ = emptyIntList();
761 bitField0_ = (bitField0_ & ~0x00000001);
766 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
767 private void ensureQvar2IndexIsMutable() {
768 if (!qvar2Index_.isModifiable()) {
769 qvar2Index_ = makeMutableCopy(qvar2Index_);
771 bitField0_ |= 0x00000002;
777 public java.util.List<java.lang.Integer>
779 qvar2Index_.makeImmutable();
787 return qvar2Index_.size();
795 return qvar2Index_.getInt(index);
804 int index,
int value) {
806 ensureQvar2IndexIsMutable();
807 qvar2Index_.setInt(index, value);
808 bitField0_ |= 0x00000002;
819 ensureQvar2IndexIsMutable();
820 qvar2Index_.addInt(value);
821 bitField0_ |= 0x00000002;
831 java.lang.Iterable<? extends java.lang.Integer> values) {
832 ensureQvar2IndexIsMutable();
833 com.google.protobuf.AbstractMessageLite.Builder.addAll(
834 values, qvar2Index_);
835 bitField0_ |= 0x00000002;
844 qvar2Index_ = emptyIntList();
845 bitField0_ = (bitField0_ & ~0x00000002);
850 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
851 private void ensureCoefficientIsMutable() {
852 if (!coefficient_.isModifiable()) {
853 coefficient_ = makeMutableCopy(coefficient_);
855 bitField0_ |= 0x00000004;
857 private void ensureCoefficientIsMutable(
int capacity) {
858 if (!coefficient_.isModifiable()) {
859 coefficient_ = makeMutableCopy(coefficient_, capacity);
861 bitField0_ |= 0x00000004;
871 public java.util.List<java.lang.Double>
873 coefficient_.makeImmutable();
885 return coefficient_.size();
897 return coefficient_.getDouble(index);
910 int index,
double value) {
912 ensureCoefficientIsMutable();
913 coefficient_.setDouble(index, value);
914 bitField0_ |= 0x00000004;
929 ensureCoefficientIsMutable();
930 coefficient_.addDouble(value);
931 bitField0_ |= 0x00000004;
945 java.lang.Iterable<? extends java.lang.Double> values) {
946 ensureCoefficientIsMutable();
947 com.google.protobuf.AbstractMessageLite.Builder.addAll(
948 values, coefficient_);
949 bitField0_ |= 0x00000004;
962 coefficient_ = emptyDoubleList();
963 bitField0_ = (bitField0_ & ~0x00000004);
974 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticObjective();
978 return DEFAULT_INSTANCE;
985 com.google.protobuf.CodedInputStream input,
986 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
987 throws com.google.protobuf.InvalidProtocolBufferException {
990 builder.mergeFrom(input, extensionRegistry);
991 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
992 throw e.setUnfinishedMessage(builder.buildPartial());
993 }
catch (com.google.protobuf.UninitializedMessageException e) {
994 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
995 }
catch (java.io.IOException e) {
996 throw new com.google.protobuf.InvalidProtocolBufferException(e)
997 .setUnfinishedMessage(builder.buildPartial());
999 return builder.buildPartial();
1003 public static com.google.protobuf.Parser<MPQuadraticObjective>
parser() {
1014 return DEFAULT_INSTANCE;