5package com.google.ortools.sat;
20 com.google.protobuf.GeneratedMessage implements
23private static final long serialVersionUID = 0L;
25 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
26 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
38 vars_ = emptyIntList();
39 coeffs_ = emptyLongList();
40 domain_ = emptyLongList();
43 public static final com.google.protobuf.Descriptors.Descriptor
45 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearConstraintProto_descriptor;
49 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
51 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearConstraintProto_fieldAccessorTable
52 .ensureFieldAccessorsInitialized(
53 com.google.ortools.sat.LinearConstraintProto.class, com.google.ortools.sat.LinearConstraintProto.Builder.class);
57 @SuppressWarnings(
"serial")
58 private com.google.protobuf.Internal.IntList vars_ =
65 public java.util.List<java.lang.Integer>
82 return vars_.getInt(index);
84 private int varsMemoizedSerializedSize = -1;
87 @SuppressWarnings(
"serial")
88 private com.google.protobuf.Internal.LongList coeffs_ =
99 public java.util.List<java.lang.Long>
112 return coeffs_.size();
124 return coeffs_.getLong(index);
126 private int coeffsMemoizedSerializedSize = -1;
129 @SuppressWarnings(
"serial")
130 private com.google.protobuf.Internal.LongList domain_ =
137 public java.util.List<java.lang.Long>
146 return domain_.size();
154 return domain_.getLong(index);
156 private int domainMemoizedSerializedSize = -1;
158 private byte memoizedIsInitialized = -1;
165 memoizedIsInitialized = 1;
170 public void writeTo(com.google.protobuf.CodedOutputStream output)
171 throws java.io.IOException {
174 output.writeUInt32NoTag(10);
175 output.writeUInt32NoTag(varsMemoizedSerializedSize);
177 for (
int i = 0; i < vars_.size(); i++) {
178 output.writeInt32NoTag(vars_.getInt(i));
181 output.writeUInt32NoTag(18);
182 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
184 for (
int i = 0; i < coeffs_.size(); i++) {
185 output.writeInt64NoTag(coeffs_.getLong(i));
188 output.writeUInt32NoTag(26);
189 output.writeUInt32NoTag(domainMemoizedSerializedSize);
191 for (
int i = 0; i < domain_.size(); i++) {
192 output.writeInt64NoTag(domain_.getLong(i));
194 getUnknownFields().writeTo(output);
199 int size = memoizedSize;
200 if (size != -1)
return size;
205 for (
int i = 0; i < vars_.size(); i++) {
206 dataSize += com.google.protobuf.CodedOutputStream
207 .computeInt32SizeNoTag(vars_.getInt(i));
212 size += com.google.protobuf.CodedOutputStream
213 .computeInt32SizeNoTag(dataSize);
215 varsMemoizedSerializedSize = dataSize;
219 for (
int i = 0; i < coeffs_.size(); i++) {
220 dataSize += com.google.protobuf.CodedOutputStream
221 .computeInt64SizeNoTag(coeffs_.getLong(i));
226 size += com.google.protobuf.CodedOutputStream
227 .computeInt32SizeNoTag(dataSize);
229 coeffsMemoizedSerializedSize = dataSize;
233 for (
int i = 0; i < domain_.size(); i++) {
234 dataSize += com.google.protobuf.CodedOutputStream
235 .computeInt64SizeNoTag(domain_.getLong(i));
240 size += com.google.protobuf.CodedOutputStream
241 .computeInt32SizeNoTag(dataSize);
243 domainMemoizedSerializedSize = dataSize;
245 size += getUnknownFields().getSerializedSize();
251 public boolean equals(
final java.lang.Object obj) {
255 if (!(obj instanceof com.google.ortools.sat.LinearConstraintProto)) {
256 return super.equals(obj);
266 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
272 if (memoizedHashCode != 0) {
273 return memoizedHashCode;
289 hash = (29 * hash) + getUnknownFields().hashCode();
290 memoizedHashCode = hash;
295 java.nio.ByteBuffer data)
296 throws com.google.protobuf.InvalidProtocolBufferException {
297 return PARSER.parseFrom(data);
300 java.nio.ByteBuffer data,
301 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
302 throws com.google.protobuf.InvalidProtocolBufferException {
303 return PARSER.parseFrom(data, extensionRegistry);
306 com.google.protobuf.ByteString data)
307 throws com.google.protobuf.InvalidProtocolBufferException {
308 return PARSER.parseFrom(data);
311 com.google.protobuf.ByteString data,
312 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
313 throws com.google.protobuf.InvalidProtocolBufferException {
314 return PARSER.parseFrom(data, extensionRegistry);
317 throws com.google.protobuf.InvalidProtocolBufferException {
318 return PARSER.parseFrom(data);
322 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
323 throws com.google.protobuf.InvalidProtocolBufferException {
324 return PARSER.parseFrom(data, extensionRegistry);
327 throws java.io.IOException {
328 return com.google.protobuf.GeneratedMessage
329 .parseWithIOException(PARSER, input);
332 java.io.InputStream input,
333 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
334 throws java.io.IOException {
335 return com.google.protobuf.GeneratedMessage
336 .parseWithIOException(PARSER, input, extensionRegistry);
340 throws java.io.IOException {
341 return com.google.protobuf.GeneratedMessage
342 .parseDelimitedWithIOException(PARSER, input);
346 java.io.InputStream input,
347 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
348 throws java.io.IOException {
349 return com.google.protobuf.GeneratedMessage
350 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
353 com.google.protobuf.CodedInputStream input)
354 throws java.io.IOException {
355 return com.google.protobuf.GeneratedMessage
356 .parseWithIOException(PARSER, input);
359 com.google.protobuf.CodedInputStream input,
360 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
361 throws java.io.IOException {
362 return com.google.protobuf.GeneratedMessage
363 .parseWithIOException(PARSER, input, extensionRegistry);
376 return this == DEFAULT_INSTANCE
382 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
399 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
402 public static final com.google.protobuf.Descriptors.Descriptor
404 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearConstraintProto_descriptor;
408 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
410 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearConstraintProto_fieldAccessorTable
411 .ensureFieldAccessorsInitialized(
412 com.google.ortools.sat.LinearConstraintProto.class, com.google.ortools.sat.LinearConstraintProto.Builder.class);
421 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
429 vars_ = emptyIntList();
430 coeffs_ = emptyLongList();
431 domain_ = emptyLongList();
436 public com.google.protobuf.Descriptors.Descriptor
438 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearConstraintProto_descriptor;
443 return com.google.ortools.sat.LinearConstraintProto.getDefaultInstance();
450 throw newUninitializedMessageException(result);
458 if (bitField0_ != 0) { buildPartial0(result); }
463 private void buildPartial0(com.google.ortools.sat.LinearConstraintProto result) {
464 int from_bitField0_ = bitField0_;
465 if (((from_bitField0_ & 0x00000001) != 0)) {
466 vars_.makeImmutable();
467 result.vars_ = vars_;
469 if (((from_bitField0_ & 0x00000002) != 0)) {
470 coeffs_.makeImmutable();
471 result.coeffs_ = coeffs_;
473 if (((from_bitField0_ & 0x00000004) != 0)) {
474 domain_.makeImmutable();
475 result.domain_ = domain_;
481 if (other instanceof com.google.ortools.sat.LinearConstraintProto) {
482 return mergeFrom((com.google.ortools.sat.LinearConstraintProto)other);
484 super.mergeFrom(other);
490 if (other == com.google.ortools.sat.LinearConstraintProto.getDefaultInstance())
return this;
491 if (!other.vars_.isEmpty()) {
492 if (vars_.isEmpty()) {
494 vars_.makeImmutable();
495 bitField0_ |= 0x00000001;
497 ensureVarsIsMutable();
498 vars_.addAll(other.vars_);
502 if (!other.coeffs_.isEmpty()) {
503 if (coeffs_.isEmpty()) {
504 coeffs_ = other.coeffs_;
505 coeffs_.makeImmutable();
506 bitField0_ |= 0x00000002;
508 ensureCoeffsIsMutable();
509 coeffs_.addAll(other.coeffs_);
513 if (!other.domain_.isEmpty()) {
514 if (domain_.isEmpty()) {
515 domain_ = other.domain_;
516 domain_.makeImmutable();
517 bitField0_ |= 0x00000004;
519 ensureDomainIsMutable();
520 domain_.addAll(other.domain_);
524 this.mergeUnknownFields(other.getUnknownFields());
536 com.google.protobuf.CodedInputStream input,
537 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
538 throws java.io.IOException {
539 if (extensionRegistry ==
null) {
540 throw new java.lang.NullPointerException();
543 boolean done =
false;
545 int tag = input.readTag();
551 int v = input.readInt32();
552 ensureVarsIsMutable();
557 int length = input.readRawVarint32();
558 int limit = input.pushLimit(length);
559 ensureVarsIsMutable();
560 while (input.getBytesUntilLimit() > 0) {
561 vars_.addInt(input.readInt32());
563 input.popLimit(limit);
567 long v = input.readInt64();
568 ensureCoeffsIsMutable();
573 int length = input.readRawVarint32();
574 int limit = input.pushLimit(length);
575 ensureCoeffsIsMutable();
576 while (input.getBytesUntilLimit() > 0) {
577 coeffs_.addLong(input.readInt64());
579 input.popLimit(limit);
583 long v = input.readInt64();
584 ensureDomainIsMutable();
589 int length = input.readRawVarint32();
590 int limit = input.pushLimit(length);
591 ensureDomainIsMutable();
592 while (input.getBytesUntilLimit() > 0) {
593 domain_.addLong(input.readInt64());
595 input.popLimit(limit);
599 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
606 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
607 throw e.unwrapIOException();
613 private int bitField0_;
615 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
616 private void ensureVarsIsMutable() {
617 if (!vars_.isModifiable()) {
618 vars_ = makeMutableCopy(vars_);
620 bitField0_ |= 0x00000001;
626 public java.util.List<java.lang.Integer>
628 vars_.makeImmutable();
644 return vars_.getInt(index);
653 int index,
int value) {
655 ensureVarsIsMutable();
656 vars_.setInt(index, value);
657 bitField0_ |= 0x00000001;
668 ensureVarsIsMutable();
670 bitField0_ |= 0x00000001;
680 java.lang.Iterable<? extends java.lang.Integer> values) {
681 ensureVarsIsMutable();
682 com.google.protobuf.AbstractMessageLite.Builder.addAll(
684 bitField0_ |= 0x00000001;
693 vars_ = emptyIntList();
694 bitField0_ = (bitField0_ & ~0x00000001);
699 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
700 private void ensureCoeffsIsMutable() {
701 if (!coeffs_.isModifiable()) {
702 coeffs_ = makeMutableCopy(coeffs_);
704 bitField0_ |= 0x00000002;
714 public java.util.List<java.lang.Long>
716 coeffs_.makeImmutable();
728 return coeffs_.size();
740 return coeffs_.getLong(index);
753 int index,
long value) {
755 ensureCoeffsIsMutable();
756 coeffs_.setLong(index, value);
757 bitField0_ |= 0x00000002;
772 ensureCoeffsIsMutable();
773 coeffs_.addLong(value);
774 bitField0_ |= 0x00000002;
788 java.lang.Iterable<? extends java.lang.Long> values) {
789 ensureCoeffsIsMutable();
790 com.google.protobuf.AbstractMessageLite.Builder.addAll(
792 bitField0_ |= 0x00000002;
805 coeffs_ = emptyLongList();
806 bitField0_ = (bitField0_ & ~0x00000002);
811 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
812 private void ensureDomainIsMutable() {
813 if (!domain_.isModifiable()) {
814 domain_ = makeMutableCopy(domain_);
816 bitField0_ |= 0x00000004;
822 public java.util.List<java.lang.Long>
824 domain_.makeImmutable();
832 return domain_.size();
840 return domain_.getLong(index);
849 int index,
long value) {
851 ensureDomainIsMutable();
852 domain_.setLong(index, value);
853 bitField0_ |= 0x00000004;
864 ensureDomainIsMutable();
865 domain_.addLong(value);
866 bitField0_ |= 0x00000004;
876 java.lang.Iterable<? extends java.lang.Long> values) {
877 ensureDomainIsMutable();
878 com.google.protobuf.AbstractMessageLite.Builder.addAll(
880 bitField0_ |= 0x00000004;
889 domain_ = emptyLongList();
890 bitField0_ = (bitField0_ & ~0x00000004);
901 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearConstraintProto();
905 return DEFAULT_INSTANCE;
912 com.google.protobuf.CodedInputStream input,
913 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
914 throws com.google.protobuf.InvalidProtocolBufferException {
917 builder.mergeFrom(input, extensionRegistry);
918 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
919 throw e.setUnfinishedMessage(builder.buildPartial());
920 }
catch (com.google.protobuf.UninitializedMessageException e) {
921 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
922 }
catch (java.io.IOException e) {
923 throw new com.google.protobuf.InvalidProtocolBufferException(e)
924 .setUnfinishedMessage(builder.buildPartial());
926 return builder.buildPartial();
941 return DEFAULT_INSTANCE;