5package com.google.ortools.linearsolver;
25 com.google.protobuf.GeneratedMessageV3 implements
28private static final long serialVersionUID = 0L;
30 private MPConstraintProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
34 varIndex_ = emptyIntList();
35 coefficient_ = emptyDoubleList();
36 lowerBound_ = Double.NEGATIVE_INFINITY;
37 upperBound_ = Double.POSITIVE_INFINITY;
42 @SuppressWarnings({
"unused"})
44 UnusedPrivateParameter unused) {
48 public static final com.google.protobuf.Descriptors.Descriptor
50 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
54 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
56 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
57 .ensureFieldAccessorsInitialized(
58 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
61 private int bitField0_;
63 @SuppressWarnings(
"serial")
64 private com.google.protobuf.Internal.IntList varIndex_ =
78 public java.util.List<java.lang.Integer>
94 return varIndex_.size();
109 return varIndex_.getInt(index);
111 private int varIndexMemoizedSerializedSize = -1;
114 @SuppressWarnings(
"serial")
115 private com.google.protobuf.Internal.DoubleList coefficient_ =
126 public java.util.List<java.lang.Double>
139 return coefficient_.size();
151 return coefficient_.getDouble(index);
153 private int coefficientMemoizedSerializedSize = -1;
156 private double lowerBound_ = Double.NEGATIVE_INFINITY;
167 return ((bitField0_ & 0x00000001) != 0);
183 private double upperBound_ = Double.POSITIVE_INFINITY;
190 return ((bitField0_ & 0x00000002) != 0);
202 @SuppressWarnings(
"serial")
203 private volatile java.lang.Object name_ = "";
214 return ((bitField0_ & 0x00000004) != 0);
226 java.lang.Object ref = name_;
227 if (ref instanceof java.lang.String) {
228 return (java.lang.String) ref;
230 com.google.protobuf.ByteString bs =
231 (com.google.protobuf.ByteString) ref;
232 java.lang.String s = bs.toStringUtf8();
233 if (bs.isValidUtf8()) {
248 public com.google.protobuf.ByteString
250 java.lang.Object ref = name_;
251 if (ref instanceof java.lang.String) {
252 com.google.protobuf.ByteString b =
253 com.google.protobuf.ByteString.copyFromUtf8(
254 (java.lang.String) ref);
258 return (com.google.protobuf.ByteString) ref;
263 private boolean isLazy_ =
false;
277 return ((bitField0_ & 0x00000008) != 0);
295 private byte memoizedIsInitialized = -1;
302 memoizedIsInitialized = 1;
307 public void writeTo(com.google.protobuf.CodedOutputStream output)
308 throws java.io.IOException {
310 if (((bitField0_ & 0x00000001) != 0)) {
311 output.writeDouble(2, lowerBound_);
313 if (((bitField0_ & 0x00000002) != 0)) {
314 output.writeDouble(3, upperBound_);
316 if (((bitField0_ & 0x00000004) != 0)) {
317 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_);
319 if (((bitField0_ & 0x00000008) != 0)) {
320 output.writeBool(5, isLazy_);
323 output.writeUInt32NoTag(50);
324 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
326 for (
int i = 0; i < varIndex_.size(); i++) {
327 output.writeInt32NoTag(varIndex_.getInt(i));
330 output.writeUInt32NoTag(58);
331 output.writeUInt32NoTag(coefficientMemoizedSerializedSize);
333 for (
int i = 0; i < coefficient_.size(); i++) {
334 output.writeDoubleNoTag(coefficient_.getDouble(i));
336 getUnknownFields().writeTo(output);
341 int size = memoizedSize;
342 if (size != -1)
return size;
345 if (((bitField0_ & 0x00000001) != 0)) {
346 size += com.google.protobuf.CodedOutputStream
347 .computeDoubleSize(2, lowerBound_);
349 if (((bitField0_ & 0x00000002) != 0)) {
350 size += com.google.protobuf.CodedOutputStream
351 .computeDoubleSize(3, upperBound_);
353 if (((bitField0_ & 0x00000004) != 0)) {
354 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_);
356 if (((bitField0_ & 0x00000008) != 0)) {
357 size += com.google.protobuf.CodedOutputStream
358 .computeBoolSize(5, isLazy_);
362 for (
int i = 0; i < varIndex_.size(); i++) {
363 dataSize += com.google.protobuf.CodedOutputStream
364 .computeInt32SizeNoTag(varIndex_.getInt(i));
369 size += com.google.protobuf.CodedOutputStream
370 .computeInt32SizeNoTag(dataSize);
372 varIndexMemoizedSerializedSize = dataSize;
380 size += com.google.protobuf.CodedOutputStream
381 .computeInt32SizeNoTag(dataSize);
383 coefficientMemoizedSerializedSize = dataSize;
385 size += getUnknownFields().getSerializedSize();
391 public boolean equals(
final java.lang.Object obj) {
395 if (!(obj instanceof com.google.ortools.linearsolver.MPConstraintProto)) {
396 return super.equals(obj);
407 != java.lang.Double.doubleToLongBits(
413 != java.lang.Double.doubleToLongBits(
419 .equals(other.
getName()))
return false;
426 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
432 if (memoizedHashCode != 0) {
433 return memoizedHashCode;
447 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
452 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
457 hash = (53 * hash) +
getName().hashCode();
461 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
464 hash = (29 * hash) + getUnknownFields().hashCode();
465 memoizedHashCode = hash;
470 java.nio.ByteBuffer data)
471 throws com.google.protobuf.InvalidProtocolBufferException {
475 java.nio.ByteBuffer data,
476 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
477 throws com.google.protobuf.InvalidProtocolBufferException {
481 com.google.protobuf.ByteString data)
482 throws com.google.protobuf.InvalidProtocolBufferException {
486 com.google.protobuf.ByteString data,
487 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
488 throws com.google.protobuf.InvalidProtocolBufferException {
492 throws com.google.protobuf.InvalidProtocolBufferException {
497 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
498 throws com.google.protobuf.InvalidProtocolBufferException {
502 throws java.io.IOException {
503 return com.google.protobuf.GeneratedMessageV3
504 .parseWithIOException(
PARSER, input);
507 java.io.InputStream input,
508 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
509 throws java.io.IOException {
510 return com.google.protobuf.GeneratedMessageV3
511 .parseWithIOException(
PARSER, input, extensionRegistry);
515 throws java.io.IOException {
516 return com.google.protobuf.GeneratedMessageV3
517 .parseDelimitedWithIOException(
PARSER, input);
521 java.io.InputStream input,
522 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
523 throws java.io.IOException {
524 return com.google.protobuf.GeneratedMessageV3
525 .parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
528 com.google.protobuf.CodedInputStream input)
529 throws java.io.IOException {
530 return com.google.protobuf.GeneratedMessageV3
531 .parseWithIOException(
PARSER, input);
534 com.google.protobuf.CodedInputStream input,
535 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
536 throws java.io.IOException {
537 return com.google.protobuf.GeneratedMessageV3
538 .parseWithIOException(
PARSER, input, extensionRegistry);
551 return this == DEFAULT_INSTANCE
557 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
579 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
582 public static final com.google.protobuf.Descriptors.Descriptor
584 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
588 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
590 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
591 .ensureFieldAccessorsInitialized(
592 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
601 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
609 varIndex_ = emptyIntList();
610 coefficient_ = emptyDoubleList();
611 lowerBound_ = Double.NEGATIVE_INFINITY;
612 upperBound_ = Double.POSITIVE_INFINITY;
619 public com.google.protobuf.Descriptors.Descriptor
621 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
626 return com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance();
633 throw newUninitializedMessageException(result);
641 if (bitField0_ != 0) { buildPartial0(result); }
646 private void buildPartial0(com.google.ortools.linearsolver.MPConstraintProto result) {
647 int from_bitField0_ = bitField0_;
648 if (((from_bitField0_ & 0x00000001) != 0)) {
649 varIndex_.makeImmutable();
650 result.varIndex_ = varIndex_;
652 if (((from_bitField0_ & 0x00000002) != 0)) {
653 coefficient_.makeImmutable();
654 result.coefficient_ = coefficient_;
656 int to_bitField0_ = 0;
657 if (((from_bitField0_ & 0x00000004) != 0)) {
658 result.lowerBound_ = lowerBound_;
659 to_bitField0_ |= 0x00000001;
661 if (((from_bitField0_ & 0x00000008) != 0)) {
662 result.upperBound_ = upperBound_;
663 to_bitField0_ |= 0x00000002;
665 if (((from_bitField0_ & 0x00000010) != 0)) {
666 result.name_ = name_;
667 to_bitField0_ |= 0x00000004;
669 if (((from_bitField0_ & 0x00000020) != 0)) {
670 result.isLazy_ = isLazy_;
671 to_bitField0_ |= 0x00000008;
673 result.bitField0_ |= to_bitField0_;
678 return super.
clone();
682 com.google.protobuf.Descriptors.FieldDescriptor field,
683 java.lang.Object value) {
684 return super.
setField(field, value);
688 com.google.protobuf.Descriptors.FieldDescriptor field) {
693 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
698 com.google.protobuf.Descriptors.FieldDescriptor field,
699 int index, java.lang.Object value) {
704 com.google.protobuf.Descriptors.FieldDescriptor field,
705 java.lang.Object value) {
710 if (other instanceof com.google.ortools.linearsolver.MPConstraintProto) {
711 return mergeFrom((com.google.ortools.linearsolver.MPConstraintProto)other);
713 super.mergeFrom(other);
719 if (other == com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance())
return this;
720 if (!other.varIndex_.isEmpty()) {
721 if (varIndex_.isEmpty()) {
722 varIndex_ = other.varIndex_;
723 varIndex_.makeImmutable();
724 bitField0_ |= 0x00000001;
726 ensureVarIndexIsMutable();
727 varIndex_.addAll(other.varIndex_);
731 if (!other.coefficient_.isEmpty()) {
732 if (coefficient_.isEmpty()) {
733 coefficient_ = other.coefficient_;
734 coefficient_.makeImmutable();
735 bitField0_ |= 0x00000002;
737 ensureCoefficientIsMutable();
738 coefficient_.addAll(other.coefficient_);
742 if (other.hasLowerBound()) {
745 if (other.hasUpperBound()) {
748 if (other.hasName()) {
750 bitField0_ |= 0x00000010;
753 if (other.hasIsLazy()) {
768 com.google.protobuf.CodedInputStream input,
769 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
770 throws java.io.IOException {
771 if (extensionRegistry ==
null) {
772 throw new java.lang.NullPointerException();
775 boolean done =
false;
777 int tag = input.readTag();
783 lowerBound_ = input.readDouble();
784 bitField0_ |= 0x00000004;
788 upperBound_ = input.readDouble();
789 bitField0_ |= 0x00000008;
793 name_ = input.readBytes();
794 bitField0_ |= 0x00000010;
798 isLazy_ = input.readBool();
799 bitField0_ |= 0x00000020;
803 int v = input.readInt32();
804 ensureVarIndexIsMutable();
809 int length = input.readRawVarint32();
810 int limit = input.pushLimit(length);
811 ensureVarIndexIsMutable();
812 while (input.getBytesUntilLimit() > 0) {
813 varIndex_.addInt(input.readInt32());
815 input.popLimit(limit);
819 double v = input.readDouble();
820 ensureCoefficientIsMutable();
821 coefficient_.addDouble(v);
825 int length = input.readRawVarint32();
826 int limit = input.pushLimit(length);
827 int alloc = length > 4096 ? 4096 : length;
828 ensureCoefficientIsMutable(alloc / 8);
829 while (input.getBytesUntilLimit() > 0) {
830 coefficient_.addDouble(input.readDouble());
832 input.popLimit(limit);
836 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
843 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
844 throw e.unwrapIOException();
850 private int bitField0_;
852 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
853 private void ensureVarIndexIsMutable() {
854 if (!varIndex_.isModifiable()) {
855 varIndex_ = makeMutableCopy(varIndex_);
857 bitField0_ |= 0x00000001;
870 public java.util.List<java.lang.Integer>
872 varIndex_.makeImmutable();
887 return varIndex_.size();
902 return varIndex_.getInt(index);
918 int index,
int value) {
920 ensureVarIndexIsMutable();
921 varIndex_.setInt(index, value);
922 bitField0_ |= 0x00000001;
940 ensureVarIndexIsMutable();
941 varIndex_.addInt(value);
942 bitField0_ |= 0x00000001;
959 java.lang.Iterable<? extends java.lang.Integer> values) {
960 ensureVarIndexIsMutable();
961 com.google.protobuf.AbstractMessageLite.Builder.addAll(
963 bitField0_ |= 0x00000001;
979 varIndex_ = emptyIntList();
980 bitField0_ = (bitField0_ & ~0x00000001);
985 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
986 private void ensureCoefficientIsMutable() {
987 if (!coefficient_.isModifiable()) {
988 coefficient_ = makeMutableCopy(coefficient_);
990 bitField0_ |= 0x00000002;
992 private void ensureCoefficientIsMutable(
int capacity) {
993 if (!coefficient_.isModifiable()) {
994 coefficient_ = makeMutableCopy(coefficient_, capacity);
996 bitField0_ |= 0x00000002;
1006 public java.util.List<java.lang.Double>
1008 coefficient_.makeImmutable();
1009 return coefficient_;
1020 return coefficient_.size();
1032 return coefficient_.getDouble(index);
1045 int index,
double value) {
1047 ensureCoefficientIsMutable();
1048 coefficient_.setDouble(index, value);
1049 bitField0_ |= 0x00000002;
1064 ensureCoefficientIsMutable();
1065 coefficient_.addDouble(value);
1066 bitField0_ |= 0x00000002;
1080 java.lang.Iterable<? extends java.lang.Double> values) {
1081 ensureCoefficientIsMutable();
1082 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1083 values, coefficient_);
1084 bitField0_ |= 0x00000002;
1097 coefficient_ = emptyDoubleList();
1098 bitField0_ = (bitField0_ & ~0x00000002);
1103 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1114 return ((bitField0_ & 0x00000004) != 0);
1139 lowerBound_ = value;
1140 bitField0_ |= 0x00000004;
1153 bitField0_ = (bitField0_ & ~0x00000004);
1154 lowerBound_ = Double.NEGATIVE_INFINITY;
1159 private double upperBound_ = Double.POSITIVE_INFINITY;
1166 return ((bitField0_ & 0x00000008) != 0);
1183 upperBound_ = value;
1184 bitField0_ |= 0x00000008;
1193 bitField0_ = (bitField0_ & ~0x00000008);
1194 upperBound_ = Double.POSITIVE_INFINITY;
1199 private java.lang.Object name_ =
"";
1209 return ((bitField0_ & 0x00000010) != 0);
1220 java.lang.Object ref = name_;
1221 if (!(ref instanceof java.lang.String)) {
1222 com.google.protobuf.ByteString bs =
1223 (com.google.protobuf.ByteString) ref;
1224 java.lang.String s = bs.toStringUtf8();
1225 if (bs.isValidUtf8()) {
1230 return (java.lang.String) ref;
1241 public com.google.protobuf.ByteString
1243 java.lang.Object ref = name_;
1244 if (ref instanceof String) {
1245 com.google.protobuf.ByteString b =
1246 com.google.protobuf.ByteString.copyFromUtf8(
1247 (java.lang.String) ref);
1251 return (com.google.protobuf.ByteString) ref;
1264 java.lang.String value) {
1265 if (value ==
null) {
throw new NullPointerException(); }
1267 bitField0_ |= 0x00000010;
1281 bitField0_ = (bitField0_ & ~0x00000010);
1295 com.google.protobuf.ByteString value) {
1296 if (value ==
null) {
throw new NullPointerException(); }
1298 bitField0_ |= 0x00000010;
1303 private boolean isLazy_ ;
1317 return ((bitField0_ & 0x00000020) != 0);
1349 bitField0_ |= 0x00000020;
1365 bitField0_ = (bitField0_ & ~0x00000020);
1372 final com.google.protobuf.UnknownFieldSet unknownFields) {
1378 final com.google.protobuf.UnknownFieldSet unknownFields) {
1389 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPConstraintProto();
1393 return DEFAULT_INSTANCE;
1396 @java.lang.Deprecated
public static final com.google.protobuf.Parser<
MPConstraintProto>
1400 com.google.protobuf.CodedInputStream input,
1401 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1402 throws com.google.protobuf.InvalidProtocolBufferException {
1405 builder.
mergeFrom(input, extensionRegistry);
1406 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1408 }
catch (com.google.protobuf.UninitializedMessageException e) {
1409 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.
buildPartial());
1410 }
catch (java.io.IOException e) {
1411 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1429 return DEFAULT_INSTANCE;