5package com.google.ortools.linearsolver;
25 com.google.protobuf.GeneratedMessage implements
28private static final long serialVersionUID = 0L;
30 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
31 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
39 private MPConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
43 varIndex_ = emptyIntList();
44 coefficient_ = emptyDoubleList();
45 lowerBound_ = Double.NEGATIVE_INFINITY;
46 upperBound_ = Double.POSITIVE_INFINITY;
50 public static final com.google.protobuf.Descriptors.Descriptor
52 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
56 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
58 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
59 .ensureFieldAccessorsInitialized(
60 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.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);
113 private int varIndexMemoizedSerializedSize = -1;
116 @SuppressWarnings(
"serial")
117 private com.google.protobuf.Internal.DoubleList coefficient_ =
128 public java.util.List<java.lang.Double>
141 return coefficient_.size();
153 return coefficient_.getDouble(index);
155 private int coefficientMemoizedSerializedSize = -1;
158 private double lowerBound_ = Double.NEGATIVE_INFINITY;
169 return ((bitField0_ & 0x00000001) != 0);
185 private double upperBound_ = Double.POSITIVE_INFINITY;
192 return ((bitField0_ & 0x00000002) != 0);
204 @SuppressWarnings(
"serial")
205 private volatile java.lang.Object name_ = "";
216 return ((bitField0_ & 0x00000004) != 0);
228 java.lang.Object ref = name_;
229 if (ref instanceof java.lang.String) {
230 return (java.lang.String) ref;
232 com.google.protobuf.ByteString bs =
233 (com.google.protobuf.ByteString) ref;
234 java.lang.String s = bs.toStringUtf8();
235 if (bs.isValidUtf8()) {
250 public com.google.protobuf.ByteString
252 java.lang.Object ref = name_;
253 if (ref instanceof java.lang.String) {
254 com.google.protobuf.ByteString b =
255 com.google.protobuf.ByteString.copyFromUtf8(
256 (java.lang.String) ref);
260 return (com.google.protobuf.ByteString) ref;
265 private boolean isLazy_ =
false;
279 return ((bitField0_ & 0x00000008) != 0);
297 private byte memoizedIsInitialized = -1;
304 memoizedIsInitialized = 1;
309 public void writeTo(com.google.protobuf.CodedOutputStream output)
310 throws java.io.IOException {
312 if (((bitField0_ & 0x00000001) != 0)) {
313 output.writeDouble(2, lowerBound_);
315 if (((bitField0_ & 0x00000002) != 0)) {
316 output.writeDouble(3, upperBound_);
318 if (((bitField0_ & 0x00000004) != 0)) {
319 com.google.protobuf.GeneratedMessage.writeString(output, 4, name_);
321 if (((bitField0_ & 0x00000008) != 0)) {
322 output.writeBool(5, isLazy_);
325 output.writeUInt32NoTag(50);
326 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
328 for (
int i = 0; i < varIndex_.size(); i++) {
329 output.writeInt32NoTag(varIndex_.getInt(i));
332 output.writeUInt32NoTag(58);
333 output.writeUInt32NoTag(coefficientMemoizedSerializedSize);
335 for (
int i = 0; i < coefficient_.size(); i++) {
336 output.writeDoubleNoTag(coefficient_.getDouble(i));
338 getUnknownFields().writeTo(output);
343 int size = memoizedSize;
344 if (size != -1)
return size;
347 if (((bitField0_ & 0x00000001) != 0)) {
348 size += com.google.protobuf.CodedOutputStream
349 .computeDoubleSize(2, lowerBound_);
351 if (((bitField0_ & 0x00000002) != 0)) {
352 size += com.google.protobuf.CodedOutputStream
353 .computeDoubleSize(3, upperBound_);
355 if (((bitField0_ & 0x00000004) != 0)) {
356 size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_);
358 if (((bitField0_ & 0x00000008) != 0)) {
359 size += com.google.protobuf.CodedOutputStream
360 .computeBoolSize(5, isLazy_);
364 for (
int i = 0; i < varIndex_.size(); i++) {
365 dataSize += com.google.protobuf.CodedOutputStream
366 .computeInt32SizeNoTag(varIndex_.getInt(i));
371 size += com.google.protobuf.CodedOutputStream
372 .computeInt32SizeNoTag(dataSize);
374 varIndexMemoizedSerializedSize = dataSize;
382 size += com.google.protobuf.CodedOutputStream
383 .computeInt32SizeNoTag(dataSize);
385 coefficientMemoizedSerializedSize = dataSize;
387 size += getUnknownFields().getSerializedSize();
393 public boolean equals(
final java.lang.Object obj) {
397 if (!(obj instanceof com.google.ortools.linearsolver.MPConstraintProto)) {
398 return super.equals(obj);
409 != java.lang.Double.doubleToLongBits(
415 != java.lang.Double.doubleToLongBits(
428 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
434 if (memoizedHashCode != 0) {
435 return memoizedHashCode;
449 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
454 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
459 hash = (53 * hash) +
getName().hashCode();
463 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
466 hash = (29 * hash) + getUnknownFields().hashCode();
467 memoizedHashCode = hash;
472 java.nio.ByteBuffer data)
473 throws com.google.protobuf.InvalidProtocolBufferException {
474 return PARSER.parseFrom(data);
477 java.nio.ByteBuffer data,
478 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
479 throws com.google.protobuf.InvalidProtocolBufferException {
480 return PARSER.parseFrom(data, extensionRegistry);
483 com.google.protobuf.ByteString data)
484 throws com.google.protobuf.InvalidProtocolBufferException {
485 return PARSER.parseFrom(data);
488 com.google.protobuf.ByteString data,
489 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
490 throws com.google.protobuf.InvalidProtocolBufferException {
491 return PARSER.parseFrom(data, extensionRegistry);
494 throws com.google.protobuf.InvalidProtocolBufferException {
495 return PARSER.parseFrom(data);
499 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
500 throws com.google.protobuf.InvalidProtocolBufferException {
501 return PARSER.parseFrom(data, extensionRegistry);
504 throws java.io.IOException {
505 return com.google.protobuf.GeneratedMessage
506 .parseWithIOException(PARSER, input);
509 java.io.InputStream input,
510 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
511 throws java.io.IOException {
512 return com.google.protobuf.GeneratedMessage
513 .parseWithIOException(PARSER, input, extensionRegistry);
517 throws java.io.IOException {
518 return com.google.protobuf.GeneratedMessage
519 .parseDelimitedWithIOException(PARSER, input);
523 java.io.InputStream input,
524 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
525 throws java.io.IOException {
526 return com.google.protobuf.GeneratedMessage
527 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
530 com.google.protobuf.CodedInputStream input)
531 throws java.io.IOException {
532 return com.google.protobuf.GeneratedMessage
533 .parseWithIOException(PARSER, input);
536 com.google.protobuf.CodedInputStream input,
537 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
538 throws java.io.IOException {
539 return com.google.protobuf.GeneratedMessage
540 .parseWithIOException(PARSER, input, extensionRegistry);
553 return this == DEFAULT_INSTANCE
559 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
581 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
584 public static final com.google.protobuf.Descriptors.Descriptor
586 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
590 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
592 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
593 .ensureFieldAccessorsInitialized(
594 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
603 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
611 varIndex_ = emptyIntList();
612 coefficient_ = emptyDoubleList();
613 lowerBound_ = Double.NEGATIVE_INFINITY;
614 upperBound_ = Double.POSITIVE_INFINITY;
621 public com.google.protobuf.Descriptors.Descriptor
623 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
628 return com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance();
635 throw newUninitializedMessageException(result);
643 if (bitField0_ != 0) { buildPartial0(result); }
648 private void buildPartial0(com.google.ortools.linearsolver.MPConstraintProto result) {
649 int from_bitField0_ = bitField0_;
650 if (((from_bitField0_ & 0x00000001) != 0)) {
651 varIndex_.makeImmutable();
652 result.varIndex_ = varIndex_;
654 if (((from_bitField0_ & 0x00000002) != 0)) {
655 coefficient_.makeImmutable();
656 result.coefficient_ = coefficient_;
658 int to_bitField0_ = 0;
659 if (((from_bitField0_ & 0x00000004) != 0)) {
660 result.lowerBound_ = lowerBound_;
661 to_bitField0_ |= 0x00000001;
663 if (((from_bitField0_ & 0x00000008) != 0)) {
664 result.upperBound_ = upperBound_;
665 to_bitField0_ |= 0x00000002;
667 if (((from_bitField0_ & 0x00000010) != 0)) {
668 result.name_ = name_;
669 to_bitField0_ |= 0x00000004;
671 if (((from_bitField0_ & 0x00000020) != 0)) {
672 result.isLazy_ = isLazy_;
673 to_bitField0_ |= 0x00000008;
675 result.bitField0_ |= to_bitField0_;
680 if (other instanceof com.google.ortools.linearsolver.MPConstraintProto) {
681 return mergeFrom((com.google.ortools.linearsolver.MPConstraintProto)other);
683 super.mergeFrom(other);
689 if (other == com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance())
return this;
690 if (!other.varIndex_.isEmpty()) {
691 if (varIndex_.isEmpty()) {
692 varIndex_ = other.varIndex_;
693 varIndex_.makeImmutable();
694 bitField0_ |= 0x00000001;
696 ensureVarIndexIsMutable();
697 varIndex_.addAll(other.varIndex_);
701 if (!other.coefficient_.isEmpty()) {
702 if (coefficient_.isEmpty()) {
703 coefficient_ = other.coefficient_;
704 coefficient_.makeImmutable();
705 bitField0_ |= 0x00000002;
707 ensureCoefficientIsMutable();
708 coefficient_.addAll(other.coefficient_);
712 if (other.hasLowerBound()) {
715 if (other.hasUpperBound()) {
718 if (other.hasName()) {
720 bitField0_ |= 0x00000010;
723 if (other.hasIsLazy()) {
726 this.mergeUnknownFields(other.getUnknownFields());
738 com.google.protobuf.CodedInputStream input,
739 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
740 throws java.io.IOException {
741 if (extensionRegistry ==
null) {
742 throw new java.lang.NullPointerException();
745 boolean done =
false;
747 int tag = input.readTag();
753 lowerBound_ = input.readDouble();
754 bitField0_ |= 0x00000004;
758 upperBound_ = input.readDouble();
759 bitField0_ |= 0x00000008;
763 name_ = input.readBytes();
764 bitField0_ |= 0x00000010;
768 isLazy_ = input.readBool();
769 bitField0_ |= 0x00000020;
773 int v = input.readInt32();
774 ensureVarIndexIsMutable();
779 int length = input.readRawVarint32();
780 int limit = input.pushLimit(length);
781 ensureVarIndexIsMutable();
782 while (input.getBytesUntilLimit() > 0) {
783 varIndex_.addInt(input.readInt32());
785 input.popLimit(limit);
789 double v = input.readDouble();
790 ensureCoefficientIsMutable();
791 coefficient_.addDouble(v);
795 int length = input.readRawVarint32();
796 int limit = input.pushLimit(length);
797 int alloc = length > 4096 ? 4096 : length;
798 ensureCoefficientIsMutable(alloc / 8);
799 while (input.getBytesUntilLimit() > 0) {
800 coefficient_.addDouble(input.readDouble());
802 input.popLimit(limit);
806 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
813 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
814 throw e.unwrapIOException();
820 private int bitField0_;
822 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
823 private void ensureVarIndexIsMutable() {
824 if (!varIndex_.isModifiable()) {
825 varIndex_ = makeMutableCopy(varIndex_);
827 bitField0_ |= 0x00000001;
840 public java.util.List<java.lang.Integer>
842 varIndex_.makeImmutable();
857 return varIndex_.size();
872 return varIndex_.getInt(index);
888 int index,
int value) {
890 ensureVarIndexIsMutable();
891 varIndex_.setInt(index, value);
892 bitField0_ |= 0x00000001;
910 ensureVarIndexIsMutable();
911 varIndex_.addInt(value);
912 bitField0_ |= 0x00000001;
929 java.lang.Iterable<? extends java.lang.Integer> values) {
930 ensureVarIndexIsMutable();
931 com.google.protobuf.AbstractMessageLite.Builder.addAll(
933 bitField0_ |= 0x00000001;
949 varIndex_ = emptyIntList();
950 bitField0_ = (bitField0_ & ~0x00000001);
955 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
956 private void ensureCoefficientIsMutable() {
957 if (!coefficient_.isModifiable()) {
958 coefficient_ = makeMutableCopy(coefficient_);
960 bitField0_ |= 0x00000002;
962 private void ensureCoefficientIsMutable(
int capacity) {
963 if (!coefficient_.isModifiable()) {
964 coefficient_ = makeMutableCopy(coefficient_, capacity);
966 bitField0_ |= 0x00000002;
976 public java.util.List<java.lang.Double>
978 coefficient_.makeImmutable();
990 return coefficient_.size();
1002 return coefficient_.getDouble(index);
1015 int index,
double value) {
1017 ensureCoefficientIsMutable();
1018 coefficient_.setDouble(index, value);
1019 bitField0_ |= 0x00000002;
1034 ensureCoefficientIsMutable();
1035 coefficient_.addDouble(value);
1036 bitField0_ |= 0x00000002;
1050 java.lang.Iterable<? extends java.lang.Double> values) {
1051 ensureCoefficientIsMutable();
1052 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1053 values, coefficient_);
1054 bitField0_ |= 0x00000002;
1067 coefficient_ = emptyDoubleList();
1068 bitField0_ = (bitField0_ & ~0x00000002);
1073 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1084 return ((bitField0_ & 0x00000004) != 0);
1109 lowerBound_ = value;
1110 bitField0_ |= 0x00000004;
1123 bitField0_ = (bitField0_ & ~0x00000004);
1124 lowerBound_ = Double.NEGATIVE_INFINITY;
1129 private double upperBound_ = Double.POSITIVE_INFINITY;
1136 return ((bitField0_ & 0x00000008) != 0);
1153 upperBound_ = value;
1154 bitField0_ |= 0x00000008;
1163 bitField0_ = (bitField0_ & ~0x00000008);
1164 upperBound_ = Double.POSITIVE_INFINITY;
1169 private java.lang.Object name_ =
"";
1179 return ((bitField0_ & 0x00000010) != 0);
1190 java.lang.Object ref = name_;
1191 if (!(ref instanceof java.lang.String)) {
1192 com.google.protobuf.ByteString bs =
1193 (com.google.protobuf.ByteString) ref;
1194 java.lang.String s = bs.toStringUtf8();
1195 if (bs.isValidUtf8()) {
1200 return (java.lang.String) ref;
1211 public com.google.protobuf.ByteString
1213 java.lang.Object ref = name_;
1214 if (ref instanceof String) {
1215 com.google.protobuf.ByteString b =
1216 com.google.protobuf.ByteString.copyFromUtf8(
1217 (java.lang.String) ref);
1221 return (com.google.protobuf.ByteString) ref;
1234 java.lang.String value) {
1235 if (value ==
null) {
throw new NullPointerException(); }
1237 bitField0_ |= 0x00000010;
1251 bitField0_ = (bitField0_ & ~0x00000010);
1265 com.google.protobuf.ByteString value) {
1266 if (value ==
null) {
throw new NullPointerException(); }
1268 bitField0_ |= 0x00000010;
1273 private boolean isLazy_ ;
1287 return ((bitField0_ & 0x00000020) != 0);
1319 bitField0_ |= 0x00000020;
1335 bitField0_ = (bitField0_ & ~0x00000020);
1347 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPConstraintProto();
1351 return DEFAULT_INSTANCE;
1358 com.google.protobuf.CodedInputStream input,
1359 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1360 throws com.google.protobuf.InvalidProtocolBufferException {
1363 builder.mergeFrom(input, extensionRegistry);
1364 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1365 throw e.setUnfinishedMessage(builder.buildPartial());
1366 }
catch (com.google.protobuf.UninitializedMessageException e) {
1367 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1368 }
catch (java.io.IOException e) {
1369 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1370 .setUnfinishedMessage(builder.buildPartial());
1372 return builder.buildPartial();
1387 return DEFAULT_INSTANCE;