5package com.google.ortools.linearsolver;
21 com.google.protobuf.GeneratedMessage implements
24private static final long serialVersionUID = 0L;
26 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
27 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
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;
48 public static final com.google.protobuf.Descriptors.Descriptor
50 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
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);
61 private int bitField0_;
63 @SuppressWarnings(
"serial")
64 private com.google.protobuf.Internal.IntList varIndex_ =
78 public java.util.List<java.lang.Integer>
94 return varIndex_.size();
109 return varIndex_.getInt(index);
113 @SuppressWarnings(
"serial")
114 private com.google.protobuf.Internal.DoubleList coefficient_ =
125 public java.util.List<java.lang.Double>
138 return coefficient_.size();
150 return coefficient_.getDouble(index);
154 @SuppressWarnings(
"serial")
155 private com.google.protobuf.Internal.IntList qvar1Index_ =
172 public java.util.List<java.lang.Integer>
191 return qvar1Index_.size();
209 return qvar1Index_.getInt(index);
213 @SuppressWarnings(
"serial")
214 private com.google.protobuf.Internal.IntList qvar2Index_ =
221 public java.util.List<java.lang.Integer>
230 return qvar2Index_.size();
238 return qvar2Index_.getInt(index);
242 @SuppressWarnings(
"serial")
243 private com.google.protobuf.Internal.DoubleList qcoefficient_ =
254 public java.util.List<java.lang.Double>
256 return qcoefficient_;
267 return qcoefficient_.size();
279 return qcoefficient_.getDouble(index);
283 private double lowerBound_ = Double.NEGATIVE_INFINITY;
294 return ((bitField0_ & 0x00000001) != 0);
310 private double upperBound_ = Double.POSITIVE_INFINITY;
317 return ((bitField0_ & 0x00000002) != 0);
328 private byte memoizedIsInitialized = -1;
335 memoizedIsInitialized = 1;
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));
345 for (
int i = 0; i < coefficient_.size(); i++) {
346 output.writeDouble(2, coefficient_.getDouble(i));
348 for (
int i = 0; i < qvar1Index_.size(); i++) {
349 output.writeInt32(3, qvar1Index_.getInt(i));
351 for (
int i = 0; i < qvar2Index_.size(); i++) {
352 output.writeInt32(4, qvar2Index_.getInt(i));
354 for (
int i = 0; i < qcoefficient_.size(); i++) {
355 output.writeDouble(5, qcoefficient_.getDouble(i));
357 if (((bitField0_ & 0x00000001) != 0)) {
358 output.writeDouble(6, lowerBound_);
360 if (((bitField0_ & 0x00000002) != 0)) {
361 output.writeDouble(7, upperBound_);
363 getUnknownFields().writeTo(output);
368 int size = memoizedSize;
369 if (size != -1)
return size;
374 for (
int i = 0; i < varIndex_.size(); i++) {
375 dataSize += com.google.protobuf.CodedOutputStream
376 .computeInt32SizeNoTag(varIndex_.getInt(i));
389 for (
int i = 0; i < qvar1Index_.size(); i++) {
390 dataSize += com.google.protobuf.CodedOutputStream
391 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
398 for (
int i = 0; i < qvar2Index_.size(); i++) {
399 dataSize += com.google.protobuf.CodedOutputStream
400 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
411 if (((bitField0_ & 0x00000001) != 0)) {
412 size += com.google.protobuf.CodedOutputStream
413 .computeDoubleSize(6, lowerBound_);
415 if (((bitField0_ & 0x00000002) != 0)) {
416 size += com.google.protobuf.CodedOutputStream
417 .computeDoubleSize(7, upperBound_);
419 size += getUnknownFields().getSerializedSize();
425 public boolean equals(
final java.lang.Object obj) {
429 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticConstraint)) {
430 return super.equals(obj);
447 != java.lang.Double.doubleToLongBits(
453 != java.lang.Double.doubleToLongBits(
456 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
462 if (memoizedHashCode != 0) {
463 return memoizedHashCode;
489 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
494 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
497 hash = (29 * hash) + getUnknownFields().hashCode();
498 memoizedHashCode = hash;
503 java.nio.ByteBuffer data)
504 throws com.google.protobuf.InvalidProtocolBufferException {
505 return PARSER.parseFrom(data);
508 java.nio.ByteBuffer data,
509 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
510 throws com.google.protobuf.InvalidProtocolBufferException {
511 return PARSER.parseFrom(data, extensionRegistry);
514 com.google.protobuf.ByteString data)
515 throws com.google.protobuf.InvalidProtocolBufferException {
516 return PARSER.parseFrom(data);
519 com.google.protobuf.ByteString data,
520 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
521 throws com.google.protobuf.InvalidProtocolBufferException {
522 return PARSER.parseFrom(data, extensionRegistry);
525 throws com.google.protobuf.InvalidProtocolBufferException {
526 return PARSER.parseFrom(data);
530 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
531 throws com.google.protobuf.InvalidProtocolBufferException {
532 return PARSER.parseFrom(data, extensionRegistry);
535 throws java.io.IOException {
536 return com.google.protobuf.GeneratedMessage
537 .parseWithIOException(PARSER, input);
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);
548 throws java.io.IOException {
549 return com.google.protobuf.GeneratedMessage
550 .parseDelimitedWithIOException(PARSER, input);
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);
561 com.google.protobuf.CodedInputStream input)
562 throws java.io.IOException {
563 return com.google.protobuf.GeneratedMessage
564 .parseWithIOException(PARSER, input);
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);
579 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticConstraint prototype) {
584 return this == DEFAULT_INSTANCE
590 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
608 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
611 public static final com.google.protobuf.Descriptors.Descriptor
613 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
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);
630 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
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;
649 public com.google.protobuf.Descriptors.Descriptor
651 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
656 return com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance();
663 throw newUninitializedMessageException(result);
671 if (bitField0_ != 0) { buildPartial0(result); }
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_;
682 if (((from_bitField0_ & 0x00000002) != 0)) {
683 coefficient_.makeImmutable();
684 result.coefficient_ = coefficient_;
686 if (((from_bitField0_ & 0x00000004) != 0)) {
687 qvar1Index_.makeImmutable();
688 result.qvar1Index_ = qvar1Index_;
690 if (((from_bitField0_ & 0x00000008) != 0)) {
691 qvar2Index_.makeImmutable();
692 result.qvar2Index_ = qvar2Index_;
694 if (((from_bitField0_ & 0x00000010) != 0)) {
695 qcoefficient_.makeImmutable();
696 result.qcoefficient_ = qcoefficient_;
698 int to_bitField0_ = 0;
699 if (((from_bitField0_ & 0x00000020) != 0)) {
700 result.lowerBound_ = lowerBound_;
701 to_bitField0_ |= 0x00000001;
703 if (((from_bitField0_ & 0x00000040) != 0)) {
704 result.upperBound_ = upperBound_;
705 to_bitField0_ |= 0x00000002;
707 result.bitField0_ |= to_bitField0_;
712 if (other instanceof com.google.ortools.linearsolver.MPQuadraticConstraint) {
713 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticConstraint)other);
715 super.mergeFrom(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;
728 ensureVarIndexIsMutable();
729 varIndex_.addAll(other.varIndex_);
733 if (!other.coefficient_.isEmpty()) {
734 if (coefficient_.isEmpty()) {
735 coefficient_ = other.coefficient_;
736 coefficient_.makeImmutable();
737 bitField0_ |= 0x00000002;
739 ensureCoefficientIsMutable();
740 coefficient_.addAll(other.coefficient_);
744 if (!other.qvar1Index_.isEmpty()) {
745 if (qvar1Index_.isEmpty()) {
746 qvar1Index_ = other.qvar1Index_;
747 qvar1Index_.makeImmutable();
748 bitField0_ |= 0x00000004;
750 ensureQvar1IndexIsMutable();
751 qvar1Index_.addAll(other.qvar1Index_);
755 if (!other.qvar2Index_.isEmpty()) {
756 if (qvar2Index_.isEmpty()) {
757 qvar2Index_ = other.qvar2Index_;
758 qvar2Index_.makeImmutable();
759 bitField0_ |= 0x00000008;
761 ensureQvar2IndexIsMutable();
762 qvar2Index_.addAll(other.qvar2Index_);
766 if (!other.qcoefficient_.isEmpty()) {
767 if (qcoefficient_.isEmpty()) {
768 qcoefficient_ = other.qcoefficient_;
769 qcoefficient_.makeImmutable();
770 bitField0_ |= 0x00000010;
772 ensureQcoefficientIsMutable();
773 qcoefficient_.addAll(other.qcoefficient_);
777 if (other.hasLowerBound()) {
780 if (other.hasUpperBound()) {
783 this.mergeUnknownFields(other.getUnknownFields());
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();
802 boolean done =
false;
804 int tag = input.readTag();
810 int v = input.readInt32();
811 ensureVarIndexIsMutable();
816 int length = input.readRawVarint32();
817 int limit = input.pushLimit(length);
818 ensureVarIndexIsMutable();
819 while (input.getBytesUntilLimit() > 0) {
820 varIndex_.addInt(input.readInt32());
822 input.popLimit(limit);
826 double v = input.readDouble();
827 ensureCoefficientIsMutable();
828 coefficient_.addDouble(v);
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());
839 input.popLimit(limit);
843 int v = input.readInt32();
844 ensureQvar1IndexIsMutable();
845 qvar1Index_.addInt(v);
849 int length = input.readRawVarint32();
850 int limit = input.pushLimit(length);
851 ensureQvar1IndexIsMutable();
852 while (input.getBytesUntilLimit() > 0) {
853 qvar1Index_.addInt(input.readInt32());
855 input.popLimit(limit);
859 int v = input.readInt32();
860 ensureQvar2IndexIsMutable();
861 qvar2Index_.addInt(v);
865 int length = input.readRawVarint32();
866 int limit = input.pushLimit(length);
867 ensureQvar2IndexIsMutable();
868 while (input.getBytesUntilLimit() > 0) {
869 qvar2Index_.addInt(input.readInt32());
871 input.popLimit(limit);
875 double v = input.readDouble();
876 ensureQcoefficientIsMutable();
877 qcoefficient_.addDouble(v);
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());
888 input.popLimit(limit);
892 lowerBound_ = input.readDouble();
893 bitField0_ |= 0x00000020;
897 upperBound_ = input.readDouble();
898 bitField0_ |= 0x00000040;
902 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
909 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
910 throw e.unwrapIOException();
916 private int bitField0_;
918 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
919 private void ensureVarIndexIsMutable() {
920 if (!varIndex_.isModifiable()) {
921 varIndex_ = makeMutableCopy(varIndex_);
923 bitField0_ |= 0x00000001;
936 public java.util.List<java.lang.Integer>
938 varIndex_.makeImmutable();
953 return varIndex_.size();
968 return varIndex_.getInt(index);
984 int index,
int value) {
986 ensureVarIndexIsMutable();
987 varIndex_.setInt(index, value);
988 bitField0_ |= 0x00000001;
1006 ensureVarIndexIsMutable();
1007 varIndex_.addInt(value);
1008 bitField0_ |= 0x00000001;
1025 java.lang.Iterable<? extends java.lang.Integer> values) {
1026 ensureVarIndexIsMutable();
1027 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1029 bitField0_ |= 0x00000001;
1045 varIndex_ = emptyIntList();
1046 bitField0_ = (bitField0_ & ~0x00000001);
1051 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
1052 private void ensureCoefficientIsMutable() {
1053 if (!coefficient_.isModifiable()) {
1054 coefficient_ = makeMutableCopy(coefficient_);
1056 bitField0_ |= 0x00000002;
1058 private void ensureCoefficientIsMutable(
int capacity) {
1059 if (!coefficient_.isModifiable()) {
1060 coefficient_ = makeMutableCopy(coefficient_, capacity);
1062 bitField0_ |= 0x00000002;
1072 public java.util.List<java.lang.Double>
1074 coefficient_.makeImmutable();
1075 return coefficient_;
1086 return coefficient_.size();
1098 return coefficient_.getDouble(index);
1111 int index,
double value) {
1113 ensureCoefficientIsMutable();
1114 coefficient_.setDouble(index, value);
1115 bitField0_ |= 0x00000002;
1130 ensureCoefficientIsMutable();
1131 coefficient_.addDouble(value);
1132 bitField0_ |= 0x00000002;
1146 java.lang.Iterable<? extends java.lang.Double> values) {
1147 ensureCoefficientIsMutable();
1148 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1149 values, coefficient_);
1150 bitField0_ |= 0x00000002;
1163 coefficient_ = emptyDoubleList();
1164 bitField0_ = (bitField0_ & ~0x00000002);
1169 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
1170 private void ensureQvar1IndexIsMutable() {
1171 if (!qvar1Index_.isModifiable()) {
1172 qvar1Index_ = makeMutableCopy(qvar1Index_);
1174 bitField0_ |= 0x00000004;
1190 public java.util.List<java.lang.Integer>
1192 qvar1Index_.makeImmutable();
1210 return qvar1Index_.size();
1228 return qvar1Index_.getInt(index);
1247 int index,
int value) {
1249 ensureQvar1IndexIsMutable();
1250 qvar1Index_.setInt(index, value);
1251 bitField0_ |= 0x00000004;
1272 ensureQvar1IndexIsMutable();
1273 qvar1Index_.addInt(value);
1274 bitField0_ |= 0x00000004;
1294 java.lang.Iterable<? extends java.lang.Integer> values) {
1295 ensureQvar1IndexIsMutable();
1296 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1297 values, qvar1Index_);
1298 bitField0_ |= 0x00000004;
1317 qvar1Index_ = emptyIntList();
1318 bitField0_ = (bitField0_ & ~0x00000004);
1323 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
1324 private void ensureQvar2IndexIsMutable() {
1325 if (!qvar2Index_.isModifiable()) {
1326 qvar2Index_ = makeMutableCopy(qvar2Index_);
1328 bitField0_ |= 0x00000008;
1334 public java.util.List<java.lang.Integer>
1336 qvar2Index_.makeImmutable();
1344 return qvar2Index_.size();
1352 return qvar2Index_.getInt(index);
1361 int index,
int value) {
1363 ensureQvar2IndexIsMutable();
1364 qvar2Index_.setInt(index, value);
1365 bitField0_ |= 0x00000008;
1376 ensureQvar2IndexIsMutable();
1377 qvar2Index_.addInt(value);
1378 bitField0_ |= 0x00000008;
1388 java.lang.Iterable<? extends java.lang.Integer> values) {
1389 ensureQvar2IndexIsMutable();
1390 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1391 values, qvar2Index_);
1392 bitField0_ |= 0x00000008;
1401 qvar2Index_ = emptyIntList();
1402 bitField0_ = (bitField0_ & ~0x00000008);
1407 private com.google.protobuf.Internal.DoubleList qcoefficient_ = emptyDoubleList();
1408 private void ensureQcoefficientIsMutable() {
1409 if (!qcoefficient_.isModifiable()) {
1410 qcoefficient_ = makeMutableCopy(qcoefficient_);
1412 bitField0_ |= 0x00000010;
1414 private void ensureQcoefficientIsMutable(
int capacity) {
1415 if (!qcoefficient_.isModifiable()) {
1416 qcoefficient_ = makeMutableCopy(qcoefficient_, capacity);
1418 bitField0_ |= 0x00000010;
1428 public java.util.List<java.lang.Double>
1430 qcoefficient_.makeImmutable();
1431 return qcoefficient_;
1442 return qcoefficient_.size();
1454 return qcoefficient_.getDouble(index);
1467 int index,
double value) {
1469 ensureQcoefficientIsMutable();
1470 qcoefficient_.setDouble(index, value);
1471 bitField0_ |= 0x00000010;
1486 ensureQcoefficientIsMutable();
1487 qcoefficient_.addDouble(value);
1488 bitField0_ |= 0x00000010;
1502 java.lang.Iterable<? extends java.lang.Double> values) {
1503 ensureQcoefficientIsMutable();
1504 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1505 values, qcoefficient_);
1506 bitField0_ |= 0x00000010;
1519 qcoefficient_ = emptyDoubleList();
1520 bitField0_ = (bitField0_ & ~0x00000010);
1525 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1536 return ((bitField0_ & 0x00000020) != 0);
1561 lowerBound_ = value;
1562 bitField0_ |= 0x00000020;
1575 bitField0_ = (bitField0_ & ~0x00000020);
1576 lowerBound_ = Double.NEGATIVE_INFINITY;
1581 private double upperBound_ = Double.POSITIVE_INFINITY;
1588 return ((bitField0_ & 0x00000040) != 0);
1605 upperBound_ = value;
1606 bitField0_ |= 0x00000040;
1615 bitField0_ = (bitField0_ & ~0x00000040);
1616 upperBound_ = Double.POSITIVE_INFINITY;
1627 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticConstraint();
1631 return DEFAULT_INSTANCE;
1638 com.google.protobuf.CodedInputStream input,
1639 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1640 throws com.google.protobuf.InvalidProtocolBufferException {
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());
1652 return builder.buildPartial();
1667 return DEFAULT_INSTANCE;