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