5package com.google.ortools.linearsolver;
21 com.google.protobuf.GeneratedMessageV3 implements
24private static final long serialVersionUID = 0L;
30 varIndex_ = emptyIntList();
31 coefficient_ = emptyDoubleList();
32 qvar1Index_ = emptyIntList();
33 qvar2Index_ = emptyIntList();
34 qcoefficient_ = emptyDoubleList();
35 lowerBound_ = Double.NEGATIVE_INFINITY;
36 upperBound_ = Double.POSITIVE_INFINITY;
40 @SuppressWarnings({
"unused"})
42 UnusedPrivateParameter unused) {
46 public static final com.google.protobuf.Descriptors.Descriptor
48 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
52 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
54 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_fieldAccessorTable
55 .ensureFieldAccessorsInitialized(
56 com.google.ortools.linearsolver.MPQuadraticConstraint.class, com.google.ortools.linearsolver.MPQuadraticConstraint.Builder.class);
59 private int bitField0_;
61 @SuppressWarnings(
"serial")
62 private com.google.protobuf.Internal.IntList varIndex_ =
76 public java.util.List<java.lang.Integer>
92 return varIndex_.size();
107 return varIndex_.getInt(index);
111 @SuppressWarnings(
"serial")
112 private com.google.protobuf.Internal.DoubleList coefficient_ =
123 public java.util.List<java.lang.Double>
136 return coefficient_.size();
148 return coefficient_.getDouble(index);
152 @SuppressWarnings(
"serial")
153 private com.google.protobuf.Internal.IntList qvar1Index_ =
170 public java.util.List<java.lang.Integer>
189 return qvar1Index_.size();
207 return qvar1Index_.getInt(index);
211 @SuppressWarnings(
"serial")
212 private com.google.protobuf.Internal.IntList qvar2Index_ =
219 public java.util.List<java.lang.Integer>
228 return qvar2Index_.size();
236 return qvar2Index_.getInt(index);
240 @SuppressWarnings(
"serial")
241 private com.google.protobuf.Internal.DoubleList qcoefficient_ =
252 public java.util.List<java.lang.Double>
254 return qcoefficient_;
265 return qcoefficient_.size();
277 return qcoefficient_.getDouble(index);
281 private double lowerBound_ = Double.NEGATIVE_INFINITY;
292 return ((bitField0_ & 0x00000001) != 0);
308 private double upperBound_ = Double.POSITIVE_INFINITY;
315 return ((bitField0_ & 0x00000002) != 0);
326 private byte memoizedIsInitialized = -1;
333 memoizedIsInitialized = 1;
338 public void writeTo(com.google.protobuf.CodedOutputStream output)
339 throws java.io.IOException {
340 for (
int i = 0; i < varIndex_.size(); i++) {
341 output.writeInt32(1, varIndex_.getInt(i));
343 for (
int i = 0; i < coefficient_.size(); i++) {
344 output.writeDouble(2, coefficient_.getDouble(i));
346 for (
int i = 0; i < qvar1Index_.size(); i++) {
347 output.writeInt32(3, qvar1Index_.getInt(i));
349 for (
int i = 0; i < qvar2Index_.size(); i++) {
350 output.writeInt32(4, qvar2Index_.getInt(i));
352 for (
int i = 0; i < qcoefficient_.size(); i++) {
353 output.writeDouble(5, qcoefficient_.getDouble(i));
355 if (((bitField0_ & 0x00000001) != 0)) {
356 output.writeDouble(6, lowerBound_);
358 if (((bitField0_ & 0x00000002) != 0)) {
359 output.writeDouble(7, upperBound_);
361 getUnknownFields().writeTo(output);
366 int size = memoizedSize;
367 if (size != -1)
return size;
372 for (
int i = 0; i < varIndex_.size(); i++) {
373 dataSize += com.google.protobuf.CodedOutputStream
374 .computeInt32SizeNoTag(varIndex_.getInt(i));
387 for (
int i = 0; i < qvar1Index_.size(); i++) {
388 dataSize += com.google.protobuf.CodedOutputStream
389 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
396 for (
int i = 0; i < qvar2Index_.size(); i++) {
397 dataSize += com.google.protobuf.CodedOutputStream
398 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
409 if (((bitField0_ & 0x00000001) != 0)) {
410 size += com.google.protobuf.CodedOutputStream
411 .computeDoubleSize(6, lowerBound_);
413 if (((bitField0_ & 0x00000002) != 0)) {
414 size += com.google.protobuf.CodedOutputStream
415 .computeDoubleSize(7, upperBound_);
417 size += getUnknownFields().getSerializedSize();
423 public boolean equals(
final java.lang.Object obj) {
427 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticConstraint)) {
428 return super.equals(obj);
445 != java.lang.Double.doubleToLongBits(
451 != java.lang.Double.doubleToLongBits(
454 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
460 if (memoizedHashCode != 0) {
461 return memoizedHashCode;
487 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
492 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
495 hash = (29 * hash) + getUnknownFields().hashCode();
496 memoizedHashCode = hash;
501 java.nio.ByteBuffer data)
502 throws com.google.protobuf.InvalidProtocolBufferException {
506 java.nio.ByteBuffer data,
507 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
508 throws com.google.protobuf.InvalidProtocolBufferException {
512 com.google.protobuf.ByteString data)
513 throws com.google.protobuf.InvalidProtocolBufferException {
517 com.google.protobuf.ByteString data,
518 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
519 throws com.google.protobuf.InvalidProtocolBufferException {
523 throws com.google.protobuf.InvalidProtocolBufferException {
528 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
529 throws com.google.protobuf.InvalidProtocolBufferException {
533 throws java.io.IOException {
534 return com.google.protobuf.GeneratedMessageV3
535 .parseWithIOException(
PARSER, input);
538 java.io.InputStream input,
539 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
540 throws java.io.IOException {
541 return com.google.protobuf.GeneratedMessageV3
542 .parseWithIOException(
PARSER, input, extensionRegistry);
546 throws java.io.IOException {
547 return com.google.protobuf.GeneratedMessageV3
548 .parseDelimitedWithIOException(
PARSER, input);
552 java.io.InputStream input,
553 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
554 throws java.io.IOException {
555 return com.google.protobuf.GeneratedMessageV3
556 .parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
559 com.google.protobuf.CodedInputStream input)
560 throws java.io.IOException {
561 return com.google.protobuf.GeneratedMessageV3
562 .parseWithIOException(
PARSER, input);
565 com.google.protobuf.CodedInputStream input,
566 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
567 throws java.io.IOException {
568 return com.google.protobuf.GeneratedMessageV3
569 .parseWithIOException(
PARSER, input, extensionRegistry);
577 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticConstraint prototype) {
582 return this == DEFAULT_INSTANCE
588 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
606 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
609 public static final com.google.protobuf.Descriptors.Descriptor
611 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
615 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
617 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_fieldAccessorTable
618 .ensureFieldAccessorsInitialized(
619 com.google.ortools.linearsolver.MPQuadraticConstraint.class, com.google.ortools.linearsolver.MPQuadraticConstraint.Builder.class);
628 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
636 varIndex_ = emptyIntList();
637 coefficient_ = emptyDoubleList();
638 qvar1Index_ = emptyIntList();
639 qvar2Index_ = emptyIntList();
640 qcoefficient_ = emptyDoubleList();
641 lowerBound_ = Double.NEGATIVE_INFINITY;
642 upperBound_ = Double.POSITIVE_INFINITY;
647 public com.google.protobuf.Descriptors.Descriptor
649 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
654 return com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance();
661 throw newUninitializedMessageException(result);
669 if (bitField0_ != 0) { buildPartial0(result); }
674 private void buildPartial0(com.google.ortools.linearsolver.MPQuadraticConstraint result) {
675 int from_bitField0_ = bitField0_;
676 if (((from_bitField0_ & 0x00000001) != 0)) {
677 varIndex_.makeImmutable();
678 result.varIndex_ = varIndex_;
680 if (((from_bitField0_ & 0x00000002) != 0)) {
681 coefficient_.makeImmutable();
682 result.coefficient_ = coefficient_;
684 if (((from_bitField0_ & 0x00000004) != 0)) {
685 qvar1Index_.makeImmutable();
686 result.qvar1Index_ = qvar1Index_;
688 if (((from_bitField0_ & 0x00000008) != 0)) {
689 qvar2Index_.makeImmutable();
690 result.qvar2Index_ = qvar2Index_;
692 if (((from_bitField0_ & 0x00000010) != 0)) {
693 qcoefficient_.makeImmutable();
694 result.qcoefficient_ = qcoefficient_;
696 int to_bitField0_ = 0;
697 if (((from_bitField0_ & 0x00000020) != 0)) {
698 result.lowerBound_ = lowerBound_;
699 to_bitField0_ |= 0x00000001;
701 if (((from_bitField0_ & 0x00000040) != 0)) {
702 result.upperBound_ = upperBound_;
703 to_bitField0_ |= 0x00000002;
705 result.bitField0_ |= to_bitField0_;
710 return super.
clone();
714 com.google.protobuf.Descriptors.FieldDescriptor field,
715 java.lang.Object value) {
716 return super.
setField(field, value);
720 com.google.protobuf.Descriptors.FieldDescriptor field) {
725 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
730 com.google.protobuf.Descriptors.FieldDescriptor field,
731 int index, java.lang.Object value) {
736 com.google.protobuf.Descriptors.FieldDescriptor field,
737 java.lang.Object value) {
742 if (other instanceof com.google.ortools.linearsolver.MPQuadraticConstraint) {
743 return mergeFrom((com.google.ortools.linearsolver.MPQuadraticConstraint)other);
745 super.mergeFrom(other);
751 if (other == com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance())
return this;
752 if (!other.varIndex_.isEmpty()) {
753 if (varIndex_.isEmpty()) {
754 varIndex_ = other.varIndex_;
755 varIndex_.makeImmutable();
756 bitField0_ |= 0x00000001;
758 ensureVarIndexIsMutable();
759 varIndex_.addAll(other.varIndex_);
763 if (!other.coefficient_.isEmpty()) {
764 if (coefficient_.isEmpty()) {
765 coefficient_ = other.coefficient_;
766 coefficient_.makeImmutable();
767 bitField0_ |= 0x00000002;
769 ensureCoefficientIsMutable();
770 coefficient_.addAll(other.coefficient_);
774 if (!other.qvar1Index_.isEmpty()) {
775 if (qvar1Index_.isEmpty()) {
776 qvar1Index_ = other.qvar1Index_;
777 qvar1Index_.makeImmutable();
778 bitField0_ |= 0x00000004;
780 ensureQvar1IndexIsMutable();
781 qvar1Index_.addAll(other.qvar1Index_);
785 if (!other.qvar2Index_.isEmpty()) {
786 if (qvar2Index_.isEmpty()) {
787 qvar2Index_ = other.qvar2Index_;
788 qvar2Index_.makeImmutable();
789 bitField0_ |= 0x00000008;
791 ensureQvar2IndexIsMutable();
792 qvar2Index_.addAll(other.qvar2Index_);
796 if (!other.qcoefficient_.isEmpty()) {
797 if (qcoefficient_.isEmpty()) {
798 qcoefficient_ = other.qcoefficient_;
799 qcoefficient_.makeImmutable();
800 bitField0_ |= 0x00000010;
802 ensureQcoefficientIsMutable();
803 qcoefficient_.addAll(other.qcoefficient_);
807 if (other.hasLowerBound()) {
810 if (other.hasUpperBound()) {
825 com.google.protobuf.CodedInputStream input,
826 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
827 throws java.io.IOException {
828 if (extensionRegistry ==
null) {
829 throw new java.lang.NullPointerException();
832 boolean done =
false;
834 int tag = input.readTag();
840 int v = input.readInt32();
841 ensureVarIndexIsMutable();
846 int length = input.readRawVarint32();
847 int limit = input.pushLimit(length);
848 ensureVarIndexIsMutable();
849 while (input.getBytesUntilLimit() > 0) {
850 varIndex_.addInt(input.readInt32());
852 input.popLimit(limit);
856 double v = input.readDouble();
857 ensureCoefficientIsMutable();
858 coefficient_.addDouble(v);
862 int length = input.readRawVarint32();
863 int limit = input.pushLimit(length);
864 int alloc = length > 4096 ? 4096 : length;
865 ensureCoefficientIsMutable(alloc / 8);
866 while (input.getBytesUntilLimit() > 0) {
867 coefficient_.addDouble(input.readDouble());
869 input.popLimit(limit);
873 int v = input.readInt32();
874 ensureQvar1IndexIsMutable();
875 qvar1Index_.addInt(v);
879 int length = input.readRawVarint32();
880 int limit = input.pushLimit(length);
881 ensureQvar1IndexIsMutable();
882 while (input.getBytesUntilLimit() > 0) {
883 qvar1Index_.addInt(input.readInt32());
885 input.popLimit(limit);
889 int v = input.readInt32();
890 ensureQvar2IndexIsMutable();
891 qvar2Index_.addInt(v);
895 int length = input.readRawVarint32();
896 int limit = input.pushLimit(length);
897 ensureQvar2IndexIsMutable();
898 while (input.getBytesUntilLimit() > 0) {
899 qvar2Index_.addInt(input.readInt32());
901 input.popLimit(limit);
905 double v = input.readDouble();
906 ensureQcoefficientIsMutable();
907 qcoefficient_.addDouble(v);
911 int length = input.readRawVarint32();
912 int limit = input.pushLimit(length);
913 int alloc = length > 4096 ? 4096 : length;
914 ensureQcoefficientIsMutable(alloc / 8);
915 while (input.getBytesUntilLimit() > 0) {
916 qcoefficient_.addDouble(input.readDouble());
918 input.popLimit(limit);
922 lowerBound_ = input.readDouble();
923 bitField0_ |= 0x00000020;
927 upperBound_ = input.readDouble();
928 bitField0_ |= 0x00000040;
932 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
939 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
940 throw e.unwrapIOException();
946 private int bitField0_;
948 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
949 private void ensureVarIndexIsMutable() {
950 if (!varIndex_.isModifiable()) {
951 varIndex_ = makeMutableCopy(varIndex_);
953 bitField0_ |= 0x00000001;
966 public java.util.List<java.lang.Integer>
968 varIndex_.makeImmutable();
983 return varIndex_.size();
998 return varIndex_.getInt(index);
1014 int index,
int value) {
1016 ensureVarIndexIsMutable();
1017 varIndex_.setInt(index, value);
1018 bitField0_ |= 0x00000001;
1036 ensureVarIndexIsMutable();
1037 varIndex_.addInt(value);
1038 bitField0_ |= 0x00000001;
1055 java.lang.Iterable<? extends java.lang.Integer> values) {
1056 ensureVarIndexIsMutable();
1057 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1059 bitField0_ |= 0x00000001;
1075 varIndex_ = emptyIntList();
1076 bitField0_ = (bitField0_ & ~0x00000001);
1081 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
1082 private void ensureCoefficientIsMutable() {
1083 if (!coefficient_.isModifiable()) {
1084 coefficient_ = makeMutableCopy(coefficient_);
1086 bitField0_ |= 0x00000002;
1088 private void ensureCoefficientIsMutable(
int capacity) {
1089 if (!coefficient_.isModifiable()) {
1090 coefficient_ = makeMutableCopy(coefficient_, capacity);
1092 bitField0_ |= 0x00000002;
1102 public java.util.List<java.lang.Double>
1104 coefficient_.makeImmutable();
1105 return coefficient_;
1116 return coefficient_.size();
1128 return coefficient_.getDouble(index);
1141 int index,
double value) {
1143 ensureCoefficientIsMutable();
1144 coefficient_.setDouble(index, value);
1145 bitField0_ |= 0x00000002;
1160 ensureCoefficientIsMutable();
1161 coefficient_.addDouble(value);
1162 bitField0_ |= 0x00000002;
1176 java.lang.Iterable<? extends java.lang.Double> values) {
1177 ensureCoefficientIsMutable();
1178 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1179 values, coefficient_);
1180 bitField0_ |= 0x00000002;
1193 coefficient_ = emptyDoubleList();
1194 bitField0_ = (bitField0_ & ~0x00000002);
1199 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
1200 private void ensureQvar1IndexIsMutable() {
1201 if (!qvar1Index_.isModifiable()) {
1202 qvar1Index_ = makeMutableCopy(qvar1Index_);
1204 bitField0_ |= 0x00000004;
1220 public java.util.List<java.lang.Integer>
1222 qvar1Index_.makeImmutable();
1240 return qvar1Index_.size();
1258 return qvar1Index_.getInt(index);
1277 int index,
int value) {
1279 ensureQvar1IndexIsMutable();
1280 qvar1Index_.setInt(index, value);
1281 bitField0_ |= 0x00000004;
1302 ensureQvar1IndexIsMutable();
1303 qvar1Index_.addInt(value);
1304 bitField0_ |= 0x00000004;
1324 java.lang.Iterable<? extends java.lang.Integer> values) {
1325 ensureQvar1IndexIsMutable();
1326 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1327 values, qvar1Index_);
1328 bitField0_ |= 0x00000004;
1347 qvar1Index_ = emptyIntList();
1348 bitField0_ = (bitField0_ & ~0x00000004);
1353 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
1354 private void ensureQvar2IndexIsMutable() {
1355 if (!qvar2Index_.isModifiable()) {
1356 qvar2Index_ = makeMutableCopy(qvar2Index_);
1358 bitField0_ |= 0x00000008;
1364 public java.util.List<java.lang.Integer>
1366 qvar2Index_.makeImmutable();
1374 return qvar2Index_.size();
1382 return qvar2Index_.getInt(index);
1391 int index,
int value) {
1393 ensureQvar2IndexIsMutable();
1394 qvar2Index_.setInt(index, value);
1395 bitField0_ |= 0x00000008;
1406 ensureQvar2IndexIsMutable();
1407 qvar2Index_.addInt(value);
1408 bitField0_ |= 0x00000008;
1418 java.lang.Iterable<? extends java.lang.Integer> values) {
1419 ensureQvar2IndexIsMutable();
1420 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1421 values, qvar2Index_);
1422 bitField0_ |= 0x00000008;
1431 qvar2Index_ = emptyIntList();
1432 bitField0_ = (bitField0_ & ~0x00000008);
1437 private com.google.protobuf.Internal.DoubleList qcoefficient_ = emptyDoubleList();
1438 private void ensureQcoefficientIsMutable() {
1439 if (!qcoefficient_.isModifiable()) {
1440 qcoefficient_ = makeMutableCopy(qcoefficient_);
1442 bitField0_ |= 0x00000010;
1444 private void ensureQcoefficientIsMutable(
int capacity) {
1445 if (!qcoefficient_.isModifiable()) {
1446 qcoefficient_ = makeMutableCopy(qcoefficient_, capacity);
1448 bitField0_ |= 0x00000010;
1458 public java.util.List<java.lang.Double>
1460 qcoefficient_.makeImmutable();
1461 return qcoefficient_;
1472 return qcoefficient_.size();
1484 return qcoefficient_.getDouble(index);
1497 int index,
double value) {
1499 ensureQcoefficientIsMutable();
1500 qcoefficient_.setDouble(index, value);
1501 bitField0_ |= 0x00000010;
1516 ensureQcoefficientIsMutable();
1517 qcoefficient_.addDouble(value);
1518 bitField0_ |= 0x00000010;
1532 java.lang.Iterable<? extends java.lang.Double> values) {
1533 ensureQcoefficientIsMutable();
1534 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1535 values, qcoefficient_);
1536 bitField0_ |= 0x00000010;
1549 qcoefficient_ = emptyDoubleList();
1550 bitField0_ = (bitField0_ & ~0x00000010);
1555 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1566 return ((bitField0_ & 0x00000020) != 0);
1591 lowerBound_ = value;
1592 bitField0_ |= 0x00000020;
1605 bitField0_ = (bitField0_ & ~0x00000020);
1606 lowerBound_ = Double.NEGATIVE_INFINITY;
1611 private double upperBound_ = Double.POSITIVE_INFINITY;
1618 return ((bitField0_ & 0x00000040) != 0);
1635 upperBound_ = value;
1636 bitField0_ |= 0x00000040;
1645 bitField0_ = (bitField0_ & ~0x00000040);
1646 upperBound_ = Double.POSITIVE_INFINITY;
1652 final com.google.protobuf.UnknownFieldSet unknownFields) {
1658 final com.google.protobuf.UnknownFieldSet unknownFields) {
1669 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticConstraint();
1673 return DEFAULT_INSTANCE;
1680 com.google.protobuf.CodedInputStream input,
1681 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1682 throws com.google.protobuf.InvalidProtocolBufferException {
1685 builder.
mergeFrom(input, extensionRegistry);
1686 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1688 }
catch (com.google.protobuf.UninitializedMessageException e) {
1689 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.
buildPartial());
1690 }
catch (java.io.IOException e) {
1691 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1709 return DEFAULT_INSTANCE;