5package com.google.ortools.linearsolver;
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
31 private MPSosConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
36 varIndex_ = emptyIntList();
37 weight_ = emptyDoubleList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
57 implements com.google.protobuf.ProtocolMessageEnum {
79 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
80 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
85 Type.class.getName());
94 public static final int SOS1_DEFAULT_VALUE = 0;
104 public static final int SOS2_VALUE = 1;
116 @java.lang.Deprecated
118 return forNumber(value);
127 case 0:
return SOS1_DEFAULT;
129 default:
return null;
133 public static com.google.protobuf.Internal.EnumLiteMap<
Type>
135 return internalValueMap;
137 private static final com.google.protobuf.Internal.EnumLiteMap<
138 Type> internalValueMap =
139 new com.google.protobuf.Internal.EnumLiteMap<
Type>() {
140 public Type findValueByNumber(
int number) {
145 public final com.google.protobuf.Descriptors.EnumValueDescriptor
149 public final com.google.protobuf.Descriptors.EnumDescriptor
153 public static final com.google.protobuf.Descriptors.EnumDescriptor
155 return com.google.ortools.linearsolver.MPSosConstraint.getDescriptor().getEnumTypes().get(0);
158 private static final Type[] VALUES = values();
161 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
163 throw new java.lang.IllegalArgumentException(
164 "EnumValueDescriptor is not for this type.");
166 return VALUES[desc.getIndex()];
169 private final int value;
171 private Type(
int value) {
178 private int bitField0_;
180 private int type_ = 0;
185 @java.lang.Override
public boolean hasType() {
186 return ((bitField0_ & 0x00000001) != 0);
194 return result ==
null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
198 @SuppressWarnings(
"serial")
199 private com.google.protobuf.Internal.IntList varIndex_ =
211 public java.util.List<java.lang.Integer>
225 return varIndex_.size();
238 return varIndex_.getInt(index);
242 @SuppressWarnings(
"serial")
243 private com.google.protobuf.Internal.DoubleList weight_ =
263 public java.util.List<java.lang.Double>
285 return weight_.size();
306 return weight_.getDouble(index);
309 private byte memoizedIsInitialized = -1;
316 memoizedIsInitialized = 1;
321 public void writeTo(com.google.protobuf.CodedOutputStream output)
322 throws java.io.IOException {
323 if (((bitField0_ & 0x00000001) != 0)) {
324 output.writeEnum(1, type_);
326 for (
int i = 0; i < varIndex_.size(); i++) {
327 output.writeInt32(2, varIndex_.getInt(i));
329 for (
int i = 0; i < weight_.size(); i++) {
330 output.writeDouble(3, weight_.getDouble(i));
332 getUnknownFields().writeTo(output);
337 int size = memoizedSize;
338 if (size != -1)
return size;
341 if (((bitField0_ & 0x00000001) != 0)) {
342 size += com.google.protobuf.CodedOutputStream
343 .computeEnumSize(1, type_);
347 for (
int i = 0; i < varIndex_.size(); i++) {
348 dataSize += com.google.protobuf.CodedOutputStream
349 .computeInt32SizeNoTag(varIndex_.getInt(i));
360 size += getUnknownFields().getSerializedSize();
366 public boolean equals(
final java.lang.Object obj) {
370 if (!(obj instanceof com.google.ortools.linearsolver.MPSosConstraint)) {
371 return super.equals(obj);
377 if (type_ != other.type_)
return false;
383 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
389 if (memoizedHashCode != 0) {
390 return memoizedHashCode;
396 hash = (53 * hash) + type_;
406 hash = (29 * hash) + getUnknownFields().hashCode();
407 memoizedHashCode = hash;
412 java.nio.ByteBuffer data)
413 throws com.google.protobuf.InvalidProtocolBufferException {
414 return PARSER.parseFrom(data);
417 java.nio.ByteBuffer data,
418 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
419 throws com.google.protobuf.InvalidProtocolBufferException {
420 return PARSER.parseFrom(data, extensionRegistry);
423 com.google.protobuf.ByteString data)
424 throws com.google.protobuf.InvalidProtocolBufferException {
425 return PARSER.parseFrom(data);
428 com.google.protobuf.ByteString data,
429 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
430 throws com.google.protobuf.InvalidProtocolBufferException {
431 return PARSER.parseFrom(data, extensionRegistry);
434 throws com.google.protobuf.InvalidProtocolBufferException {
435 return PARSER.parseFrom(data);
439 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
440 throws com.google.protobuf.InvalidProtocolBufferException {
441 return PARSER.parseFrom(data, extensionRegistry);
444 throws java.io.IOException {
445 return com.google.protobuf.GeneratedMessage
446 .parseWithIOException(PARSER, input);
449 java.io.InputStream input,
450 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
451 throws java.io.IOException {
452 return com.google.protobuf.GeneratedMessage
453 .parseWithIOException(PARSER, input, extensionRegistry);
457 throws java.io.IOException {
458 return com.google.protobuf.GeneratedMessage
459 .parseDelimitedWithIOException(PARSER, input);
463 java.io.InputStream input,
464 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
465 throws java.io.IOException {
466 return com.google.protobuf.GeneratedMessage
467 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
470 com.google.protobuf.CodedInputStream input)
471 throws java.io.IOException {
472 return com.google.protobuf.GeneratedMessage
473 .parseWithIOException(PARSER, input);
476 com.google.protobuf.CodedInputStream input,
477 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
478 throws java.io.IOException {
479 return com.google.protobuf.GeneratedMessage
480 .parseWithIOException(PARSER, input, extensionRegistry);
493 return this == DEFAULT_INSTANCE
499 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
513 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
516 public static final com.google.protobuf.Descriptors.Descriptor
518 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
522 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
524 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
525 .ensureFieldAccessorsInitialized(
526 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
535 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
544 varIndex_ = emptyIntList();
545 weight_ = emptyDoubleList();
550 public com.google.protobuf.Descriptors.Descriptor
552 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
557 return com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance();
564 throw newUninitializedMessageException(result);
572 if (bitField0_ != 0) { buildPartial0(result); }
577 private void buildPartial0(com.google.ortools.linearsolver.MPSosConstraint result) {
578 int from_bitField0_ = bitField0_;
579 int to_bitField0_ = 0;
580 if (((from_bitField0_ & 0x00000001) != 0)) {
581 result.type_ = type_;
582 to_bitField0_ |= 0x00000001;
584 if (((from_bitField0_ & 0x00000002) != 0)) {
585 varIndex_.makeImmutable();
586 result.varIndex_ = varIndex_;
588 if (((from_bitField0_ & 0x00000004) != 0)) {
589 weight_.makeImmutable();
590 result.weight_ = weight_;
592 result.bitField0_ |= to_bitField0_;
597 if (other instanceof com.google.ortools.linearsolver.MPSosConstraint) {
598 return mergeFrom((com.google.ortools.linearsolver.MPSosConstraint)other);
600 super.mergeFrom(other);
606 if (other == com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance())
return this;
607 if (other.hasType()) {
610 if (!other.varIndex_.isEmpty()) {
611 if (varIndex_.isEmpty()) {
612 varIndex_ = other.varIndex_;
613 varIndex_.makeImmutable();
614 bitField0_ |= 0x00000002;
616 ensureVarIndexIsMutable();
617 varIndex_.addAll(other.varIndex_);
621 if (!other.weight_.isEmpty()) {
622 if (weight_.isEmpty()) {
623 weight_ = other.weight_;
624 weight_.makeImmutable();
625 bitField0_ |= 0x00000004;
627 ensureWeightIsMutable();
628 weight_.addAll(other.weight_);
632 this.mergeUnknownFields(other.getUnknownFields());
644 com.google.protobuf.CodedInputStream input,
645 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
646 throws java.io.IOException {
647 if (extensionRegistry ==
null) {
648 throw new java.lang.NullPointerException();
651 boolean done =
false;
653 int tag = input.readTag();
659 int tmpRaw = input.readEnum();
661 com.google.ortools.linearsolver.MPSosConstraint.Type.forNumber(tmpRaw);
662 if (tmpValue ==
null) {
663 mergeUnknownVarintField(1, tmpRaw);
666 bitField0_ |= 0x00000001;
671 int v = input.readInt32();
672 ensureVarIndexIsMutable();
677 int length = input.readRawVarint32();
678 int limit = input.pushLimit(length);
679 ensureVarIndexIsMutable();
680 while (input.getBytesUntilLimit() > 0) {
681 varIndex_.addInt(input.readInt32());
683 input.popLimit(limit);
687 double v = input.readDouble();
688 ensureWeightIsMutable();
689 weight_.addDouble(v);
693 int length = input.readRawVarint32();
694 int limit = input.pushLimit(length);
695 int alloc = length > 4096 ? 4096 : length;
696 ensureWeightIsMutable(alloc / 8);
697 while (input.getBytesUntilLimit() > 0) {
698 weight_.addDouble(input.readDouble());
700 input.popLimit(limit);
704 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
711 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
712 throw e.unwrapIOException();
718 private int bitField0_;
720 private int type_ = 0;
725 @java.lang.Override
public boolean hasType() {
726 return ((bitField0_ & 0x00000001) != 0);
735 return result ==
null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
742 public Builder setType(com.google.ortools.linearsolver.MPSosConstraint.Type value) {
744 throw new NullPointerException();
746 bitField0_ |= 0x00000001;
747 type_ = value.getNumber();
756 bitField0_ = (bitField0_ & ~0x00000001);
762 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
763 private void ensureVarIndexIsMutable() {
764 if (!varIndex_.isModifiable()) {
765 varIndex_ = makeMutableCopy(varIndex_);
767 bitField0_ |= 0x00000002;
778 public java.util.List<java.lang.Integer>
780 varIndex_.makeImmutable();
793 return varIndex_.size();
806 return varIndex_.getInt(index);
820 int index,
int value) {
822 ensureVarIndexIsMutable();
823 varIndex_.setInt(index, value);
824 bitField0_ |= 0x00000002;
840 ensureVarIndexIsMutable();
841 varIndex_.addInt(value);
842 bitField0_ |= 0x00000002;
857 java.lang.Iterable<? extends java.lang.Integer> values) {
858 ensureVarIndexIsMutable();
859 com.google.protobuf.AbstractMessageLite.Builder.addAll(
861 bitField0_ |= 0x00000002;
875 varIndex_ = emptyIntList();
876 bitField0_ = (bitField0_ & ~0x00000002);
881 private com.google.protobuf.Internal.DoubleList weight_ = emptyDoubleList();
882 private void ensureWeightIsMutable() {
883 if (!weight_.isModifiable()) {
884 weight_ = makeMutableCopy(weight_);
886 bitField0_ |= 0x00000004;
888 private void ensureWeightIsMutable(
int capacity) {
889 if (!weight_.isModifiable()) {
890 weight_ = makeMutableCopy(weight_, capacity);
892 bitField0_ |= 0x00000004;
911 public java.util.List<java.lang.Double>
913 weight_.makeImmutable();
934 return weight_.size();
955 return weight_.getDouble(index);
977 int index,
double value) {
979 ensureWeightIsMutable();
980 weight_.setDouble(index, value);
981 bitField0_ |= 0x00000004;
1005 ensureWeightIsMutable();
1006 weight_.addDouble(value);
1007 bitField0_ |= 0x00000004;
1030 java.lang.Iterable<? extends java.lang.Double> values) {
1031 ensureWeightIsMutable();
1032 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1034 bitField0_ |= 0x00000004;
1056 weight_ = emptyDoubleList();
1057 bitField0_ = (bitField0_ & ~0x00000004);
1068 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSosConstraint();
1072 return DEFAULT_INSTANCE;
1079 com.google.protobuf.CodedInputStream input,
1080 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1081 throws com.google.protobuf.InvalidProtocolBufferException {
1084 builder.mergeFrom(input, extensionRegistry);
1085 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1086 throw e.setUnfinishedMessage(builder.buildPartial());
1087 }
catch (com.google.protobuf.UninitializedMessageException e) {
1088 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1089 }
catch (java.io.IOException e) {
1090 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1091 .setUnfinishedMessage(builder.buildPartial());
1093 return builder.buildPartial();
1108 return DEFAULT_INSTANCE;