6package com.google.ortools.linearsolver;
19public final class MPQuadraticObjective
extends
20 com.google.protobuf.GeneratedMessage implements
23private static final long serialVersionUID = 0L;
25 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
26 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
31 MPQuadraticObjective.class.getName());
34 private MPQuadraticObjective(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
37 private MPQuadraticObjective() {
38 qvar1Index_ = emptyIntList();
39 qvar2Index_ = emptyIntList();
40 coefficient_ = emptyDoubleList();
43 public static final com.google.protobuf.Descriptors.Descriptor
45 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
49 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
51 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
52 .ensureFieldAccessorsInitialized(
53 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
57 @SuppressWarnings(
"serial")
58 private com.google.protobuf.Internal.IntList qvar1Index_ =
75 public java.
util.List<java.lang.Integer>
94 return qvar1Index_.size();
112 return qvar1Index_.getInt(index);
116 @SuppressWarnings(
"serial")
117 private com.google.protobuf.Internal.IntList qvar2Index_ =
124 public java.
util.List<java.lang.Integer>
133 return qvar2Index_.size();
141 return qvar2Index_.getInt(index);
145 @SuppressWarnings(
"serial")
146 private com.google.protobuf.Internal.DoubleList coefficient_ =
157 public java.
util.List<java.lang.Double>
170 return coefficient_.size();
182 return coefficient_.getDouble(index);
185 private byte memoizedIsInitialized = -1;
192 memoizedIsInitialized = 1;
197 public void writeTo(com.google.protobuf.CodedOutputStream output)
198 throws java.io.IOException {
199 for (
int i = 0; i < qvar1Index_.size(); i++) {
200 output.writeInt32(1, qvar1Index_.getInt(i));
202 for (
int i = 0; i < qvar2Index_.size(); i++) {
203 output.writeInt32(2, qvar2Index_.getInt(i));
205 for (
int i = 0; i < coefficient_.size(); i++) {
206 output.writeDouble(3, coefficient_.getDouble(i));
208 getUnknownFields().writeTo(output);
213 int size = memoizedSize;
214 if (size != -1)
return size;
219 for (
int i = 0; i < qvar1Index_.size(); i++) {
220 dataSize += com.google.protobuf.CodedOutputStream
221 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
228 for (
int i = 0; i < qvar2Index_.size(); i++) {
229 dataSize += com.google.protobuf.CodedOutputStream
230 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
241 size += getUnknownFields().getSerializedSize();
247 public boolean equals(
final java.lang.Object obj) {
251 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticObjective)) {
252 return super.equals(obj);
262 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
268 if (memoizedHashCode != 0) {
269 return memoizedHashCode;
285 hash = (29 * hash) + getUnknownFields().hashCode();
286 memoizedHashCode = hash;
291 java.nio.ByteBuffer data)
292 throws com.google.protobuf.InvalidProtocolBufferException {
293 return PARSER.parseFrom(data);
296 java.nio.ByteBuffer data,
297 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
298 throws com.google.protobuf.InvalidProtocolBufferException {
299 return PARSER.parseFrom(data, extensionRegistry);
302 com.google.protobuf.ByteString data)
303 throws com.google.protobuf.InvalidProtocolBufferException {
304 return PARSER.parseFrom(data);
307 com.google.protobuf.ByteString data,
308 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
309 throws com.google.protobuf.InvalidProtocolBufferException {
310 return PARSER.parseFrom(data, extensionRegistry);
313 throws com.google.protobuf.InvalidProtocolBufferException {
314 return PARSER.parseFrom(data);
318 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
319 throws com.google.protobuf.InvalidProtocolBufferException {
320 return PARSER.parseFrom(data, extensionRegistry);
323 throws java.io.IOException {
324 return com.google.protobuf.GeneratedMessage
325 .parseWithIOException(PARSER, input);
328 java.io.InputStream input,
329 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
330 throws java.io.IOException {
331 return com.google.protobuf.GeneratedMessage
332 .parseWithIOException(PARSER, input, extensionRegistry);
336 throws java.io.IOException {
337 return com.google.protobuf.GeneratedMessage
338 .parseDelimitedWithIOException(PARSER, input);
342 java.io.InputStream input,
343 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
344 throws java.io.IOException {
345 return com.google.protobuf.GeneratedMessage
346 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
349 com.google.protobuf.CodedInputStream input)
350 throws java.io.IOException {
351 return com.google.protobuf.GeneratedMessage
352 .parseWithIOException(PARSER, input);
355 com.google.protobuf.CodedInputStream input,
356 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
357 throws java.io.IOException {
358 return com.google.protobuf.GeneratedMessage
359 .parseWithIOException(PARSER, input, extensionRegistry);
365 return DEFAULT_INSTANCE.toBuilder();
367 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticObjective prototype) {
368 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
372 return this == DEFAULT_INSTANCE
378 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
393 public static final class Builder
extends
394 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
397 public static final com.google.protobuf.Descriptors.Descriptor
399 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
403 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
405 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_fieldAccessorTable
406 .ensureFieldAccessorsInitialized(
407 com.google.ortools.linearsolver.MPQuadraticObjective.class, com.google.ortools.linearsolver.MPQuadraticObjective.Builder.class);
416 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
424 qvar1Index_ = emptyIntList();
425 qvar2Index_ = emptyIntList();
426 coefficient_ = emptyDoubleList();
431 public com.google.protobuf.Descriptors.Descriptor
433 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticObjective_descriptor;
438 return com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance();
445 throw newUninitializedMessageException(result);
453 if (bitField0_ != 0) { buildPartial0(result); }
458 private void buildPartial0(com.google.ortools.linearsolver.MPQuadraticObjective result) {
459 int from_bitField0_ = bitField0_;
460 if (((from_bitField0_ & 0x00000001) != 0)) {
461 qvar1Index_.makeImmutable();
462 result.qvar1Index_ = qvar1Index_;
464 if (((from_bitField0_ & 0x00000002) != 0)) {
465 qvar2Index_.makeImmutable();
466 result.qvar2Index_ = qvar2Index_;
468 if (((from_bitField0_ & 0x00000004) != 0)) {
469 coefficient_.makeImmutable();
470 result.coefficient_ = coefficient_;
475 public Builder
mergeFrom(com.google.protobuf.Message other) {
476 if (other instanceof com.google.ortools.linearsolver.MPQuadraticObjective) {
477 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticObjective)other);
479 super.mergeFrom(other);
484 public Builder
mergeFrom(com.google.ortools.linearsolver.MPQuadraticObjective other) {
485 if (other == com.google.ortools.linearsolver.MPQuadraticObjective.getDefaultInstance())
return this;
486 if (!other.qvar1Index_.isEmpty()) {
487 if (qvar1Index_.isEmpty()) {
488 qvar1Index_ = other.qvar1Index_;
489 qvar1Index_.makeImmutable();
490 bitField0_ |= 0x00000001;
492 ensureQvar1IndexIsMutable();
493 qvar1Index_.addAll(other.qvar1Index_);
497 if (!other.qvar2Index_.isEmpty()) {
498 if (qvar2Index_.isEmpty()) {
499 qvar2Index_ = other.qvar2Index_;
500 qvar2Index_.makeImmutable();
501 bitField0_ |= 0x00000002;
503 ensureQvar2IndexIsMutable();
504 qvar2Index_.addAll(other.qvar2Index_);
508 if (!other.coefficient_.isEmpty()) {
509 if (coefficient_.isEmpty()) {
510 coefficient_ = other.coefficient_;
511 coefficient_.makeImmutable();
512 bitField0_ |= 0x00000004;
514 ensureCoefficientIsMutable();
515 coefficient_.addAll(other.coefficient_);
519 this.mergeUnknownFields(other.getUnknownFields());
531 com.google.protobuf.CodedInputStream input,
532 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
533 throws java.io.IOException {
534 if (extensionRegistry ==
null) {
535 throw new java.lang.NullPointerException();
538 boolean done =
false;
540 int tag = input.readTag();
546 int v = input.readInt32();
547 ensureQvar1IndexIsMutable();
548 qvar1Index_.addInt(v);
552 int length = input.readRawVarint32();
553 int limit = input.pushLimit(length);
554 ensureQvar1IndexIsMutable();
555 while (input.getBytesUntilLimit() > 0) {
556 qvar1Index_.addInt(input.readInt32());
558 input.popLimit(limit);
562 int v = input.readInt32();
563 ensureQvar2IndexIsMutable();
564 qvar2Index_.addInt(v);
568 int length = input.readRawVarint32();
569 int limit = input.pushLimit(length);
570 ensureQvar2IndexIsMutable();
571 while (input.getBytesUntilLimit() > 0) {
572 qvar2Index_.addInt(input.readInt32());
574 input.popLimit(limit);
578 double v = input.readDouble();
579 ensureCoefficientIsMutable();
580 coefficient_.addDouble(v);
584 int length = input.readRawVarint32();
585 int limit = input.pushLimit(length);
586 int alloc = length > 4096 ? 4096 : length;
587 ensureCoefficientIsMutable(alloc / 8);
588 while (input.getBytesUntilLimit() > 0) {
589 coefficient_.addDouble(input.readDouble());
591 input.popLimit(limit);
595 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
602 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
603 throw e.unwrapIOException();
609 private int bitField0_;
611 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
612 private void ensureQvar1IndexIsMutable() {
613 if (!qvar1Index_.isModifiable()) {
614 qvar1Index_ = makeMutableCopy(qvar1Index_);
616 bitField0_ |= 0x00000001;
632 public java.util.List<java.lang.Integer>
634 qvar1Index_.makeImmutable();
652 return qvar1Index_.size();
670 return qvar1Index_.getInt(index);
689 int index,
int value) {
691 ensureQvar1IndexIsMutable();
692 qvar1Index_.setInt(index, value);
693 bitField0_ |= 0x00000001;
714 ensureQvar1IndexIsMutable();
715 qvar1Index_.addInt(value);
716 bitField0_ |= 0x00000001;
736 java.lang.Iterable<? extends java.lang.Integer> values) {
737 ensureQvar1IndexIsMutable();
738 com.google.protobuf.AbstractMessageLite.Builder.addAll(
739 values, qvar1Index_);
740 bitField0_ |= 0x00000001;
759 qvar1Index_ = emptyIntList();
760 bitField0_ = (bitField0_ & ~0x00000001);
765 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
766 private void ensureQvar2IndexIsMutable() {
767 if (!qvar2Index_.isModifiable()) {
768 qvar2Index_ = makeMutableCopy(qvar2Index_);
770 bitField0_ |= 0x00000002;
776 public java.util.List<java.lang.Integer>
778 qvar2Index_.makeImmutable();
786 return qvar2Index_.size();
794 return qvar2Index_.getInt(index);
803 int index,
int value) {
805 ensureQvar2IndexIsMutable();
806 qvar2Index_.setInt(index, value);
807 bitField0_ |= 0x00000002;
818 ensureQvar2IndexIsMutable();
819 qvar2Index_.addInt(value);
820 bitField0_ |= 0x00000002;
830 java.lang.Iterable<? extends java.lang.Integer> values) {
831 ensureQvar2IndexIsMutable();
832 com.google.protobuf.AbstractMessageLite.Builder.addAll(
833 values, qvar2Index_);
834 bitField0_ |= 0x00000002;
843 qvar2Index_ = emptyIntList();
844 bitField0_ = (bitField0_ & ~0x00000002);
849 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
850 private void ensureCoefficientIsMutable() {
851 if (!coefficient_.isModifiable()) {
852 coefficient_ = makeMutableCopy(coefficient_);
854 bitField0_ |= 0x00000004;
856 private void ensureCoefficientIsMutable(
int capacity) {
857 if (!coefficient_.isModifiable()) {
858 coefficient_ = makeMutableCopy(coefficient_, capacity);
860 bitField0_ |= 0x00000004;
870 public java.util.List<java.lang.Double>
872 coefficient_.makeImmutable();
884 return coefficient_.size();
896 return coefficient_.getDouble(index);
909 int index,
double value) {
911 ensureCoefficientIsMutable();
912 coefficient_.setDouble(index, value);
913 bitField0_ |= 0x00000004;
928 ensureCoefficientIsMutable();
929 coefficient_.addDouble(value);
930 bitField0_ |= 0x00000004;
944 java.lang.Iterable<? extends java.lang.Double> values) {
945 ensureCoefficientIsMutable();
946 com.google.protobuf.AbstractMessageLite.Builder.addAll(
947 values, coefficient_);
948 bitField0_ |= 0x00000004;
961 coefficient_ = emptyDoubleList();
962 bitField0_ = (bitField0_ & ~0x00000004);
973 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticObjective();
977 return DEFAULT_INSTANCE;
984 com.google.protobuf.CodedInputStream input,
985 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
986 throws com.google.protobuf.InvalidProtocolBufferException {
989 builder.mergeFrom(input, extensionRegistry);
990 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
991 throw e.setUnfinishedMessage(builder.buildPartial());
992 }
catch (com.google.protobuf.UninitializedMessageException e) {
993 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
994 }
catch (java.io.IOException e) {
995 throw new com.google.protobuf.InvalidProtocolBufferException(e)
996 .setUnfinishedMessage(builder.buildPartial());
998 return builder.buildPartial();
1002 public static com.google.protobuf.Parser<MPQuadraticObjective>
parser() {
1013 return DEFAULT_INSTANCE;