6package com.google.ortools.linearsolver;
25public final class MPConstraintProto
extends
26 com.google.protobuf.GeneratedMessage implements
29private static final long serialVersionUID = 0L;
31 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
32 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
37 MPConstraintProto.class.getName());
40 private MPConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
43 private MPConstraintProto() {
44 varIndex_ = emptyIntList();
45 coefficient_ = emptyDoubleList();
46 lowerBound_ = Double.NEGATIVE_INFINITY;
47 upperBound_ = Double.POSITIVE_INFINITY;
51 public static final com.google.protobuf.Descriptors.Descriptor
53 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
57 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
59 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
60 .ensureFieldAccessorsInitialized(
61 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
64 private int bitField0_;
66 @SuppressWarnings(
"serial")
67 private com.google.protobuf.Internal.IntList varIndex_ =
81 public java.
util.List<java.lang.Integer>
97 return varIndex_.size();
112 return varIndex_.getInt(index);
114 private int varIndexMemoizedSerializedSize = -1;
117 @SuppressWarnings(
"serial")
118 private com.google.protobuf.Internal.DoubleList coefficient_ =
129 public java.
util.List<java.lang.Double>
142 return coefficient_.size();
154 return coefficient_.getDouble(index);
156 private int coefficientMemoizedSerializedSize = -1;
159 private double lowerBound_ = Double.NEGATIVE_INFINITY;
170 return ((bitField0_ & 0x00000001) != 0);
186 private double upperBound_ = Double.POSITIVE_INFINITY;
193 return ((bitField0_ & 0x00000002) != 0);
205 @SuppressWarnings(
"serial")
206 private volatile java.lang.Object name_ =
"";
217 return ((bitField0_ & 0x00000004) != 0);
229 java.lang.Object ref = name_;
230 if (ref instanceof java.lang.String) {
231 return (java.lang.String) ref;
233 com.google.protobuf.ByteString bs =
234 (com.google.protobuf.ByteString) ref;
235 java.lang.String s = bs.toStringUtf8();
236 if (bs.isValidUtf8()) {
251 public com.google.protobuf.ByteString
253 java.lang.Object ref = name_;
254 if (ref instanceof java.lang.String) {
255 com.google.protobuf.ByteString b =
256 com.google.protobuf.ByteString.copyFromUtf8(
257 (java.lang.String) ref);
261 return (com.google.protobuf.ByteString) ref;
266 private boolean isLazy_ =
false;
280 return ((bitField0_ & 0x00000008) != 0);
298 private byte memoizedIsInitialized = -1;
305 memoizedIsInitialized = 1;
310 public void writeTo(com.google.protobuf.CodedOutputStream output)
311 throws java.io.IOException {
313 if (((bitField0_ & 0x00000001) != 0)) {
314 output.writeDouble(2, lowerBound_);
316 if (((bitField0_ & 0x00000002) != 0)) {
317 output.writeDouble(3, upperBound_);
319 if (((bitField0_ & 0x00000004) != 0)) {
320 com.google.protobuf.GeneratedMessage.writeString(output, 4, name_);
322 if (((bitField0_ & 0x00000008) != 0)) {
323 output.writeBool(5, isLazy_);
326 output.writeUInt32NoTag(50);
327 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
329 for (
int i = 0; i < varIndex_.size(); i++) {
330 output.writeInt32NoTag(varIndex_.getInt(i));
333 output.writeUInt32NoTag(58);
334 output.writeUInt32NoTag(coefficientMemoizedSerializedSize);
336 for (
int i = 0; i < coefficient_.size(); i++) {
337 output.writeDoubleNoTag(coefficient_.getDouble(i));
339 getUnknownFields().writeTo(output);
344 int size = memoizedSize;
345 if (size != -1)
return size;
348 if (((bitField0_ & 0x00000001) != 0)) {
349 size += com.google.protobuf.CodedOutputStream
350 .computeDoubleSize(2, lowerBound_);
352 if (((bitField0_ & 0x00000002) != 0)) {
353 size += com.google.protobuf.CodedOutputStream
354 .computeDoubleSize(3, upperBound_);
356 if (((bitField0_ & 0x00000004) != 0)) {
357 size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_);
359 if (((bitField0_ & 0x00000008) != 0)) {
360 size += com.google.protobuf.CodedOutputStream
361 .computeBoolSize(5, isLazy_);
365 for (
int i = 0; i < varIndex_.size(); i++) {
366 dataSize += com.google.protobuf.CodedOutputStream
367 .computeInt32SizeNoTag(varIndex_.getInt(i));
372 size += com.google.protobuf.CodedOutputStream
373 .computeInt32SizeNoTag(dataSize);
375 varIndexMemoizedSerializedSize = dataSize;
383 size += com.google.protobuf.CodedOutputStream
384 .computeInt32SizeNoTag(dataSize);
386 coefficientMemoizedSerializedSize = dataSize;
388 size += getUnknownFields().getSerializedSize();
394 public boolean equals(
final java.lang.Object obj) {
398 if (!(obj instanceof com.google.ortools.linearsolver.MPConstraintProto)) {
399 return super.equals(obj);
410 != java.lang.Double.doubleToLongBits(
416 != java.lang.Double.doubleToLongBits(
429 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
435 if (memoizedHashCode != 0) {
436 return memoizedHashCode;
450 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
455 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
460 hash = (53 * hash) +
getName().hashCode();
464 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
467 hash = (29 * hash) + getUnknownFields().hashCode();
468 memoizedHashCode = hash;
473 java.nio.ByteBuffer data)
474 throws com.google.protobuf.InvalidProtocolBufferException {
475 return PARSER.parseFrom(data);
478 java.nio.ByteBuffer data,
479 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
480 throws com.google.protobuf.InvalidProtocolBufferException {
481 return PARSER.parseFrom(data, extensionRegistry);
484 com.google.protobuf.ByteString data)
485 throws com.google.protobuf.InvalidProtocolBufferException {
486 return PARSER.parseFrom(data);
489 com.google.protobuf.ByteString data,
490 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
491 throws com.google.protobuf.InvalidProtocolBufferException {
492 return PARSER.parseFrom(data, extensionRegistry);
495 throws com.google.protobuf.InvalidProtocolBufferException {
496 return PARSER.parseFrom(data);
500 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
501 throws com.google.protobuf.InvalidProtocolBufferException {
502 return PARSER.parseFrom(data, extensionRegistry);
505 throws java.io.IOException {
506 return com.google.protobuf.GeneratedMessage
507 .parseWithIOException(PARSER, input);
510 java.io.InputStream input,
511 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
512 throws java.io.IOException {
513 return com.google.protobuf.GeneratedMessage
514 .parseWithIOException(PARSER, input, extensionRegistry);
518 throws java.io.IOException {
519 return com.google.protobuf.GeneratedMessage
520 .parseDelimitedWithIOException(PARSER, input);
524 java.io.InputStream input,
525 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
526 throws java.io.IOException {
527 return com.google.protobuf.GeneratedMessage
528 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
531 com.google.protobuf.CodedInputStream input)
532 throws java.io.IOException {
533 return com.google.protobuf.GeneratedMessage
534 .parseWithIOException(PARSER, input);
537 com.google.protobuf.CodedInputStream input,
538 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
539 throws java.io.IOException {
540 return com.google.protobuf.GeneratedMessage
541 .parseWithIOException(PARSER, input, extensionRegistry);
547 return DEFAULT_INSTANCE.toBuilder();
550 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
554 return this == DEFAULT_INSTANCE
560 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
581 public static final class Builder
extends
582 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
585 public static final com.google.protobuf.Descriptors.Descriptor
587 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
591 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
593 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
594 .ensureFieldAccessorsInitialized(
595 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
604 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
612 varIndex_ = emptyIntList();
613 coefficient_ = emptyDoubleList();
614 lowerBound_ = Double.NEGATIVE_INFINITY;
615 upperBound_ = Double.POSITIVE_INFINITY;
622 public com.google.protobuf.Descriptors.Descriptor
624 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
629 return com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance();
636 throw newUninitializedMessageException(result);
644 if (bitField0_ != 0) { buildPartial0(result); }
649 private void buildPartial0(com.google.ortools.linearsolver.MPConstraintProto result) {
650 int from_bitField0_ = bitField0_;
651 if (((from_bitField0_ & 0x00000001) != 0)) {
652 varIndex_.makeImmutable();
653 result.varIndex_ = varIndex_;
655 if (((from_bitField0_ & 0x00000002) != 0)) {
656 coefficient_.makeImmutable();
657 result.coefficient_ = coefficient_;
659 int to_bitField0_ = 0;
660 if (((from_bitField0_ & 0x00000004) != 0)) {
661 result.lowerBound_ = lowerBound_;
662 to_bitField0_ |= 0x00000001;
664 if (((from_bitField0_ & 0x00000008) != 0)) {
665 result.upperBound_ = upperBound_;
666 to_bitField0_ |= 0x00000002;
668 if (((from_bitField0_ & 0x00000010) != 0)) {
669 result.name_ = name_;
670 to_bitField0_ |= 0x00000004;
672 if (((from_bitField0_ & 0x00000020) != 0)) {
673 result.isLazy_ = isLazy_;
674 to_bitField0_ |= 0x00000008;
676 result.bitField0_ |= to_bitField0_;
680 public Builder
mergeFrom(com.google.protobuf.Message other) {
681 if (other instanceof com.google.ortools.linearsolver.MPConstraintProto) {
682 return mergeFrom((com.google.ortools.linearsolver.MPConstraintProto)other);
684 super.mergeFrom(other);
689 public Builder
mergeFrom(com.google.ortools.linearsolver.MPConstraintProto other) {
690 if (other == com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance())
return this;
691 if (!other.varIndex_.isEmpty()) {
692 if (varIndex_.isEmpty()) {
693 varIndex_ = other.varIndex_;
694 varIndex_.makeImmutable();
695 bitField0_ |= 0x00000001;
697 ensureVarIndexIsMutable();
698 varIndex_.addAll(other.varIndex_);
702 if (!other.coefficient_.isEmpty()) {
703 if (coefficient_.isEmpty()) {
704 coefficient_ = other.coefficient_;
705 coefficient_.makeImmutable();
706 bitField0_ |= 0x00000002;
708 ensureCoefficientIsMutable();
709 coefficient_.addAll(other.coefficient_);
713 if (other.hasLowerBound()) {
716 if (other.hasUpperBound()) {
719 if (other.hasName()) {
721 bitField0_ |= 0x00000010;
724 if (other.hasIsLazy()) {
727 this.mergeUnknownFields(other.getUnknownFields());
739 com.google.protobuf.CodedInputStream input,
740 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
741 throws java.io.IOException {
742 if (extensionRegistry ==
null) {
743 throw new java.lang.NullPointerException();
746 boolean done =
false;
748 int tag = input.readTag();
754 lowerBound_ = input.readDouble();
755 bitField0_ |= 0x00000004;
759 upperBound_ = input.readDouble();
760 bitField0_ |= 0x00000008;
764 name_ = input.readBytes();
765 bitField0_ |= 0x00000010;
769 isLazy_ = input.readBool();
770 bitField0_ |= 0x00000020;
774 int v = input.readInt32();
775 ensureVarIndexIsMutable();
780 int length = input.readRawVarint32();
781 int limit = input.pushLimit(length);
782 ensureVarIndexIsMutable();
783 while (input.getBytesUntilLimit() > 0) {
784 varIndex_.addInt(input.readInt32());
786 input.popLimit(limit);
790 double v = input.readDouble();
791 ensureCoefficientIsMutable();
792 coefficient_.addDouble(v);
796 int length = input.readRawVarint32();
797 int limit = input.pushLimit(length);
798 int alloc = length > 4096 ? 4096 : length;
799 ensureCoefficientIsMutable(alloc / 8);
800 while (input.getBytesUntilLimit() > 0) {
801 coefficient_.addDouble(input.readDouble());
803 input.popLimit(limit);
807 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
814 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
815 throw e.unwrapIOException();
821 private int bitField0_;
823 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
824 private void ensureVarIndexIsMutable() {
825 if (!varIndex_.isModifiable()) {
826 varIndex_ = makeMutableCopy(varIndex_);
828 bitField0_ |= 0x00000001;
841 public java.util.List<java.lang.Integer>
843 varIndex_.makeImmutable();
858 return varIndex_.size();
873 return varIndex_.getInt(index);
889 int index,
int value) {
891 ensureVarIndexIsMutable();
892 varIndex_.setInt(index, value);
893 bitField0_ |= 0x00000001;
911 ensureVarIndexIsMutable();
912 varIndex_.addInt(value);
913 bitField0_ |= 0x00000001;
930 java.lang.Iterable<? extends java.lang.Integer> values) {
931 ensureVarIndexIsMutable();
932 com.google.protobuf.AbstractMessageLite.Builder.addAll(
934 bitField0_ |= 0x00000001;
950 varIndex_ = emptyIntList();
951 bitField0_ = (bitField0_ & ~0x00000001);
956 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
957 private void ensureCoefficientIsMutable() {
958 if (!coefficient_.isModifiable()) {
959 coefficient_ = makeMutableCopy(coefficient_);
961 bitField0_ |= 0x00000002;
963 private void ensureCoefficientIsMutable(
int capacity) {
964 if (!coefficient_.isModifiable()) {
965 coefficient_ = makeMutableCopy(coefficient_, capacity);
967 bitField0_ |= 0x00000002;
977 public java.util.List<java.lang.Double>
979 coefficient_.makeImmutable();
991 return coefficient_.size();
1003 return coefficient_.getDouble(index);
1016 int index,
double value) {
1018 ensureCoefficientIsMutable();
1019 coefficient_.setDouble(index, value);
1020 bitField0_ |= 0x00000002;
1035 ensureCoefficientIsMutable();
1036 coefficient_.addDouble(value);
1037 bitField0_ |= 0x00000002;
1051 java.lang.Iterable<? extends java.lang.Double> values) {
1052 ensureCoefficientIsMutable();
1053 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1054 values, coefficient_);
1055 bitField0_ |= 0x00000002;
1068 coefficient_ = emptyDoubleList();
1069 bitField0_ = (bitField0_ & ~0x00000002);
1074 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1085 return ((bitField0_ & 0x00000004) != 0);
1110 lowerBound_ = value;
1111 bitField0_ |= 0x00000004;
1124 bitField0_ = (bitField0_ & ~0x00000004);
1125 lowerBound_ = Double.NEGATIVE_INFINITY;
1130 private double upperBound_ = Double.POSITIVE_INFINITY;
1137 return ((bitField0_ & 0x00000008) != 0);
1154 upperBound_ = value;
1155 bitField0_ |= 0x00000008;
1164 bitField0_ = (bitField0_ & ~0x00000008);
1165 upperBound_ = Double.POSITIVE_INFINITY;
1170 private java.lang.Object name_ =
"";
1180 return ((bitField0_ & 0x00000010) != 0);
1191 java.lang.Object ref = name_;
1192 if (!(ref instanceof java.lang.String)) {
1193 com.google.protobuf.ByteString bs =
1194 (com.google.protobuf.ByteString) ref;
1195 java.lang.String s = bs.toStringUtf8();
1196 if (bs.isValidUtf8()) {
1201 return (java.lang.String) ref;
1212 public com.google.protobuf.ByteString
1214 java.lang.Object ref = name_;
1215 if (ref instanceof String) {
1216 com.google.protobuf.ByteString b =
1217 com.google.protobuf.ByteString.copyFromUtf8(
1218 (java.lang.String) ref);
1222 return (com.google.protobuf.ByteString) ref;
1235 java.lang.String value) {
1236 if (value ==
null) {
throw new NullPointerException(); }
1238 bitField0_ |= 0x00000010;
1252 bitField0_ = (bitField0_ & ~0x00000010);
1266 com.google.protobuf.ByteString value) {
1267 if (value ==
null) {
throw new NullPointerException(); }
1269 bitField0_ |= 0x00000010;
1274 private boolean isLazy_ ;
1288 return ((bitField0_ & 0x00000020) != 0);
1320 bitField0_ |= 0x00000020;
1336 bitField0_ = (bitField0_ & ~0x00000020);
1348 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPConstraintProto();
1352 return DEFAULT_INSTANCE;
1359 com.google.protobuf.CodedInputStream input,
1360 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1361 throws com.google.protobuf.InvalidProtocolBufferException {
1364 builder.mergeFrom(input, extensionRegistry);
1365 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1366 throw e.setUnfinishedMessage(builder.buildPartial());
1367 }
catch (com.google.protobuf.UninitializedMessageException e) {
1368 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1369 }
catch (java.io.IOException e) {
1370 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1371 .setUnfinishedMessage(builder.buildPartial());
1373 return builder.buildPartial();
1377 public static com.google.protobuf.Parser<MPConstraintProto>
parser() {
1388 return DEFAULT_INSTANCE;