Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPQuadraticConstraint.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/linear_solver/linear_solver.proto
4// Protobuf Java Version: 4.29.3
5
6package com.google.ortools.linearsolver;
7
21public final class MPQuadraticConstraint extends
22 com.google.protobuf.GeneratedMessage implements
23 // @@protoc_insertion_point(message_implements:operations_research.MPQuadraticConstraint)
25private static final long serialVersionUID = 0L;
26 static {
27 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
28 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 /* major= */ 4,
30 /* minor= */ 29,
31 /* patch= */ 3,
32 /* suffix= */ "",
33 MPQuadraticConstraint.class.getName());
34 }
35 // Use MPQuadraticConstraint.newBuilder() to construct.
36 private MPQuadraticConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
37 super(builder);
38 }
39 private MPQuadraticConstraint() {
40 varIndex_ = emptyIntList();
41 coefficient_ = emptyDoubleList();
42 qvar1Index_ = emptyIntList();
43 qvar2Index_ = emptyIntList();
44 qcoefficient_ = emptyDoubleList();
45 lowerBound_ = Double.NEGATIVE_INFINITY;
46 upperBound_ = Double.POSITIVE_INFINITY;
47 }
48
49 public static final com.google.protobuf.Descriptors.Descriptor
51 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
52 }
53
54 @java.lang.Override
55 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
57 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_fieldAccessorTable
58 .ensureFieldAccessorsInitialized(
59 com.google.ortools.linearsolver.MPQuadraticConstraint.class, com.google.ortools.linearsolver.MPQuadraticConstraint.Builder.class);
60 }
61
62 private int bitField0_;
63 public static final int VAR_INDEX_FIELD_NUMBER = 1;
64 @SuppressWarnings("serial")
65 private com.google.protobuf.Internal.IntList varIndex_ =
66 emptyIntList();
78 @java.lang.Override
79 public java.util.List<java.lang.Integer>
81 return varIndex_;
82 }
83
94 public int getVarIndexCount() {
95 return varIndex_.size();
96 }
97
109 public int getVarIndex(int index) {
110 return varIndex_.getInt(index);
111 }
112
113 public static final int COEFFICIENT_FIELD_NUMBER = 2;
114 @SuppressWarnings("serial")
115 private com.google.protobuf.Internal.DoubleList coefficient_ =
116 emptyDoubleList();
125 @java.lang.Override
126 public java.util.List<java.lang.Double>
128 return coefficient_;
129 }
130
138 public int getCoefficientCount() {
139 return coefficient_.size();
140 }
141
150 public double getCoefficient(int index) {
151 return coefficient_.getDouble(index);
152 }
153
154 public static final int QVAR1_INDEX_FIELD_NUMBER = 3;
155 @SuppressWarnings("serial")
156 private com.google.protobuf.Internal.IntList qvar1Index_ =
157 emptyIntList();
172 @java.lang.Override
173 public java.util.List<java.lang.Integer>
175 return qvar1Index_;
176 }
177
191 public int getQvar1IndexCount() {
192 return qvar1Index_.size();
193 }
194
209 public int getQvar1Index(int index) {
210 return qvar1Index_.getInt(index);
211 }
212
213 public static final int QVAR2_INDEX_FIELD_NUMBER = 4;
214 @SuppressWarnings("serial")
215 private com.google.protobuf.Internal.IntList qvar2Index_ =
216 emptyIntList();
221 @java.lang.Override
222 public java.util.List<java.lang.Integer>
224 return qvar2Index_;
225 }
226
230 public int getQvar2IndexCount() {
231 return qvar2Index_.size();
232 }
233
238 public int getQvar2Index(int index) {
239 return qvar2Index_.getInt(index);
240 }
241
242 public static final int QCOEFFICIENT_FIELD_NUMBER = 5;
243 @SuppressWarnings("serial")
244 private com.google.protobuf.Internal.DoubleList qcoefficient_ =
245 emptyDoubleList();
254 @java.lang.Override
255 public java.util.List<java.lang.Double>
257 return qcoefficient_;
258 }
259
267 public int getQcoefficientCount() {
268 return qcoefficient_.size();
269 }
270
279 public double getQcoefficient(int index) {
280 return qcoefficient_.getDouble(index);
281 }
282
283 public static final int LOWER_BOUND_FIELD_NUMBER = 6;
284 private double lowerBound_ = Double.NEGATIVE_INFINITY;
293 @java.lang.Override
294 public boolean hasLowerBound() {
295 return ((bitField0_ & 0x00000001) != 0);
296 }
297
305 @java.lang.Override
306 public double getLowerBound() {
307 return lowerBound_;
308 }
309
310 public static final int UPPER_BOUND_FIELD_NUMBER = 7;
311 private double upperBound_ = Double.POSITIVE_INFINITY;
316 @java.lang.Override
317 public boolean hasUpperBound() {
318 return ((bitField0_ & 0x00000002) != 0);
319 }
320
324 @java.lang.Override
325 public double getUpperBound() {
326 return upperBound_;
327 }
328
329 private byte memoizedIsInitialized = -1;
330 @java.lang.Override
331 public final boolean isInitialized() {
332 byte isInitialized = memoizedIsInitialized;
333 if (isInitialized == 1) return true;
334 if (isInitialized == 0) return false;
335
336 memoizedIsInitialized = 1;
337 return true;
338 }
339
340 @java.lang.Override
341 public void writeTo(com.google.protobuf.CodedOutputStream output)
342 throws java.io.IOException {
343 for (int i = 0; i < varIndex_.size(); i++) {
344 output.writeInt32(1, varIndex_.getInt(i));
345 }
346 for (int i = 0; i < coefficient_.size(); i++) {
347 output.writeDouble(2, coefficient_.getDouble(i));
348 }
349 for (int i = 0; i < qvar1Index_.size(); i++) {
350 output.writeInt32(3, qvar1Index_.getInt(i));
351 }
352 for (int i = 0; i < qvar2Index_.size(); i++) {
353 output.writeInt32(4, qvar2Index_.getInt(i));
354 }
355 for (int i = 0; i < qcoefficient_.size(); i++) {
356 output.writeDouble(5, qcoefficient_.getDouble(i));
357 }
358 if (((bitField0_ & 0x00000001) != 0)) {
359 output.writeDouble(6, lowerBound_);
360 }
361 if (((bitField0_ & 0x00000002) != 0)) {
362 output.writeDouble(7, upperBound_);
363 }
364 getUnknownFields().writeTo(output);
365 }
366
367 @java.lang.Override
368 public int getSerializedSize() {
369 int size = memoizedSize;
370 if (size != -1) return size;
371
372 size = 0;
373 {
374 int dataSize = 0;
375 for (int i = 0; i < varIndex_.size(); i++) {
376 dataSize += com.google.protobuf.CodedOutputStream
377 .computeInt32SizeNoTag(varIndex_.getInt(i));
378 }
379 size += dataSize;
380 size += 1 * getVarIndexList().size();
381 }
382 {
383 int dataSize = 0;
384 dataSize = 8 * getCoefficientList().size();
385 size += dataSize;
386 size += 1 * getCoefficientList().size();
387 }
388 {
389 int dataSize = 0;
390 for (int i = 0; i < qvar1Index_.size(); i++) {
391 dataSize += com.google.protobuf.CodedOutputStream
392 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
393 }
394 size += dataSize;
395 size += 1 * getQvar1IndexList().size();
396 }
397 {
398 int dataSize = 0;
399 for (int i = 0; i < qvar2Index_.size(); i++) {
400 dataSize += com.google.protobuf.CodedOutputStream
401 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
402 }
403 size += dataSize;
404 size += 1 * getQvar2IndexList().size();
405 }
406 {
407 int dataSize = 0;
408 dataSize = 8 * getQcoefficientList().size();
409 size += dataSize;
410 size += 1 * getQcoefficientList().size();
411 }
412 if (((bitField0_ & 0x00000001) != 0)) {
413 size += com.google.protobuf.CodedOutputStream
414 .computeDoubleSize(6, lowerBound_);
415 }
416 if (((bitField0_ & 0x00000002) != 0)) {
417 size += com.google.protobuf.CodedOutputStream
418 .computeDoubleSize(7, upperBound_);
419 }
420 size += getUnknownFields().getSerializedSize();
421 memoizedSize = size;
422 return size;
423 }
424
425 @java.lang.Override
426 public boolean equals(final java.lang.Object obj) {
427 if (obj == this) {
428 return true;
429 }
430 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticConstraint)) {
431 return super.equals(obj);
432 }
433 com.google.ortools.linearsolver.MPQuadraticConstraint other = (com.google.ortools.linearsolver.MPQuadraticConstraint) obj;
434
435 if (!getVarIndexList()
436 .equals(other.getVarIndexList())) return false;
437 if (!getCoefficientList()
438 .equals(other.getCoefficientList())) return false;
439 if (!getQvar1IndexList()
440 .equals(other.getQvar1IndexList())) return false;
441 if (!getQvar2IndexList()
442 .equals(other.getQvar2IndexList())) return false;
444 .equals(other.getQcoefficientList())) return false;
445 if (hasLowerBound() != other.hasLowerBound()) return false;
446 if (hasLowerBound()) {
447 if (java.lang.Double.doubleToLongBits(getLowerBound())
448 != java.lang.Double.doubleToLongBits(
449 other.getLowerBound())) return false;
450 }
451 if (hasUpperBound() != other.hasUpperBound()) return false;
452 if (hasUpperBound()) {
453 if (java.lang.Double.doubleToLongBits(getUpperBound())
454 != java.lang.Double.doubleToLongBits(
455 other.getUpperBound())) return false;
456 }
457 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
458 return true;
459 }
460
461 @java.lang.Override
462 public int hashCode() {
463 if (memoizedHashCode != 0) {
464 return memoizedHashCode;
465 }
466 int hash = 41;
467 hash = (19 * hash) + getDescriptor().hashCode();
468 if (getVarIndexCount() > 0) {
469 hash = (37 * hash) + VAR_INDEX_FIELD_NUMBER;
470 hash = (53 * hash) + getVarIndexList().hashCode();
471 }
472 if (getCoefficientCount() > 0) {
473 hash = (37 * hash) + COEFFICIENT_FIELD_NUMBER;
474 hash = (53 * hash) + getCoefficientList().hashCode();
475 }
476 if (getQvar1IndexCount() > 0) {
477 hash = (37 * hash) + QVAR1_INDEX_FIELD_NUMBER;
478 hash = (53 * hash) + getQvar1IndexList().hashCode();
479 }
480 if (getQvar2IndexCount() > 0) {
481 hash = (37 * hash) + QVAR2_INDEX_FIELD_NUMBER;
482 hash = (53 * hash) + getQvar2IndexList().hashCode();
483 }
484 if (getQcoefficientCount() > 0) {
485 hash = (37 * hash) + QCOEFFICIENT_FIELD_NUMBER;
486 hash = (53 * hash) + getQcoefficientList().hashCode();
487 }
488 if (hasLowerBound()) {
489 hash = (37 * hash) + LOWER_BOUND_FIELD_NUMBER;
490 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
491 java.lang.Double.doubleToLongBits(getLowerBound()));
492 }
493 if (hasUpperBound()) {
494 hash = (37 * hash) + UPPER_BOUND_FIELD_NUMBER;
495 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
496 java.lang.Double.doubleToLongBits(getUpperBound()));
497 }
498 hash = (29 * hash) + getUnknownFields().hashCode();
499 memoizedHashCode = hash;
500 return hash;
501 }
502
504 java.nio.ByteBuffer data)
505 throws com.google.protobuf.InvalidProtocolBufferException {
506 return PARSER.parseFrom(data);
507 }
509 java.nio.ByteBuffer data,
510 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
511 throws com.google.protobuf.InvalidProtocolBufferException {
512 return PARSER.parseFrom(data, extensionRegistry);
513 }
515 com.google.protobuf.ByteString data)
516 throws com.google.protobuf.InvalidProtocolBufferException {
517 return PARSER.parseFrom(data);
518 }
520 com.google.protobuf.ByteString data,
521 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
522 throws com.google.protobuf.InvalidProtocolBufferException {
523 return PARSER.parseFrom(data, extensionRegistry);
524 }
526 throws com.google.protobuf.InvalidProtocolBufferException {
527 return PARSER.parseFrom(data);
528 }
530 byte[] data,
531 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
532 throws com.google.protobuf.InvalidProtocolBufferException {
533 return PARSER.parseFrom(data, extensionRegistry);
534 }
536 throws java.io.IOException {
537 return com.google.protobuf.GeneratedMessage
538 .parseWithIOException(PARSER, input);
539 }
541 java.io.InputStream input,
542 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
543 throws java.io.IOException {
544 return com.google.protobuf.GeneratedMessage
545 .parseWithIOException(PARSER, input, extensionRegistry);
546 }
547
549 throws java.io.IOException {
550 return com.google.protobuf.GeneratedMessage
551 .parseDelimitedWithIOException(PARSER, input);
552 }
553
555 java.io.InputStream input,
556 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
557 throws java.io.IOException {
558 return com.google.protobuf.GeneratedMessage
559 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
560 }
562 com.google.protobuf.CodedInputStream input)
563 throws java.io.IOException {
564 return com.google.protobuf.GeneratedMessage
565 .parseWithIOException(PARSER, input);
566 }
568 com.google.protobuf.CodedInputStream input,
569 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
570 throws java.io.IOException {
571 return com.google.protobuf.GeneratedMessage
572 .parseWithIOException(PARSER, input, extensionRegistry);
573 }
574
575 @java.lang.Override
576 public Builder newBuilderForType() { return newBuilder(); }
577 public static Builder newBuilder() {
578 return DEFAULT_INSTANCE.toBuilder();
579 }
580 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticConstraint prototype) {
581 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
582 }
583 @java.lang.Override
585 return this == DEFAULT_INSTANCE
586 ? new Builder() : new Builder().mergeFrom(this);
587 }
588
589 @java.lang.Override
591 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
592 Builder builder = new Builder(parent);
593 return builder;
594 }
595
608 public static final class Builder extends
609 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
610 // @@protoc_insertion_point(builder_implements:operations_research.MPQuadraticConstraint)
612 public static final com.google.protobuf.Descriptors.Descriptor
614 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
615 }
616
617 @java.lang.Override
618 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
620 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_fieldAccessorTable
621 .ensureFieldAccessorsInitialized(
622 com.google.ortools.linearsolver.MPQuadraticConstraint.class, com.google.ortools.linearsolver.MPQuadraticConstraint.Builder.class);
623 }
624
625 // Construct using com.google.ortools.linearsolver.MPQuadraticConstraint.newBuilder()
626 private Builder() {
627
628 }
629
630 private Builder(
631 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
632 super(parent);
633
634 }
635 @java.lang.Override
636 public Builder clear() {
637 super.clear();
638 bitField0_ = 0;
639 varIndex_ = emptyIntList();
640 coefficient_ = emptyDoubleList();
641 qvar1Index_ = emptyIntList();
642 qvar2Index_ = emptyIntList();
643 qcoefficient_ = emptyDoubleList();
644 lowerBound_ = Double.NEGATIVE_INFINITY;
645 upperBound_ = Double.POSITIVE_INFINITY;
646 return this;
647 }
648
649 @java.lang.Override
650 public com.google.protobuf.Descriptors.Descriptor
652 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
653 }
654
655 @java.lang.Override
657 return com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance();
658 }
659
660 @java.lang.Override
663 if (!result.isInitialized()) {
664 throw newUninitializedMessageException(result);
665 }
666 return result;
667 }
668
669 @java.lang.Override
671 com.google.ortools.linearsolver.MPQuadraticConstraint result = new com.google.ortools.linearsolver.MPQuadraticConstraint(this);
672 if (bitField0_ != 0) { buildPartial0(result); }
673 onBuilt();
674 return result;
675 }
676
677 private void buildPartial0(com.google.ortools.linearsolver.MPQuadraticConstraint result) {
678 int from_bitField0_ = bitField0_;
679 if (((from_bitField0_ & 0x00000001) != 0)) {
680 varIndex_.makeImmutable();
681 result.varIndex_ = varIndex_;
682 }
683 if (((from_bitField0_ & 0x00000002) != 0)) {
684 coefficient_.makeImmutable();
685 result.coefficient_ = coefficient_;
686 }
687 if (((from_bitField0_ & 0x00000004) != 0)) {
688 qvar1Index_.makeImmutable();
689 result.qvar1Index_ = qvar1Index_;
690 }
691 if (((from_bitField0_ & 0x00000008) != 0)) {
692 qvar2Index_.makeImmutable();
693 result.qvar2Index_ = qvar2Index_;
694 }
695 if (((from_bitField0_ & 0x00000010) != 0)) {
696 qcoefficient_.makeImmutable();
697 result.qcoefficient_ = qcoefficient_;
698 }
699 int to_bitField0_ = 0;
700 if (((from_bitField0_ & 0x00000020) != 0)) {
701 result.lowerBound_ = lowerBound_;
702 to_bitField0_ |= 0x00000001;
703 }
704 if (((from_bitField0_ & 0x00000040) != 0)) {
705 result.upperBound_ = upperBound_;
706 to_bitField0_ |= 0x00000002;
707 }
708 result.bitField0_ |= to_bitField0_;
709 }
710
711 @java.lang.Override
712 public Builder mergeFrom(com.google.protobuf.Message other) {
713 if (other instanceof com.google.ortools.linearsolver.MPQuadraticConstraint) {
714 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticConstraint)other);
715 } else {
716 super.mergeFrom(other);
717 return this;
718 }
719 }
720
721 public Builder mergeFrom(com.google.ortools.linearsolver.MPQuadraticConstraint other) {
722 if (other == com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance()) return this;
723 if (!other.varIndex_.isEmpty()) {
724 if (varIndex_.isEmpty()) {
725 varIndex_ = other.varIndex_;
726 varIndex_.makeImmutable();
727 bitField0_ |= 0x00000001;
728 } else {
729 ensureVarIndexIsMutable();
730 varIndex_.addAll(other.varIndex_);
731 }
732 onChanged();
733 }
734 if (!other.coefficient_.isEmpty()) {
735 if (coefficient_.isEmpty()) {
736 coefficient_ = other.coefficient_;
737 coefficient_.makeImmutable();
738 bitField0_ |= 0x00000002;
739 } else {
740 ensureCoefficientIsMutable();
741 coefficient_.addAll(other.coefficient_);
742 }
743 onChanged();
744 }
745 if (!other.qvar1Index_.isEmpty()) {
746 if (qvar1Index_.isEmpty()) {
747 qvar1Index_ = other.qvar1Index_;
748 qvar1Index_.makeImmutable();
749 bitField0_ |= 0x00000004;
750 } else {
751 ensureQvar1IndexIsMutable();
752 qvar1Index_.addAll(other.qvar1Index_);
753 }
754 onChanged();
755 }
756 if (!other.qvar2Index_.isEmpty()) {
757 if (qvar2Index_.isEmpty()) {
758 qvar2Index_ = other.qvar2Index_;
759 qvar2Index_.makeImmutable();
760 bitField0_ |= 0x00000008;
761 } else {
762 ensureQvar2IndexIsMutable();
763 qvar2Index_.addAll(other.qvar2Index_);
764 }
765 onChanged();
766 }
767 if (!other.qcoefficient_.isEmpty()) {
768 if (qcoefficient_.isEmpty()) {
769 qcoefficient_ = other.qcoefficient_;
770 qcoefficient_.makeImmutable();
771 bitField0_ |= 0x00000010;
772 } else {
773 ensureQcoefficientIsMutable();
774 qcoefficient_.addAll(other.qcoefficient_);
775 }
776 onChanged();
777 }
778 if (other.hasLowerBound()) {
779 setLowerBound(other.getLowerBound());
780 }
781 if (other.hasUpperBound()) {
782 setUpperBound(other.getUpperBound());
783 }
784 this.mergeUnknownFields(other.getUnknownFields());
785 onChanged();
786 return this;
787 }
788
789 @java.lang.Override
790 public final boolean isInitialized() {
791 return true;
792 }
793
794 @java.lang.Override
795 public Builder mergeFrom(
796 com.google.protobuf.CodedInputStream input,
797 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
798 throws java.io.IOException {
799 if (extensionRegistry == null) {
800 throw new java.lang.NullPointerException();
801 }
802 try {
803 boolean done = false;
804 while (!done) {
805 int tag = input.readTag();
806 switch (tag) {
807 case 0:
808 done = true;
809 break;
810 case 8: {
811 int v = input.readInt32();
812 ensureVarIndexIsMutable();
813 varIndex_.addInt(v);
814 break;
815 } // case 8
816 case 10: {
817 int length = input.readRawVarint32();
818 int limit = input.pushLimit(length);
819 ensureVarIndexIsMutable();
820 while (input.getBytesUntilLimit() > 0) {
821 varIndex_.addInt(input.readInt32());
822 }
823 input.popLimit(limit);
824 break;
825 } // case 10
826 case 17: {
827 double v = input.readDouble();
828 ensureCoefficientIsMutable();
829 coefficient_.addDouble(v);
830 break;
831 } // case 17
832 case 18: {
833 int length = input.readRawVarint32();
834 int limit = input.pushLimit(length);
835 int alloc = length > 4096 ? 4096 : length;
836 ensureCoefficientIsMutable(alloc / 8);
837 while (input.getBytesUntilLimit() > 0) {
838 coefficient_.addDouble(input.readDouble());
839 }
840 input.popLimit(limit);
841 break;
842 } // case 18
843 case 24: {
844 int v = input.readInt32();
845 ensureQvar1IndexIsMutable();
846 qvar1Index_.addInt(v);
847 break;
848 } // case 24
849 case 26: {
850 int length = input.readRawVarint32();
851 int limit = input.pushLimit(length);
852 ensureQvar1IndexIsMutable();
853 while (input.getBytesUntilLimit() > 0) {
854 qvar1Index_.addInt(input.readInt32());
855 }
856 input.popLimit(limit);
857 break;
858 } // case 26
859 case 32: {
860 int v = input.readInt32();
861 ensureQvar2IndexIsMutable();
862 qvar2Index_.addInt(v);
863 break;
864 } // case 32
865 case 34: {
866 int length = input.readRawVarint32();
867 int limit = input.pushLimit(length);
868 ensureQvar2IndexIsMutable();
869 while (input.getBytesUntilLimit() > 0) {
870 qvar2Index_.addInt(input.readInt32());
871 }
872 input.popLimit(limit);
873 break;
874 } // case 34
875 case 41: {
876 double v = input.readDouble();
877 ensureQcoefficientIsMutable();
878 qcoefficient_.addDouble(v);
879 break;
880 } // case 41
881 case 42: {
882 int length = input.readRawVarint32();
883 int limit = input.pushLimit(length);
884 int alloc = length > 4096 ? 4096 : length;
885 ensureQcoefficientIsMutable(alloc / 8);
886 while (input.getBytesUntilLimit() > 0) {
887 qcoefficient_.addDouble(input.readDouble());
888 }
889 input.popLimit(limit);
890 break;
891 } // case 42
892 case 49: {
893 lowerBound_ = input.readDouble();
894 bitField0_ |= 0x00000020;
895 break;
896 } // case 49
897 case 57: {
898 upperBound_ = input.readDouble();
899 bitField0_ |= 0x00000040;
900 break;
901 } // case 57
902 default: {
903 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
904 done = true; // was an endgroup tag
905 }
906 break;
907 } // default:
908 } // switch (tag)
909 } // while (!done)
910 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
911 throw e.unwrapIOException();
912 } finally {
913 onChanged();
914 } // finally
915 return this;
916 }
917 private int bitField0_;
918
919 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
920 private void ensureVarIndexIsMutable() {
921 if (!varIndex_.isModifiable()) {
922 varIndex_ = makeMutableCopy(varIndex_);
923 }
924 bitField0_ |= 0x00000001;
925 }
937 public java.util.List<java.lang.Integer>
939 varIndex_.makeImmutable();
940 return varIndex_;
941 }
942
953 public int getVarIndexCount() {
954 return varIndex_.size();
955 }
956
968 public int getVarIndex(int index) {
969 return varIndex_.getInt(index);
970 }
971
984 public Builder setVarIndex(
985 int index, int value) {
986
987 ensureVarIndexIsMutable();
988 varIndex_.setInt(index, value);
989 bitField0_ |= 0x00000001;
990 onChanged();
991 return this;
992 }
993
1005 public Builder addVarIndex(int value) {
1006
1007 ensureVarIndexIsMutable();
1008 varIndex_.addInt(value);
1009 bitField0_ |= 0x00000001;
1010 onChanged();
1011 return this;
1012 }
1013
1025 public Builder addAllVarIndex(
1026 java.lang.Iterable<? extends java.lang.Integer> values) {
1027 ensureVarIndexIsMutable();
1028 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1029 values, varIndex_);
1030 bitField0_ |= 0x00000001;
1031 onChanged();
1032 return this;
1033 }
1034
1045 public Builder clearVarIndex() {
1046 varIndex_ = emptyIntList();
1047 bitField0_ = (bitField0_ & ~0x00000001);
1048 onChanged();
1049 return this;
1050 }
1051
1052 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
1053 private void ensureCoefficientIsMutable() {
1054 if (!coefficient_.isModifiable()) {
1055 coefficient_ = makeMutableCopy(coefficient_);
1056 }
1057 bitField0_ |= 0x00000002;
1058 }
1059 private void ensureCoefficientIsMutable(int capacity) {
1060 if (!coefficient_.isModifiable()) {
1061 coefficient_ = makeMutableCopy(coefficient_, capacity);
1062 }
1063 bitField0_ |= 0x00000002;
1064 }
1073 public java.util.List<java.lang.Double>
1075 coefficient_.makeImmutable();
1076 return coefficient_;
1077 }
1078
1086 public int getCoefficientCount() {
1087 return coefficient_.size();
1088 }
1089
1098 public double getCoefficient(int index) {
1099 return coefficient_.getDouble(index);
1100 }
1101
1111 public Builder setCoefficient(
1112 int index, double value) {
1113
1114 ensureCoefficientIsMutable();
1115 coefficient_.setDouble(index, value);
1116 bitField0_ |= 0x00000002;
1117 onChanged();
1118 return this;
1119 }
1120
1129 public Builder addCoefficient(double value) {
1130
1131 ensureCoefficientIsMutable();
1132 coefficient_.addDouble(value);
1133 bitField0_ |= 0x00000002;
1134 onChanged();
1135 return this;
1136 }
1137
1146 public Builder addAllCoefficient(
1147 java.lang.Iterable<? extends java.lang.Double> values) {
1148 ensureCoefficientIsMutable();
1149 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1150 values, coefficient_);
1151 bitField0_ |= 0x00000002;
1152 onChanged();
1153 return this;
1154 }
1155
1163 public Builder clearCoefficient() {
1164 coefficient_ = emptyDoubleList();
1165 bitField0_ = (bitField0_ & ~0x00000002);
1166 onChanged();
1167 return this;
1168 }
1169
1170 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
1171 private void ensureQvar1IndexIsMutable() {
1172 if (!qvar1Index_.isModifiable()) {
1173 qvar1Index_ = makeMutableCopy(qvar1Index_);
1174 }
1175 bitField0_ |= 0x00000004;
1176 }
1191 public java.util.List<java.lang.Integer>
1193 qvar1Index_.makeImmutable();
1194 return qvar1Index_;
1195 }
1196
1210 public int getQvar1IndexCount() {
1211 return qvar1Index_.size();
1212 }
1213
1228 public int getQvar1Index(int index) {
1229 return qvar1Index_.getInt(index);
1230 }
1231
1247 public Builder setQvar1Index(
1248 int index, int value) {
1249
1250 ensureQvar1IndexIsMutable();
1251 qvar1Index_.setInt(index, value);
1252 bitField0_ |= 0x00000004;
1253 onChanged();
1254 return this;
1255 }
1256
1271 public Builder addQvar1Index(int value) {
1272
1273 ensureQvar1IndexIsMutable();
1274 qvar1Index_.addInt(value);
1275 bitField0_ |= 0x00000004;
1276 onChanged();
1277 return this;
1278 }
1279
1294 public Builder addAllQvar1Index(
1295 java.lang.Iterable<? extends java.lang.Integer> values) {
1296 ensureQvar1IndexIsMutable();
1297 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1298 values, qvar1Index_);
1299 bitField0_ |= 0x00000004;
1300 onChanged();
1301 return this;
1302 }
1303
1317 public Builder clearQvar1Index() {
1318 qvar1Index_ = emptyIntList();
1319 bitField0_ = (bitField0_ & ~0x00000004);
1320 onChanged();
1321 return this;
1322 }
1323
1324 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
1325 private void ensureQvar2IndexIsMutable() {
1326 if (!qvar2Index_.isModifiable()) {
1327 qvar2Index_ = makeMutableCopy(qvar2Index_);
1328 }
1329 bitField0_ |= 0x00000008;
1330 }
1335 public java.util.List<java.lang.Integer>
1337 qvar2Index_.makeImmutable();
1338 return qvar2Index_;
1339 }
1340
1344 public int getQvar2IndexCount() {
1345 return qvar2Index_.size();
1346 }
1347
1352 public int getQvar2Index(int index) {
1353 return qvar2Index_.getInt(index);
1354 }
1355
1361 public Builder setQvar2Index(
1362 int index, int value) {
1363
1364 ensureQvar2IndexIsMutable();
1365 qvar2Index_.setInt(index, value);
1366 bitField0_ |= 0x00000008;
1367 onChanged();
1368 return this;
1369 }
1370
1375 public Builder addQvar2Index(int value) {
1376
1377 ensureQvar2IndexIsMutable();
1378 qvar2Index_.addInt(value);
1379 bitField0_ |= 0x00000008;
1380 onChanged();
1381 return this;
1382 }
1383
1388 public Builder addAllQvar2Index(
1389 java.lang.Iterable<? extends java.lang.Integer> values) {
1390 ensureQvar2IndexIsMutable();
1391 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1392 values, qvar2Index_);
1393 bitField0_ |= 0x00000008;
1394 onChanged();
1395 return this;
1396 }
1397
1401 public Builder clearQvar2Index() {
1402 qvar2Index_ = emptyIntList();
1403 bitField0_ = (bitField0_ & ~0x00000008);
1404 onChanged();
1405 return this;
1406 }
1407
1408 private com.google.protobuf.Internal.DoubleList qcoefficient_ = emptyDoubleList();
1409 private void ensureQcoefficientIsMutable() {
1410 if (!qcoefficient_.isModifiable()) {
1411 qcoefficient_ = makeMutableCopy(qcoefficient_);
1412 }
1413 bitField0_ |= 0x00000010;
1414 }
1415 private void ensureQcoefficientIsMutable(int capacity) {
1416 if (!qcoefficient_.isModifiable()) {
1417 qcoefficient_ = makeMutableCopy(qcoefficient_, capacity);
1418 }
1419 bitField0_ |= 0x00000010;
1420 }
1429 public java.util.List<java.lang.Double>
1431 qcoefficient_.makeImmutable();
1432 return qcoefficient_;
1433 }
1434
1443 return qcoefficient_.size();
1444 }
1445
1454 public double getQcoefficient(int index) {
1455 return qcoefficient_.getDouble(index);
1456 }
1457
1467 public Builder setQcoefficient(
1468 int index, double value) {
1469
1470 ensureQcoefficientIsMutable();
1471 qcoefficient_.setDouble(index, value);
1472 bitField0_ |= 0x00000010;
1473 onChanged();
1474 return this;
1475 }
1476
1485 public Builder addQcoefficient(double value) {
1486
1487 ensureQcoefficientIsMutable();
1488 qcoefficient_.addDouble(value);
1489 bitField0_ |= 0x00000010;
1490 onChanged();
1491 return this;
1492 }
1493
1502 public Builder addAllQcoefficient(
1503 java.lang.Iterable<? extends java.lang.Double> values) {
1504 ensureQcoefficientIsMutable();
1505 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1506 values, qcoefficient_);
1507 bitField0_ |= 0x00000010;
1508 onChanged();
1509 return this;
1510 }
1511
1519 public Builder clearQcoefficient() {
1520 qcoefficient_ = emptyDoubleList();
1521 bitField0_ = (bitField0_ & ~0x00000010);
1522 onChanged();
1523 return this;
1524 }
1525
1526 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1535 @java.lang.Override
1536 public boolean hasLowerBound() {
1537 return ((bitField0_ & 0x00000020) != 0);
1538 }
1539
1547 @java.lang.Override
1548 public double getLowerBound() {
1549 return lowerBound_;
1550 }
1551
1560 public Builder setLowerBound(double value) {
1561
1562 lowerBound_ = value;
1563 bitField0_ |= 0x00000020;
1564 onChanged();
1565 return this;
1566 }
1567
1575 public Builder clearLowerBound() {
1576 bitField0_ = (bitField0_ & ~0x00000020);
1577 lowerBound_ = Double.NEGATIVE_INFINITY;
1578 onChanged();
1579 return this;
1580 }
1581
1582 private double upperBound_ = Double.POSITIVE_INFINITY;
1587 @java.lang.Override
1588 public boolean hasUpperBound() {
1589 return ((bitField0_ & 0x00000040) != 0);
1590 }
1591
1595 @java.lang.Override
1596 public double getUpperBound() {
1597 return upperBound_;
1598 }
1599
1604 public Builder setUpperBound(double value) {
1605
1606 upperBound_ = value;
1607 bitField0_ |= 0x00000040;
1608 onChanged();
1609 return this;
1610 }
1611
1615 public Builder clearUpperBound() {
1616 bitField0_ = (bitField0_ & ~0x00000040);
1617 upperBound_ = Double.POSITIVE_INFINITY;
1618 onChanged();
1619 return this;
1620 }
1621
1622 // @@protoc_insertion_point(builder_scope:operations_research.MPQuadraticConstraint)
1623 }
1624
1625 // @@protoc_insertion_point(class_scope:operations_research.MPQuadraticConstraint)
1626 private static final com.google.ortools.linearsolver.MPQuadraticConstraint DEFAULT_INSTANCE;
1627 static {
1628 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPQuadraticConstraint();
1629 }
1630
1632 return DEFAULT_INSTANCE;
1633 }
1634
1635 private static final com.google.protobuf.Parser<MPQuadraticConstraint>
1636 PARSER = new com.google.protobuf.AbstractParser<MPQuadraticConstraint>() {
1637 @java.lang.Override
1638 public MPQuadraticConstraint parsePartialFrom(
1639 com.google.protobuf.CodedInputStream input,
1640 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1641 throws com.google.protobuf.InvalidProtocolBufferException {
1642 Builder builder = newBuilder();
1643 try {
1644 builder.mergeFrom(input, extensionRegistry);
1645 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1646 throw e.setUnfinishedMessage(builder.buildPartial());
1647 } catch (com.google.protobuf.UninitializedMessageException e) {
1648 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1649 } catch (java.io.IOException e) {
1650 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1651 .setUnfinishedMessage(builder.buildPartial());
1652 }
1653 return builder.buildPartial();
1654 }
1655 };
1656
1657 public static com.google.protobuf.Parser<MPQuadraticConstraint> parser() {
1658 return PARSER;
1659 }
1660
1661 @java.lang.Override
1662 public com.google.protobuf.Parser<MPQuadraticConstraint> getParserForType() {
1663 return PARSER;
1664 }
1665
1666 @java.lang.Override
1670
1671}
1672
com.google.ortools.linearsolver.MPQuadraticConstraint buildPartial()
Builder addAllQvar1Index(java.lang.Iterable<? extends java.lang.Integer > values)
Builder addAllQvar2Index(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder addAllCoefficient(java.lang.Iterable<? extends java.lang.Double > values)
com.google.ortools.linearsolver.MPQuadraticConstraint getDefaultInstanceForType()
Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.linearsolver.MPQuadraticConstraint build()
Builder mergeFrom(com.google.ortools.linearsolver.MPQuadraticConstraint other)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllQcoefficient(java.lang.Iterable<? extends java.lang.Double > values)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPQuadraticConstraint getDefaultInstance()
static com.google.ortools.linearsolver.MPQuadraticConstraint parseDelimitedFrom(java.io.InputStream input)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(com.google.protobuf.ByteString data)
com.google.ortools.linearsolver.MPQuadraticConstraint getDefaultInstanceForType()
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(java.io.InputStream input)
com.google.protobuf.Parser< MPQuadraticConstraint > getParserForType()
static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticConstraint prototype)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(byte[] data)
static com.google.protobuf.Parser< MPQuadraticConstraint > parser()
static com.google.ortools.linearsolver.MPQuadraticConstraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)