6package com.google.ortools.linearsolver;
21@com.google.protobuf.Generated
22public final class MPQuadraticConstraint
extends
23 com.google.protobuf.GeneratedMessage implements
26private static final long serialVersionUID = 0L;
28 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
29 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 MPQuadraticConstraint.class.getName());
37 private MPQuadraticConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
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;
50 public static final com.google.protobuf.Descriptors.Descriptor
52 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
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);
63 private int bitField0_;
65 @SuppressWarnings(
"serial")
66 private com.google.protobuf.Internal.IntList varIndex_ =
80 public java.
util.List<java.lang.Integer>
96 return varIndex_.size();
111 return varIndex_.getInt(index);
115 @SuppressWarnings(
"serial")
116 private com.google.protobuf.Internal.DoubleList coefficient_ =
127 public java.
util.List<java.lang.Double>
140 return coefficient_.size();
152 return coefficient_.getDouble(index);
156 @SuppressWarnings(
"serial")
157 private com.google.protobuf.Internal.IntList qvar1Index_ =
174 public java.
util.List<java.lang.Integer>
193 return qvar1Index_.size();
211 return qvar1Index_.getInt(index);
215 @SuppressWarnings(
"serial")
216 private com.google.protobuf.Internal.IntList qvar2Index_ =
223 public java.
util.List<java.lang.Integer>
232 return qvar2Index_.size();
240 return qvar2Index_.getInt(index);
244 @SuppressWarnings(
"serial")
245 private com.google.protobuf.Internal.DoubleList qcoefficient_ =
256 public java.
util.List<java.lang.Double>
258 return qcoefficient_;
269 return qcoefficient_.size();
281 return qcoefficient_.getDouble(index);
285 private double lowerBound_ = Double.NEGATIVE_INFINITY;
296 return ((bitField0_ & 0x00000001) != 0);
312 private double upperBound_ = Double.POSITIVE_INFINITY;
319 return ((bitField0_ & 0x00000002) != 0);
330 private byte memoizedIsInitialized = -1;
337 memoizedIsInitialized = 1;
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));
347 for (
int i = 0; i < coefficient_.size(); i++) {
348 output.writeDouble(2, coefficient_.getDouble(i));
350 for (
int i = 0; i < qvar1Index_.size(); i++) {
351 output.writeInt32(3, qvar1Index_.getInt(i));
353 for (
int i = 0; i < qvar2Index_.size(); i++) {
354 output.writeInt32(4, qvar2Index_.getInt(i));
356 for (
int i = 0; i < qcoefficient_.size(); i++) {
357 output.writeDouble(5, qcoefficient_.getDouble(i));
359 if (((bitField0_ & 0x00000001) != 0)) {
360 output.writeDouble(6, lowerBound_);
362 if (((bitField0_ & 0x00000002) != 0)) {
363 output.writeDouble(7, upperBound_);
365 getUnknownFields().writeTo(output);
370 int size = memoizedSize;
371 if (size != -1)
return size;
376 for (
int i = 0; i < varIndex_.size(); i++) {
377 dataSize += com.google.protobuf.CodedOutputStream
378 .computeInt32SizeNoTag(varIndex_.getInt(i));
391 for (
int i = 0; i < qvar1Index_.size(); i++) {
392 dataSize += com.google.protobuf.CodedOutputStream
393 .computeInt32SizeNoTag(qvar1Index_.getInt(i));
400 for (
int i = 0; i < qvar2Index_.size(); i++) {
401 dataSize += com.google.protobuf.CodedOutputStream
402 .computeInt32SizeNoTag(qvar2Index_.getInt(i));
413 if (((bitField0_ & 0x00000001) != 0)) {
414 size += com.google.protobuf.CodedOutputStream
415 .computeDoubleSize(6, lowerBound_);
417 if (((bitField0_ & 0x00000002) != 0)) {
418 size += com.google.protobuf.CodedOutputStream
419 .computeDoubleSize(7, upperBound_);
421 size += getUnknownFields().getSerializedSize();
427 public boolean equals(
final java.lang.Object obj) {
431 if (!(obj instanceof com.google.ortools.linearsolver.MPQuadraticConstraint)) {
432 return super.equals(obj);
449 != java.lang.Double.doubleToLongBits(
455 != java.lang.Double.doubleToLongBits(
458 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
464 if (memoizedHashCode != 0) {
465 return memoizedHashCode;
491 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
496 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
499 hash = (29 * hash) + getUnknownFields().hashCode();
500 memoizedHashCode = hash;
505 java.nio.ByteBuffer data)
506 throws com.google.protobuf.InvalidProtocolBufferException {
507 return PARSER.parseFrom(data);
510 java.nio.ByteBuffer data,
511 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
512 throws com.google.protobuf.InvalidProtocolBufferException {
513 return PARSER.parseFrom(data, extensionRegistry);
516 com.google.protobuf.ByteString data)
517 throws com.google.protobuf.InvalidProtocolBufferException {
518 return PARSER.parseFrom(data);
521 com.google.protobuf.ByteString data,
522 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
523 throws com.google.protobuf.InvalidProtocolBufferException {
524 return PARSER.parseFrom(data, extensionRegistry);
527 throws com.google.protobuf.InvalidProtocolBufferException {
528 return PARSER.parseFrom(data);
532 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
533 throws com.google.protobuf.InvalidProtocolBufferException {
534 return PARSER.parseFrom(data, extensionRegistry);
537 throws java.io.IOException {
538 return com.google.protobuf.GeneratedMessage
539 .parseWithIOException(PARSER, input);
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);
550 throws java.io.IOException {
551 return com.google.protobuf.GeneratedMessage
552 .parseDelimitedWithIOException(PARSER, input);
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);
563 com.google.protobuf.CodedInputStream input)
564 throws java.io.IOException {
565 return com.google.protobuf.GeneratedMessage
566 .parseWithIOException(PARSER, input);
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);
579 return DEFAULT_INSTANCE.toBuilder();
581 public static Builder newBuilder(com.google.ortools.linearsolver.MPQuadraticConstraint prototype) {
582 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
586 return this == DEFAULT_INSTANCE
592 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
609 public static final class Builder
extends
610 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
613 public static final com.google.protobuf.Descriptors.Descriptor
615 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
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);
632 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
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;
651 public com.google.protobuf.Descriptors.Descriptor
653 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPQuadraticConstraint_descriptor;
658 return com.google.ortools.linearsolver.MPQuadraticConstraint.getDefaultInstance();
665 throw newUninitializedMessageException(result);
673 if (bitField0_ != 0) { buildPartial0(result); }
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_;
684 if (((from_bitField0_ & 0x00000002) != 0)) {
685 coefficient_.makeImmutable();
686 result.coefficient_ = coefficient_;
688 if (((from_bitField0_ & 0x00000004) != 0)) {
689 qvar1Index_.makeImmutable();
690 result.qvar1Index_ = qvar1Index_;
692 if (((from_bitField0_ & 0x00000008) != 0)) {
693 qvar2Index_.makeImmutable();
694 result.qvar2Index_ = qvar2Index_;
696 if (((from_bitField0_ & 0x00000010) != 0)) {
697 qcoefficient_.makeImmutable();
698 result.qcoefficient_ = qcoefficient_;
700 int to_bitField0_ = 0;
701 if (((from_bitField0_ & 0x00000020) != 0)) {
702 result.lowerBound_ = lowerBound_;
703 to_bitField0_ |= 0x00000001;
705 if (((from_bitField0_ & 0x00000040) != 0)) {
706 result.upperBound_ = upperBound_;
707 to_bitField0_ |= 0x00000002;
709 result.bitField0_ |= to_bitField0_;
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);
717 super.mergeFrom(other);
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;
730 ensureVarIndexIsMutable();
731 varIndex_.addAll(other.varIndex_);
735 if (!other.coefficient_.isEmpty()) {
736 if (coefficient_.isEmpty()) {
737 coefficient_ = other.coefficient_;
738 coefficient_.makeImmutable();
739 bitField0_ |= 0x00000002;
741 ensureCoefficientIsMutable();
742 coefficient_.addAll(other.coefficient_);
746 if (!other.qvar1Index_.isEmpty()) {
747 if (qvar1Index_.isEmpty()) {
748 qvar1Index_ = other.qvar1Index_;
749 qvar1Index_.makeImmutable();
750 bitField0_ |= 0x00000004;
752 ensureQvar1IndexIsMutable();
753 qvar1Index_.addAll(other.qvar1Index_);
757 if (!other.qvar2Index_.isEmpty()) {
758 if (qvar2Index_.isEmpty()) {
759 qvar2Index_ = other.qvar2Index_;
760 qvar2Index_.makeImmutable();
761 bitField0_ |= 0x00000008;
763 ensureQvar2IndexIsMutable();
764 qvar2Index_.addAll(other.qvar2Index_);
768 if (!other.qcoefficient_.isEmpty()) {
769 if (qcoefficient_.isEmpty()) {
770 qcoefficient_ = other.qcoefficient_;
771 qcoefficient_.makeImmutable();
772 bitField0_ |= 0x00000010;
774 ensureQcoefficientIsMutable();
775 qcoefficient_.addAll(other.qcoefficient_);
779 if (other.hasLowerBound()) {
782 if (other.hasUpperBound()) {
785 this.mergeUnknownFields(other.getUnknownFields());
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();
804 boolean done =
false;
806 int tag = input.readTag();
812 int v = input.readInt32();
813 ensureVarIndexIsMutable();
818 int length = input.readRawVarint32();
819 int limit = input.pushLimit(length);
820 ensureVarIndexIsMutable();
821 while (input.getBytesUntilLimit() > 0) {
822 varIndex_.addInt(input.readInt32());
824 input.popLimit(limit);
828 double v = input.readDouble();
829 ensureCoefficientIsMutable();
830 coefficient_.addDouble(v);
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());
841 input.popLimit(limit);
845 int v = input.readInt32();
846 ensureQvar1IndexIsMutable();
847 qvar1Index_.addInt(v);
851 int length = input.readRawVarint32();
852 int limit = input.pushLimit(length);
853 ensureQvar1IndexIsMutable();
854 while (input.getBytesUntilLimit() > 0) {
855 qvar1Index_.addInt(input.readInt32());
857 input.popLimit(limit);
861 int v = input.readInt32();
862 ensureQvar2IndexIsMutable();
863 qvar2Index_.addInt(v);
867 int length = input.readRawVarint32();
868 int limit = input.pushLimit(length);
869 ensureQvar2IndexIsMutable();
870 while (input.getBytesUntilLimit() > 0) {
871 qvar2Index_.addInt(input.readInt32());
873 input.popLimit(limit);
877 double v = input.readDouble();
878 ensureQcoefficientIsMutable();
879 qcoefficient_.addDouble(v);
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());
890 input.popLimit(limit);
894 lowerBound_ = input.readDouble();
895 bitField0_ |= 0x00000020;
899 upperBound_ = input.readDouble();
900 bitField0_ |= 0x00000040;
904 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
911 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
912 throw e.unwrapIOException();
918 private int bitField0_;
920 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
921 private void ensureVarIndexIsMutable() {
922 if (!varIndex_.isModifiable()) {
923 varIndex_ = makeMutableCopy(varIndex_);
925 bitField0_ |= 0x00000001;
938 public java.util.List<java.lang.Integer>
940 varIndex_.makeImmutable();
955 return varIndex_.size();
970 return varIndex_.getInt(index);
986 int index,
int value) {
988 ensureVarIndexIsMutable();
989 varIndex_.setInt(index, value);
990 bitField0_ |= 0x00000001;
1008 ensureVarIndexIsMutable();
1009 varIndex_.addInt(value);
1010 bitField0_ |= 0x00000001;
1027 java.lang.Iterable<? extends java.lang.Integer> values) {
1028 ensureVarIndexIsMutable();
1029 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1031 bitField0_ |= 0x00000001;
1047 varIndex_ = emptyIntList();
1048 bitField0_ = (bitField0_ & ~0x00000001);
1053 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
1054 private void ensureCoefficientIsMutable() {
1055 if (!coefficient_.isModifiable()) {
1056 coefficient_ = makeMutableCopy(coefficient_);
1058 bitField0_ |= 0x00000002;
1060 private void ensureCoefficientIsMutable(
int capacity) {
1061 if (!coefficient_.isModifiable()) {
1062 coefficient_ = makeMutableCopy(coefficient_, capacity);
1064 bitField0_ |= 0x00000002;
1074 public java.util.List<java.lang.Double>
1076 coefficient_.makeImmutable();
1077 return coefficient_;
1088 return coefficient_.size();
1100 return coefficient_.getDouble(index);
1113 int index,
double value) {
1115 ensureCoefficientIsMutable();
1116 coefficient_.setDouble(index, value);
1117 bitField0_ |= 0x00000002;
1132 ensureCoefficientIsMutable();
1133 coefficient_.addDouble(value);
1134 bitField0_ |= 0x00000002;
1148 java.lang.Iterable<? extends java.lang.Double> values) {
1149 ensureCoefficientIsMutable();
1150 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1151 values, coefficient_);
1152 bitField0_ |= 0x00000002;
1165 coefficient_ = emptyDoubleList();
1166 bitField0_ = (bitField0_ & ~0x00000002);
1171 private com.google.protobuf.Internal.IntList qvar1Index_ = emptyIntList();
1172 private void ensureQvar1IndexIsMutable() {
1173 if (!qvar1Index_.isModifiable()) {
1174 qvar1Index_ = makeMutableCopy(qvar1Index_);
1176 bitField0_ |= 0x00000004;
1192 public java.util.List<java.lang.Integer>
1194 qvar1Index_.makeImmutable();
1212 return qvar1Index_.size();
1230 return qvar1Index_.getInt(index);
1249 int index,
int value) {
1251 ensureQvar1IndexIsMutable();
1252 qvar1Index_.setInt(index, value);
1253 bitField0_ |= 0x00000004;
1274 ensureQvar1IndexIsMutable();
1275 qvar1Index_.addInt(value);
1276 bitField0_ |= 0x00000004;
1296 java.lang.Iterable<? extends java.lang.Integer> values) {
1297 ensureQvar1IndexIsMutable();
1298 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1299 values, qvar1Index_);
1300 bitField0_ |= 0x00000004;
1319 qvar1Index_ = emptyIntList();
1320 bitField0_ = (bitField0_ & ~0x00000004);
1325 private com.google.protobuf.Internal.IntList qvar2Index_ = emptyIntList();
1326 private void ensureQvar2IndexIsMutable() {
1327 if (!qvar2Index_.isModifiable()) {
1328 qvar2Index_ = makeMutableCopy(qvar2Index_);
1330 bitField0_ |= 0x00000008;
1336 public java.util.List<java.lang.Integer>
1338 qvar2Index_.makeImmutable();
1346 return qvar2Index_.size();
1354 return qvar2Index_.getInt(index);
1363 int index,
int value) {
1365 ensureQvar2IndexIsMutable();
1366 qvar2Index_.setInt(index, value);
1367 bitField0_ |= 0x00000008;
1378 ensureQvar2IndexIsMutable();
1379 qvar2Index_.addInt(value);
1380 bitField0_ |= 0x00000008;
1390 java.lang.Iterable<? extends java.lang.Integer> values) {
1391 ensureQvar2IndexIsMutable();
1392 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1393 values, qvar2Index_);
1394 bitField0_ |= 0x00000008;
1403 qvar2Index_ = emptyIntList();
1404 bitField0_ = (bitField0_ & ~0x00000008);
1409 private com.google.protobuf.Internal.DoubleList qcoefficient_ = emptyDoubleList();
1410 private void ensureQcoefficientIsMutable() {
1411 if (!qcoefficient_.isModifiable()) {
1412 qcoefficient_ = makeMutableCopy(qcoefficient_);
1414 bitField0_ |= 0x00000010;
1416 private void ensureQcoefficientIsMutable(
int capacity) {
1417 if (!qcoefficient_.isModifiable()) {
1418 qcoefficient_ = makeMutableCopy(qcoefficient_, capacity);
1420 bitField0_ |= 0x00000010;
1430 public java.util.List<java.lang.Double>
1432 qcoefficient_.makeImmutable();
1433 return qcoefficient_;
1444 return qcoefficient_.size();
1456 return qcoefficient_.getDouble(index);
1469 int index,
double value) {
1471 ensureQcoefficientIsMutable();
1472 qcoefficient_.setDouble(index, value);
1473 bitField0_ |= 0x00000010;
1488 ensureQcoefficientIsMutable();
1489 qcoefficient_.addDouble(value);
1490 bitField0_ |= 0x00000010;
1504 java.lang.Iterable<? extends java.lang.Double> values) {
1505 ensureQcoefficientIsMutable();
1506 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1507 values, qcoefficient_);
1508 bitField0_ |= 0x00000010;
1521 qcoefficient_ = emptyDoubleList();
1522 bitField0_ = (bitField0_ & ~0x00000010);
1527 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1538 return ((bitField0_ & 0x00000020) != 0);
1563 lowerBound_ = value;
1564 bitField0_ |= 0x00000020;
1577 bitField0_ = (bitField0_ & ~0x00000020);
1578 lowerBound_ = Double.NEGATIVE_INFINITY;
1583 private double upperBound_ = Double.POSITIVE_INFINITY;
1590 return ((bitField0_ & 0x00000040) != 0);
1607 upperBound_ = value;
1608 bitField0_ |= 0x00000040;
1617 bitField0_ = (bitField0_ & ~0x00000040);
1618 upperBound_ = Double.POSITIVE_INFINITY;
1629 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPQuadraticConstraint();
1633 return DEFAULT_INSTANCE;
1640 com.google.protobuf.CodedInputStream input,
1641 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1642 throws com.google.protobuf.InvalidProtocolBufferException {
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());
1654 return builder.buildPartial();
1658 public static com.google.protobuf.Parser<MPQuadraticConstraint>
parser() {
1669 return DEFAULT_INSTANCE;