5package com.google.ortools.sat;
17 com.google.protobuf.GeneratedMessageV3 implements
20private static final long serialVersionUID = 0L;
26 vars_ = emptyIntList();
27 coeffs_ = emptyLongList();
31 @SuppressWarnings({
"unused"})
33 UnusedPrivateParameter unused) {
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
43 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
45 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
46 .ensureFieldAccessorsInitialized(
47 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
51 @SuppressWarnings(
"serial")
52 private com.google.protobuf.Internal.IntList vars_ =
59 public java.util.List<java.lang.Integer>
76 return vars_.getInt(index);
78 private int varsMemoizedSerializedSize = -1;
81 @SuppressWarnings(
"serial")
82 private com.google.protobuf.Internal.LongList coeffs_ =
89 public java.util.List<java.lang.Long>
98 return coeffs_.size();
106 return coeffs_.getLong(index);
108 private int coeffsMemoizedSerializedSize = -1;
111 private long offset_ = 0L;
121 private byte memoizedIsInitialized = -1;
128 memoizedIsInitialized = 1;
133 public void writeTo(com.google.protobuf.CodedOutputStream output)
134 throws java.io.IOException {
137 output.writeUInt32NoTag(10);
138 output.writeUInt32NoTag(varsMemoizedSerializedSize);
140 for (
int i = 0; i < vars_.size(); i++) {
141 output.writeInt32NoTag(vars_.getInt(i));
144 output.writeUInt32NoTag(18);
145 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
147 for (
int i = 0; i < coeffs_.size(); i++) {
148 output.writeInt64NoTag(coeffs_.getLong(i));
151 output.writeInt64(3, offset_);
153 getUnknownFields().writeTo(output);
158 int size = memoizedSize;
159 if (size != -1)
return size;
164 for (
int i = 0; i < vars_.size(); i++) {
165 dataSize += com.google.protobuf.CodedOutputStream
166 .computeInt32SizeNoTag(vars_.getInt(i));
171 size += com.google.protobuf.CodedOutputStream
172 .computeInt32SizeNoTag(dataSize);
174 varsMemoizedSerializedSize = dataSize;
178 for (
int i = 0; i < coeffs_.size(); i++) {
179 dataSize += com.google.protobuf.CodedOutputStream
180 .computeInt64SizeNoTag(coeffs_.getLong(i));
185 size += com.google.protobuf.CodedOutputStream
186 .computeInt32SizeNoTag(dataSize);
188 coeffsMemoizedSerializedSize = dataSize;
191 size += com.google.protobuf.CodedOutputStream
192 .computeInt64Size(3, offset_);
194 size += getUnknownFields().getSerializedSize();
200 public boolean equals(
final java.lang.Object obj) {
204 if (!(obj instanceof com.google.ortools.sat.LinearExpressionProto)) {
205 return super.equals(obj);
215 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
221 if (memoizedHashCode != 0) {
222 return memoizedHashCode;
235 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
237 hash = (29 * hash) + getUnknownFields().hashCode();
238 memoizedHashCode = hash;
243 java.nio.ByteBuffer data)
244 throws com.google.protobuf.InvalidProtocolBufferException {
245 return PARSER.parseFrom(data);
248 java.nio.ByteBuffer data,
249 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
250 throws com.google.protobuf.InvalidProtocolBufferException {
251 return PARSER.parseFrom(data, extensionRegistry);
254 com.google.protobuf.ByteString data)
255 throws com.google.protobuf.InvalidProtocolBufferException {
256 return PARSER.parseFrom(data);
259 com.google.protobuf.ByteString data,
260 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
261 throws com.google.protobuf.InvalidProtocolBufferException {
262 return PARSER.parseFrom(data, extensionRegistry);
265 throws com.google.protobuf.InvalidProtocolBufferException {
266 return PARSER.parseFrom(data);
270 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
271 throws com.google.protobuf.InvalidProtocolBufferException {
272 return PARSER.parseFrom(data, extensionRegistry);
275 throws java.io.IOException {
276 return com.google.protobuf.GeneratedMessageV3
277 .parseWithIOException(PARSER, input);
280 java.io.InputStream input,
281 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessageV3
284 .parseWithIOException(PARSER, input, extensionRegistry);
288 throws java.io.IOException {
289 return com.google.protobuf.GeneratedMessageV3
290 .parseDelimitedWithIOException(PARSER, input);
294 java.io.InputStream input,
295 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
296 throws java.io.IOException {
297 return com.google.protobuf.GeneratedMessageV3
298 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
301 com.google.protobuf.CodedInputStream input)
302 throws java.io.IOException {
303 return com.google.protobuf.GeneratedMessageV3
304 .parseWithIOException(PARSER, input);
307 com.google.protobuf.CodedInputStream input,
308 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
309 throws java.io.IOException {
310 return com.google.protobuf.GeneratedMessageV3
311 .parseWithIOException(PARSER, input, extensionRegistry);
324 return this == DEFAULT_INSTANCE
330 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
344 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
347 public static final com.google.protobuf.Descriptors.Descriptor
349 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
353 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
355 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
356 .ensureFieldAccessorsInitialized(
357 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
366 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
374 vars_ = emptyIntList();
375 coeffs_ = emptyLongList();
381 public com.google.protobuf.Descriptors.Descriptor
383 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
388 return com.google.ortools.sat.LinearExpressionProto.getDefaultInstance();
395 throw newUninitializedMessageException(result);
403 if (bitField0_ != 0) { buildPartial0(result); }
408 private void buildPartial0(com.google.ortools.sat.LinearExpressionProto result) {
409 int from_bitField0_ = bitField0_;
410 if (((from_bitField0_ & 0x00000001) != 0)) {
411 vars_.makeImmutable();
412 result.vars_ = vars_;
414 if (((from_bitField0_ & 0x00000002) != 0)) {
415 coeffs_.makeImmutable();
416 result.coeffs_ = coeffs_;
418 if (((from_bitField0_ & 0x00000004) != 0)) {
419 result.offset_ = offset_;
425 return super.
clone();
429 com.google.protobuf.Descriptors.FieldDescriptor field,
430 java.lang.Object value) {
431 return super.
setField(field, value);
435 com.google.protobuf.Descriptors.FieldDescriptor field) {
440 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
445 com.google.protobuf.Descriptors.FieldDescriptor field,
446 int index, java.lang.Object value) {
451 com.google.protobuf.Descriptors.FieldDescriptor field,
452 java.lang.Object value) {
457 if (other instanceof com.google.ortools.sat.LinearExpressionProto) {
458 return mergeFrom((com.google.ortools.sat.LinearExpressionProto)other);
460 super.mergeFrom(other);
466 if (other == com.google.ortools.sat.LinearExpressionProto.getDefaultInstance())
return this;
467 if (!other.vars_.isEmpty()) {
468 if (vars_.isEmpty()) {
470 vars_.makeImmutable();
471 bitField0_ |= 0x00000001;
473 ensureVarsIsMutable();
474 vars_.addAll(other.vars_);
478 if (!other.coeffs_.isEmpty()) {
479 if (coeffs_.isEmpty()) {
480 coeffs_ = other.coeffs_;
481 coeffs_.makeImmutable();
482 bitField0_ |= 0x00000002;
484 ensureCoeffsIsMutable();
485 coeffs_.addAll(other.coeffs_);
489 if (other.getOffset() != 0L) {
504 com.google.protobuf.CodedInputStream input,
505 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
506 throws java.io.IOException {
507 if (extensionRegistry ==
null) {
508 throw new java.lang.NullPointerException();
511 boolean done =
false;
513 int tag = input.readTag();
519 int v = input.readInt32();
520 ensureVarsIsMutable();
525 int length = input.readRawVarint32();
526 int limit = input.pushLimit(length);
527 ensureVarsIsMutable();
528 while (input.getBytesUntilLimit() > 0) {
529 vars_.addInt(input.readInt32());
531 input.popLimit(limit);
535 long v = input.readInt64();
536 ensureCoeffsIsMutable();
541 int length = input.readRawVarint32();
542 int limit = input.pushLimit(length);
543 ensureCoeffsIsMutable();
544 while (input.getBytesUntilLimit() > 0) {
545 coeffs_.addLong(input.readInt64());
547 input.popLimit(limit);
551 offset_ = input.readInt64();
552 bitField0_ |= 0x00000004;
556 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
563 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
564 throw e.unwrapIOException();
570 private int bitField0_;
572 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
573 private void ensureVarsIsMutable() {
574 if (!vars_.isModifiable()) {
575 vars_ = makeMutableCopy(vars_);
577 bitField0_ |= 0x00000001;
583 public java.util.List<java.lang.Integer>
585 vars_.makeImmutable();
601 return vars_.getInt(index);
610 int index,
int value) {
612 ensureVarsIsMutable();
613 vars_.setInt(index, value);
614 bitField0_ |= 0x00000001;
625 ensureVarsIsMutable();
627 bitField0_ |= 0x00000001;
637 java.lang.Iterable<? extends java.lang.Integer> values) {
638 ensureVarsIsMutable();
639 com.google.protobuf.AbstractMessageLite.Builder.addAll(
641 bitField0_ |= 0x00000001;
650 vars_ = emptyIntList();
651 bitField0_ = (bitField0_ & ~0x00000001);
656 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
657 private void ensureCoeffsIsMutable() {
658 if (!coeffs_.isModifiable()) {
659 coeffs_ = makeMutableCopy(coeffs_);
661 bitField0_ |= 0x00000002;
667 public java.util.List<java.lang.Long>
669 coeffs_.makeImmutable();
677 return coeffs_.size();
685 return coeffs_.getLong(index);
694 int index,
long value) {
696 ensureCoeffsIsMutable();
697 coeffs_.setLong(index, value);
698 bitField0_ |= 0x00000002;
709 ensureCoeffsIsMutable();
710 coeffs_.addLong(value);
711 bitField0_ |= 0x00000002;
721 java.lang.Iterable<? extends java.lang.Long> values) {
722 ensureCoeffsIsMutable();
723 com.google.protobuf.AbstractMessageLite.Builder.addAll(
725 bitField0_ |= 0x00000002;
734 coeffs_ = emptyLongList();
735 bitField0_ = (bitField0_ & ~0x00000002);
740 private long offset_ ;
757 bitField0_ |= 0x00000004;
766 bitField0_ = (bitField0_ & ~0x00000004);
773 final com.google.protobuf.UnknownFieldSet unknownFields) {
779 final com.google.protobuf.UnknownFieldSet unknownFields) {
790 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearExpressionProto();
794 return DEFAULT_INSTANCE;
801 com.google.protobuf.CodedInputStream input,
802 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
803 throws com.google.protobuf.InvalidProtocolBufferException {
806 builder.mergeFrom(input, extensionRegistry);
807 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
808 throw e.setUnfinishedMessage(builder.buildPartial());
809 }
catch (com.google.protobuf.UninitializedMessageException e) {
810 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
811 }
catch (java.io.IOException e) {
812 throw new com.google.protobuf.InvalidProtocolBufferException(e)
813 .setUnfinishedMessage(builder.buildPartial());
815 return builder.buildPartial();
830 return DEFAULT_INSTANCE;