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