6package com.google.ortools.linearsolver;
25@com.google.protobuf.Generated
26public final class MPConstraintProto
extends
27 com.google.protobuf.GeneratedMessage implements
30private static final long serialVersionUID = 0L;
32 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
33 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
38 MPConstraintProto.class.getName());
41 private MPConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
44 private MPConstraintProto() {
45 varIndex_ = emptyIntList();
46 coefficient_ = emptyDoubleList();
47 lowerBound_ = Double.NEGATIVE_INFINITY;
48 upperBound_ = Double.POSITIVE_INFINITY;
52 public static final com.google.protobuf.Descriptors.Descriptor
54 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
58 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
60 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
61 .ensureFieldAccessorsInitialized(
62 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
65 private int bitField0_;
67 @SuppressWarnings(
"serial")
68 private com.google.protobuf.Internal.IntList varIndex_ =
82 public java.
util.List<java.lang.Integer>
98 return varIndex_.size();
113 return varIndex_.getInt(index);
115 private int varIndexMemoizedSerializedSize = -1;
118 @SuppressWarnings(
"serial")
119 private com.google.protobuf.Internal.DoubleList coefficient_ =
130 public java.
util.List<java.lang.Double>
143 return coefficient_.size();
155 return coefficient_.getDouble(index);
157 private int coefficientMemoizedSerializedSize = -1;
160 private double lowerBound_ = Double.NEGATIVE_INFINITY;
171 return ((bitField0_ & 0x00000001) != 0);
187 private double upperBound_ = Double.POSITIVE_INFINITY;
194 return ((bitField0_ & 0x00000002) != 0);
206 @SuppressWarnings(
"serial")
207 private volatile java.lang.Object name_ =
"";
218 return ((bitField0_ & 0x00000004) != 0);
230 java.lang.Object ref = name_;
231 if (ref instanceof java.lang.String) {
232 return (java.lang.String) ref;
234 com.google.protobuf.ByteString bs =
235 (com.google.protobuf.ByteString) ref;
236 java.lang.String s = bs.toStringUtf8();
237 if (bs.isValidUtf8()) {
252 public com.google.protobuf.ByteString
254 java.lang.Object ref = name_;
255 if (ref instanceof java.lang.String) {
256 com.google.protobuf.ByteString b =
257 com.google.protobuf.ByteString.copyFromUtf8(
258 (java.lang.String) ref);
262 return (com.google.protobuf.ByteString) ref;
267 private boolean isLazy_ =
false;
281 return ((bitField0_ & 0x00000008) != 0);
299 private byte memoizedIsInitialized = -1;
306 memoizedIsInitialized = 1;
311 public void writeTo(com.google.protobuf.CodedOutputStream output)
312 throws java.io.IOException {
314 if (((bitField0_ & 0x00000001) != 0)) {
315 output.writeDouble(2, lowerBound_);
317 if (((bitField0_ & 0x00000002) != 0)) {
318 output.writeDouble(3, upperBound_);
320 if (((bitField0_ & 0x00000004) != 0)) {
321 com.google.protobuf.GeneratedMessage.writeString(output, 4, name_);
323 if (((bitField0_ & 0x00000008) != 0)) {
324 output.writeBool(5, isLazy_);
327 output.writeUInt32NoTag(50);
328 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
330 for (
int i = 0; i < varIndex_.size(); i++) {
331 output.writeInt32NoTag(varIndex_.getInt(i));
334 output.writeUInt32NoTag(58);
335 output.writeUInt32NoTag(coefficientMemoizedSerializedSize);
337 for (
int i = 0; i < coefficient_.size(); i++) {
338 output.writeDoubleNoTag(coefficient_.getDouble(i));
340 getUnknownFields().writeTo(output);
345 int size = memoizedSize;
346 if (size != -1)
return size;
349 if (((bitField0_ & 0x00000001) != 0)) {
350 size += com.google.protobuf.CodedOutputStream
351 .computeDoubleSize(2, lowerBound_);
353 if (((bitField0_ & 0x00000002) != 0)) {
354 size += com.google.protobuf.CodedOutputStream
355 .computeDoubleSize(3, upperBound_);
357 if (((bitField0_ & 0x00000004) != 0)) {
358 size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_);
360 if (((bitField0_ & 0x00000008) != 0)) {
361 size += com.google.protobuf.CodedOutputStream
362 .computeBoolSize(5, isLazy_);
366 for (
int i = 0; i < varIndex_.size(); i++) {
367 dataSize += com.google.protobuf.CodedOutputStream
368 .computeInt32SizeNoTag(varIndex_.getInt(i));
373 size += com.google.protobuf.CodedOutputStream
374 .computeInt32SizeNoTag(dataSize);
376 varIndexMemoizedSerializedSize = dataSize;
384 size += com.google.protobuf.CodedOutputStream
385 .computeInt32SizeNoTag(dataSize);
387 coefficientMemoizedSerializedSize = dataSize;
389 size += getUnknownFields().getSerializedSize();
395 public boolean equals(
final java.lang.Object obj) {
399 if (!(obj instanceof com.google.ortools.linearsolver.MPConstraintProto)) {
400 return super.equals(obj);
411 != java.lang.Double.doubleToLongBits(
417 != java.lang.Double.doubleToLongBits(
430 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
436 if (memoizedHashCode != 0) {
437 return memoizedHashCode;
451 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
456 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
461 hash = (53 * hash) +
getName().hashCode();
465 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
468 hash = (29 * hash) + getUnknownFields().hashCode();
469 memoizedHashCode = hash;
474 java.nio.ByteBuffer data)
475 throws com.google.protobuf.InvalidProtocolBufferException {
476 return PARSER.parseFrom(data);
479 java.nio.ByteBuffer data,
480 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
481 throws com.google.protobuf.InvalidProtocolBufferException {
482 return PARSER.parseFrom(data, extensionRegistry);
485 com.google.protobuf.ByteString data)
486 throws com.google.protobuf.InvalidProtocolBufferException {
487 return PARSER.parseFrom(data);
490 com.google.protobuf.ByteString data,
491 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
492 throws com.google.protobuf.InvalidProtocolBufferException {
493 return PARSER.parseFrom(data, extensionRegistry);
496 throws com.google.protobuf.InvalidProtocolBufferException {
497 return PARSER.parseFrom(data);
501 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
502 throws com.google.protobuf.InvalidProtocolBufferException {
503 return PARSER.parseFrom(data, extensionRegistry);
506 throws java.io.IOException {
507 return com.google.protobuf.GeneratedMessage
508 .parseWithIOException(PARSER, input);
511 java.io.InputStream input,
512 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
513 throws java.io.IOException {
514 return com.google.protobuf.GeneratedMessage
515 .parseWithIOException(PARSER, input, extensionRegistry);
519 throws java.io.IOException {
520 return com.google.protobuf.GeneratedMessage
521 .parseDelimitedWithIOException(PARSER, input);
525 java.io.InputStream input,
526 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
527 throws java.io.IOException {
528 return com.google.protobuf.GeneratedMessage
529 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
532 com.google.protobuf.CodedInputStream input)
533 throws java.io.IOException {
534 return com.google.protobuf.GeneratedMessage
535 .parseWithIOException(PARSER, input);
538 com.google.protobuf.CodedInputStream input,
539 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
540 throws java.io.IOException {
541 return com.google.protobuf.GeneratedMessage
542 .parseWithIOException(PARSER, input, extensionRegistry);
548 return DEFAULT_INSTANCE.toBuilder();
551 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
555 return this == DEFAULT_INSTANCE
561 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
582 public static final class Builder
extends
583 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
586 public static final com.google.protobuf.Descriptors.Descriptor
588 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
592 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
594 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
595 .ensureFieldAccessorsInitialized(
596 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
605 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
613 varIndex_ = emptyIntList();
614 coefficient_ = emptyDoubleList();
615 lowerBound_ = Double.NEGATIVE_INFINITY;
616 upperBound_ = Double.POSITIVE_INFINITY;
623 public com.google.protobuf.Descriptors.Descriptor
625 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
630 return com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance();
637 throw newUninitializedMessageException(result);
645 if (bitField0_ != 0) { buildPartial0(result); }
650 private void buildPartial0(com.google.ortools.linearsolver.MPConstraintProto result) {
651 int from_bitField0_ = bitField0_;
652 if (((from_bitField0_ & 0x00000001) != 0)) {
653 varIndex_.makeImmutable();
654 result.varIndex_ = varIndex_;
656 if (((from_bitField0_ & 0x00000002) != 0)) {
657 coefficient_.makeImmutable();
658 result.coefficient_ = coefficient_;
660 int to_bitField0_ = 0;
661 if (((from_bitField0_ & 0x00000004) != 0)) {
662 result.lowerBound_ = lowerBound_;
663 to_bitField0_ |= 0x00000001;
665 if (((from_bitField0_ & 0x00000008) != 0)) {
666 result.upperBound_ = upperBound_;
667 to_bitField0_ |= 0x00000002;
669 if (((from_bitField0_ & 0x00000010) != 0)) {
670 result.name_ = name_;
671 to_bitField0_ |= 0x00000004;
673 if (((from_bitField0_ & 0x00000020) != 0)) {
674 result.isLazy_ = isLazy_;
675 to_bitField0_ |= 0x00000008;
677 result.bitField0_ |= to_bitField0_;
681 public Builder
mergeFrom(com.google.protobuf.Message other) {
682 if (other instanceof com.google.ortools.linearsolver.MPConstraintProto) {
683 return mergeFrom((com.google.ortools.linearsolver.MPConstraintProto)other);
685 super.mergeFrom(other);
690 public Builder
mergeFrom(com.google.ortools.linearsolver.MPConstraintProto other) {
691 if (other == com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance())
return this;
692 if (!other.varIndex_.isEmpty()) {
693 if (varIndex_.isEmpty()) {
694 varIndex_ = other.varIndex_;
695 varIndex_.makeImmutable();
696 bitField0_ |= 0x00000001;
698 ensureVarIndexIsMutable();
699 varIndex_.addAll(other.varIndex_);
703 if (!other.coefficient_.isEmpty()) {
704 if (coefficient_.isEmpty()) {
705 coefficient_ = other.coefficient_;
706 coefficient_.makeImmutable();
707 bitField0_ |= 0x00000002;
709 ensureCoefficientIsMutable();
710 coefficient_.addAll(other.coefficient_);
714 if (other.hasLowerBound()) {
717 if (other.hasUpperBound()) {
720 if (other.hasName()) {
722 bitField0_ |= 0x00000010;
725 if (other.hasIsLazy()) {
728 this.mergeUnknownFields(other.getUnknownFields());
740 com.google.protobuf.CodedInputStream input,
741 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
742 throws java.io.IOException {
743 if (extensionRegistry ==
null) {
744 throw new java.lang.NullPointerException();
747 boolean done =
false;
749 int tag = input.readTag();
755 lowerBound_ = input.readDouble();
756 bitField0_ |= 0x00000004;
760 upperBound_ = input.readDouble();
761 bitField0_ |= 0x00000008;
765 name_ = input.readBytes();
766 bitField0_ |= 0x00000010;
770 isLazy_ = input.readBool();
771 bitField0_ |= 0x00000020;
775 int v = input.readInt32();
776 ensureVarIndexIsMutable();
781 int length = input.readRawVarint32();
782 int limit = input.pushLimit(length);
783 ensureVarIndexIsMutable();
784 while (input.getBytesUntilLimit() > 0) {
785 varIndex_.addInt(input.readInt32());
787 input.popLimit(limit);
791 double v = input.readDouble();
792 ensureCoefficientIsMutable();
793 coefficient_.addDouble(v);
797 int length = input.readRawVarint32();
798 int limit = input.pushLimit(length);
799 int alloc = length > 4096 ? 4096 : length;
800 ensureCoefficientIsMutable(alloc / 8);
801 while (input.getBytesUntilLimit() > 0) {
802 coefficient_.addDouble(input.readDouble());
804 input.popLimit(limit);
808 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
815 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
816 throw e.unwrapIOException();
822 private int bitField0_;
824 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
825 private void ensureVarIndexIsMutable() {
826 if (!varIndex_.isModifiable()) {
827 varIndex_ = makeMutableCopy(varIndex_);
829 bitField0_ |= 0x00000001;
842 public java.util.List<java.lang.Integer>
844 varIndex_.makeImmutable();
859 return varIndex_.size();
874 return varIndex_.getInt(index);
890 int index,
int value) {
892 ensureVarIndexIsMutable();
893 varIndex_.setInt(index, value);
894 bitField0_ |= 0x00000001;
912 ensureVarIndexIsMutable();
913 varIndex_.addInt(value);
914 bitField0_ |= 0x00000001;
931 java.lang.Iterable<? extends java.lang.Integer> values) {
932 ensureVarIndexIsMutable();
933 com.google.protobuf.AbstractMessageLite.Builder.addAll(
935 bitField0_ |= 0x00000001;
951 varIndex_ = emptyIntList();
952 bitField0_ = (bitField0_ & ~0x00000001);
957 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
958 private void ensureCoefficientIsMutable() {
959 if (!coefficient_.isModifiable()) {
960 coefficient_ = makeMutableCopy(coefficient_);
962 bitField0_ |= 0x00000002;
964 private void ensureCoefficientIsMutable(
int capacity) {
965 if (!coefficient_.isModifiable()) {
966 coefficient_ = makeMutableCopy(coefficient_, capacity);
968 bitField0_ |= 0x00000002;
978 public java.util.List<java.lang.Double>
980 coefficient_.makeImmutable();
992 return coefficient_.size();
1004 return coefficient_.getDouble(index);
1017 int index,
double value) {
1019 ensureCoefficientIsMutable();
1020 coefficient_.setDouble(index, value);
1021 bitField0_ |= 0x00000002;
1036 ensureCoefficientIsMutable();
1037 coefficient_.addDouble(value);
1038 bitField0_ |= 0x00000002;
1052 java.lang.Iterable<? extends java.lang.Double> values) {
1053 ensureCoefficientIsMutable();
1054 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1055 values, coefficient_);
1056 bitField0_ |= 0x00000002;
1069 coefficient_ = emptyDoubleList();
1070 bitField0_ = (bitField0_ & ~0x00000002);
1075 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1086 return ((bitField0_ & 0x00000004) != 0);
1111 lowerBound_ = value;
1112 bitField0_ |= 0x00000004;
1125 bitField0_ = (bitField0_ & ~0x00000004);
1126 lowerBound_ = Double.NEGATIVE_INFINITY;
1131 private double upperBound_ = Double.POSITIVE_INFINITY;
1138 return ((bitField0_ & 0x00000008) != 0);
1155 upperBound_ = value;
1156 bitField0_ |= 0x00000008;
1165 bitField0_ = (bitField0_ & ~0x00000008);
1166 upperBound_ = Double.POSITIVE_INFINITY;
1171 private java.lang.Object name_ =
"";
1181 return ((bitField0_ & 0x00000010) != 0);
1192 java.lang.Object ref = name_;
1193 if (!(ref instanceof java.lang.String)) {
1194 com.google.protobuf.ByteString bs =
1195 (com.google.protobuf.ByteString) ref;
1196 java.lang.String s = bs.toStringUtf8();
1197 if (bs.isValidUtf8()) {
1202 return (java.lang.String) ref;
1213 public com.google.protobuf.ByteString
1215 java.lang.Object ref = name_;
1216 if (ref instanceof String) {
1217 com.google.protobuf.ByteString b =
1218 com.google.protobuf.ByteString.copyFromUtf8(
1219 (java.lang.String) ref);
1223 return (com.google.protobuf.ByteString) ref;
1236 java.lang.String value) {
1237 if (value ==
null) {
throw new NullPointerException(); }
1239 bitField0_ |= 0x00000010;
1253 bitField0_ = (bitField0_ & ~0x00000010);
1267 com.google.protobuf.ByteString value) {
1268 if (value ==
null) {
throw new NullPointerException(); }
1270 bitField0_ |= 0x00000010;
1275 private boolean isLazy_ ;
1289 return ((bitField0_ & 0x00000020) != 0);
1321 bitField0_ |= 0x00000020;
1337 bitField0_ = (bitField0_ & ~0x00000020);
1349 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPConstraintProto();
1353 return DEFAULT_INSTANCE;
1360 com.google.protobuf.CodedInputStream input,
1361 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1362 throws com.google.protobuf.InvalidProtocolBufferException {
1365 builder.mergeFrom(input, extensionRegistry);
1366 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1367 throw e.setUnfinishedMessage(builder.buildPartial());
1368 }
catch (com.google.protobuf.UninitializedMessageException e) {
1369 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1370 }
catch (java.io.IOException e) {
1371 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1372 .setUnfinishedMessage(builder.buildPartial());
1374 return builder.buildPartial();
1378 public static com.google.protobuf.Parser<MPConstraintProto>
parser() {
1389 return DEFAULT_INSTANCE;