5package com.google.ortools.linearsolver;
19 com.google.protobuf.GeneratedMessage implements
22private static final long serialVersionUID = 0L;
24 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
25 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
37 qvar1Index_ = emptyIntList();
38 qvar2Index_ = emptyIntList();
39 coefficient_ = emptyDoubleList();
42 public static final com.google.protobuf.Descriptors.Descriptor
44 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
48 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
50 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
51 .ensureFieldAccessorsInitialized(
52 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
56 @SuppressWarnings(
"serial")
57 private com.google.protobuf.Internal.IntList qvar1Index_ =
74 public java.util.List<java.lang.Integer>
93 return qvar1Index_.size();
111 return qvar1Index_.getInt(index);
115 @SuppressWarnings(
"serial")
116 private com.google.protobuf.Internal.IntList qvar2Index_ =
123 public java.util.List<java.lang.Integer>
132 return qvar2Index_.size();
140 return qvar2Index_.getInt(index);
144 @SuppressWarnings(
"serial")
145 private com.google.protobuf.Internal.DoubleList coefficient_ =
156 public java.util.List<java.lang.Double>
169 return coefficient_.size();
181 return coefficient_.getDouble(index);
184 private byte memoizedIsInitialized = -1;
191 memoizedIsInitialized = 1;
196 public void writeTo(com.google.protobuf.CodedOutputStream output)
197 throws java.io.IOException {
198 for (
int i = 0; i < qvar1Index_.size(); i++) {
199 output.writeInt32(1, qvar1Index_.getInt(i));
201 for (
int i = 0; i < qvar2Index_.size(); i++) {
202 output.writeInt32(2, qvar2Index_.getInt(i));
204 for (
int i = 0; i < coefficient_.size(); i++) {
205 output.writeDouble(3, coefficient_.getDouble(i));
207 getUnknownFields().writeTo(output);
212 int size = memoizedSize;
213 if (size != -1)
return size;
218 for (
int i = 0; i < qvar1Index_.size(); i++) {
219 dataSize += com.google.protobuf.CodedOutputStream
220 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
227 for (
int i = 0; i < qvar2Index_.size(); i++) {
228 dataSize += com.google.protobuf.CodedOutputStream
229 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
240 size += getUnknownFields().getSerializedSize();
246 public boolean equals(
final java.lang.Object obj) {
250 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticObjective)) {
251 return super.equals(obj);
261 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
267 if (memoizedHashCode != 0) {
268 return memoizedHashCode;
284 hash = (29 * hash) + getUnknownFields().hashCode();
285 memoizedHashCode = hash;
290 java.nio.ByteBuffer data)
291 throws com.google.protobuf.InvalidProtocolBufferException {
292 return PARSER.parseFrom(data);
295 java.nio.ByteBuffer data,
296 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
297 throws com.google.protobuf.InvalidProtocolBufferException {
298 return PARSER.parseFrom(data, extensionRegistry);
301 com.google.protobuf.ByteString data)
302 throws com.google.protobuf.InvalidProtocolBufferException {
303 return PARSER.parseFrom(data);
306 com.google.protobuf.ByteString data,
307 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
308 throws com.google.protobuf.InvalidProtocolBufferException {
309 return PARSER.parseFrom(data, extensionRegistry);
312 throws com.google.protobuf.InvalidProtocolBufferException {
313 return PARSER.parseFrom(data);
317 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
318 throws com.google.protobuf.InvalidProtocolBufferException {
319 return PARSER.parseFrom(data, extensionRegistry);
322 throws java.io.IOException {
323 return com.google.protobuf.GeneratedMessage
324 .parseWithIOException(PARSER, input);
327 java.io.InputStream input,
328 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
329 throws java.io.IOException {
330 return com.google.protobuf.GeneratedMessage
331 .parseWithIOException(PARSER, input, extensionRegistry);
335 throws java.io.IOException {
336 return com.google.protobuf.GeneratedMessage
337 .parseDelimitedWithIOException(PARSER, input);
341 java.io.InputStream input,
342 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
343 throws java.io.IOException {
344 return com.google.protobuf.GeneratedMessage
345 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
348 com.google.protobuf.CodedInputStream input)
349 throws java.io.IOException {
350 return com.google.protobuf.GeneratedMessage
351 .parseWithIOException(PARSER, input);
354 com.google.protobuf.CodedInputStream input,
355 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
356 throws java.io.IOException {
357 return com.google.protobuf.GeneratedMessage
358 .parseWithIOException(PARSER, input, extensionRegistry);
366 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticObjective prototype) {
371 return this == DEFAULT_INSTANCE
377 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
393 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
396 public static final com.google.protobuf.Descriptors.Descriptor
398 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
402 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
404 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
405 .ensureFieldAccessorsInitialized(
406 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
415 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
423 qvar1Index_ = emptyIntList();
424 qvar2Index_ = emptyIntList();
425 coefficient_ = emptyDoubleList();
430 public com.google.protobuf.Descriptors.Descriptor
432 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
437 return com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance();
444 throw newUninitializedMessageException(result);
452 if (bitField0_ != 0) { buildPartial0(result); }
457 private void buildPartial0(com.google.ortools.linearsolver.MPQuadraticObjective result) {
458 int from_bitField0_ = bitField0_;
459 if (((from_bitField0_ & 0x00000001) != 0)) {
460 qvar1Index_.makeImmutable();
461 result.qvar1Index_ = qvar1Index_;
463 if (((from_bitField0_ & 0x00000002) != 0)) {
464 qvar2Index_.makeImmutable();
465 result.qvar2Index_ = qvar2Index_;
467 if (((from_bitField0_ & 0x00000004) != 0)) {
468 coefficient_.makeImmutable();
469 result.coefficient_ = coefficient_;
475 if (other instanceof com.google.ortools.linearsolver.MPQuadraticObjective) {
476 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticObjective)other);
478 super.mergeFrom(other);
484 if (other == com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance())
return this;
485 if (!other.qvar1Index_.isEmpty()) {
486 if (qvar1Index_.isEmpty()) {
487 qvar1Index_ = other.qvar1Index_;
488 qvar1Index_.makeImmutable();
489 bitField0_ |= 0x00000001;
491 ensureQvar1IndexIsMutable();
492 qvar1Index_.addAll(other.qvar1Index_);
496 if (!other.qvar2Index_.isEmpty()) {
497 if (qvar2Index_.isEmpty()) {
498 qvar2Index_ = other.qvar2Index_;
499 qvar2Index_.makeImmutable();
500 bitField0_ |= 0x00000002;
502 ensureQvar2IndexIsMutable();
503 qvar2Index_.addAll(other.qvar2Index_);
507 if (!other.coefficient_.isEmpty()) {
508 if (coefficient_.isEmpty()) {
509 coefficient_ = other.coefficient_;
510 coefficient_.makeImmutable();
511 bitField0_ |= 0x00000004;
513 ensureCoefficientIsMutable();
514 coefficient_.addAll(other.coefficient_);
518 this.mergeUnknownFields(other.getUnknownFields());
530 com.google.protobuf.CodedInputStream input,
531 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
532 throws java.io.IOException {
533 if (extensionRegistry ==
null) {
534 throw new java.lang.NullPointerException();
537 boolean done =
false;
539 int tag = input.readTag();
545 int v = input.readInt32();
546 ensureQvar1IndexIsMutable();
547 qvar1Index_.addInt(v);
551 int length = input.readRawVarint32();
552 int limit = input.pushLimit(length);
553 ensureQvar1IndexIsMutable();
554 while (input.getBytesUntilLimit() > 0) {
555 qvar1Index_.addInt(input.readInt32());
557 input.popLimit(limit);
561 int v = input.readInt32();
562 ensureQvar2IndexIsMutable();
563 qvar2Index_.addInt(v);
567 int length = input.readRawVarint32();
568 int limit = input.pushLimit(length);
569 ensureQvar2IndexIsMutable();
570 while (input.getBytesUntilLimit() > 0) {
571 qvar2Index_.addInt(input.readInt32());
573 input.popLimit(limit);
577 double v = input.readDouble();
578 ensureCoefficientIsMutable();
579 coefficient_.addDouble(v);
583 int length = input.readRawVarint32();
584 int limit = input.pushLimit(length);
585 int alloc = length > 4096 ? 4096 : length;
586 ensureCoefficientIsMutable(alloc / 8);
587 while (input.getBytesUntilLimit() > 0) {
588 coefficient_.addDouble(input.readDouble());
590 input.popLimit(limit);
594 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
601 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
602 throw e.unwrapIOException();
608 private int bitField0_;
610 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
611 private void ensureQvar1IndexIsMutable() {
612 if (!qvar1Index_.isModifiable()) {
613 qvar1Index_ = makeMutableCopy(qvar1Index_);
615 bitField0_ |= 0x00000001;
631 public java.util.List<java.lang.Integer>
633 qvar1Index_.makeImmutable();
651 return qvar1Index_.size();
669 return qvar1Index_.getInt(index);
688 int index,
int value) {
690 ensureQvar1IndexIsMutable();
691 qvar1Index_.setInt(index, value);
692 bitField0_ |= 0x00000001;
713 ensureQvar1IndexIsMutable();
714 qvar1Index_.addInt(value);
715 bitField0_ |= 0x00000001;
735 java.lang.Iterable<? extends java.lang.Integer> values) {
736 ensureQvar1IndexIsMutable();
737 com.google.protobuf.AbstractMessageLite.Builder.addAll(
738 values, qvar1Index_);
739 bitField0_ |= 0x00000001;
758 qvar1Index_ = emptyIntList();
759 bitField0_ = (bitField0_ & ~0x00000001);
764 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
765 private void ensureQvar2IndexIsMutable() {
766 if (!qvar2Index_.isModifiable()) {
767 qvar2Index_ = makeMutableCopy(qvar2Index_);
769 bitField0_ |= 0x00000002;
775 public java.util.List<java.lang.Integer>
777 qvar2Index_.makeImmutable();
785 return qvar2Index_.size();
793 return qvar2Index_.getInt(index);
802 int index,
int value) {
804 ensureQvar2IndexIsMutable();
805 qvar2Index_.setInt(index, value);
806 bitField0_ |= 0x00000002;
817 ensureQvar2IndexIsMutable();
818 qvar2Index_.addInt(value);
819 bitField0_ |= 0x00000002;
829 java.lang.Iterable<? extends java.lang.Integer> values) {
830 ensureQvar2IndexIsMutable();
831 com.google.protobuf.AbstractMessageLite.Builder.addAll(
832 values, qvar2Index_);
833 bitField0_ |= 0x00000002;
842 qvar2Index_ = emptyIntList();
843 bitField0_ = (bitField0_ & ~0x00000002);
848 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
849 private void ensureCoefficientIsMutable() {
850 if (!coefficient_.isModifiable()) {
851 coefficient_ = makeMutableCopy(coefficient_);
853 bitField0_ |= 0x00000004;
855 private void ensureCoefficientIsMutable(
int capacity) {
856 if (!coefficient_.isModifiable()) {
857 coefficient_ = makeMutableCopy(coefficient_, capacity);
859 bitField0_ |= 0x00000004;
869 public java.util.List<java.lang.Double>
871 coefficient_.makeImmutable();
883 return coefficient_.size();
895 return coefficient_.getDouble(index);
908 int index,
double value) {
910 ensureCoefficientIsMutable();
911 coefficient_.setDouble(index, value);
912 bitField0_ |= 0x00000004;
927 ensureCoefficientIsMutable();
928 coefficient_.addDouble(value);
929 bitField0_ |= 0x00000004;
943 java.lang.Iterable<? extends java.lang.Double> values) {
944 ensureCoefficientIsMutable();
945 com.google.protobuf.AbstractMessageLite.Builder.addAll(
946 values, coefficient_);
947 bitField0_ |= 0x00000004;
960 coefficient_ = emptyDoubleList();
961 bitField0_ = (bitField0_ & ~0x00000004);
972 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticObjective();
976 return DEFAULT_INSTANCE;
983 com.google.protobuf.CodedInputStream input,
984 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
985 throws com.google.protobuf.InvalidProtocolBufferException {
988 builder.mergeFrom(input, extensionRegistry);
989 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
990 throw e.setUnfinishedMessage(builder.buildPartial());
991 }
catch (com.google.protobuf.UninitializedMessageException e) {
992 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
993 }
catch (java.io.IOException e) {
994 throw new com.google.protobuf.InvalidProtocolBufferException(e)
995 .setUnfinishedMessage(builder.buildPartial());
997 return builder.buildPartial();
1012 return DEFAULT_INSTANCE;