5package com.google.ortools.sat;
15 com.google.protobuf.GeneratedMessage implements
18private static final long serialVersionUID = 0L;
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 private LinearObjective(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 literals_ = emptyIntList();
34 coefficients_ = emptyLongList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.LinearObjective.class, com.google.ortools.sat.LinearObjective.Builder.class);
51 private int bitField0_;
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList literals_ =
70 public java.util.List<java.lang.Integer>
88 return literals_.size();
105 return literals_.getInt(index);
109 @SuppressWarnings(
"serial")
110 private com.google.protobuf.Internal.LongList coefficients_ =
117 public java.util.List<java.lang.Long>
119 return coefficients_;
126 return coefficients_.size();
134 return coefficients_.getLong(index);
138 private double offset_ = 0D;
155 return ((bitField0_ & 0x00000001) != 0);
177 private double scalingFactor_ = 1D;
184 return ((bitField0_ & 0x00000002) != 0);
192 return scalingFactor_;
195 private byte memoizedIsInitialized = -1;
202 memoizedIsInitialized = 1;
207 public void writeTo(com.google.protobuf.CodedOutputStream output)
208 throws java.io.IOException {
209 for (
int i = 0; i < literals_.size(); i++) {
210 output.writeInt32(1, literals_.getInt(i));
212 for (
int i = 0; i < coefficients_.size(); i++) {
213 output.writeInt64(2, coefficients_.getLong(i));
215 if (((bitField0_ & 0x00000001) != 0)) {
216 output.writeDouble(3, offset_);
218 if (((bitField0_ & 0x00000002) != 0)) {
219 output.writeDouble(4, scalingFactor_);
221 getUnknownFields().writeTo(output);
226 int size = memoizedSize;
227 if (size != -1)
return size;
232 for (
int i = 0; i < literals_.size(); i++) {
233 dataSize += com.google.protobuf.CodedOutputStream
234 .computeInt32SizeNoTag(literals_.getInt(i));
241 for (
int i = 0; i < coefficients_.size(); i++) {
242 dataSize += com.google.protobuf.CodedOutputStream
243 .computeInt64SizeNoTag(coefficients_.getLong(i));
248 if (((bitField0_ & 0x00000001) != 0)) {
249 size += com.google.protobuf.CodedOutputStream
250 .computeDoubleSize(3, offset_);
252 if (((bitField0_ & 0x00000002) != 0)) {
253 size += com.google.protobuf.CodedOutputStream
254 .computeDoubleSize(4, scalingFactor_);
256 size += getUnknownFields().getSerializedSize();
262 public boolean equals(
final java.lang.Object obj) {
266 if (!(obj instanceof com.google.ortools.sat.LinearObjective)) {
267 return super.equals(obj);
277 if (java.lang.Double.doubleToLongBits(
getOffset())
278 != java.lang.Double.doubleToLongBits(
284 != java.lang.Double.doubleToLongBits(
287 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
293 if (memoizedHashCode != 0) {
294 return memoizedHashCode;
308 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
309 java.lang.Double.doubleToLongBits(
getOffset()));
313 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
316 hash = (29 * hash) + getUnknownFields().hashCode();
317 memoizedHashCode = hash;
322 java.nio.ByteBuffer data)
323 throws com.google.protobuf.InvalidProtocolBufferException {
324 return PARSER.parseFrom(data);
327 java.nio.ByteBuffer data,
328 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
329 throws com.google.protobuf.InvalidProtocolBufferException {
330 return PARSER.parseFrom(data, extensionRegistry);
333 com.google.protobuf.ByteString data)
334 throws com.google.protobuf.InvalidProtocolBufferException {
335 return PARSER.parseFrom(data);
338 com.google.protobuf.ByteString data,
339 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
340 throws com.google.protobuf.InvalidProtocolBufferException {
341 return PARSER.parseFrom(data, extensionRegistry);
344 throws com.google.protobuf.InvalidProtocolBufferException {
345 return PARSER.parseFrom(data);
349 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
350 throws com.google.protobuf.InvalidProtocolBufferException {
351 return PARSER.parseFrom(data, extensionRegistry);
354 throws java.io.IOException {
355 return com.google.protobuf.GeneratedMessage
356 .parseWithIOException(PARSER, input);
359 java.io.InputStream input,
360 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
361 throws java.io.IOException {
362 return com.google.protobuf.GeneratedMessage
363 .parseWithIOException(PARSER, input, extensionRegistry);
367 throws java.io.IOException {
368 return com.google.protobuf.GeneratedMessage
369 .parseDelimitedWithIOException(PARSER, input);
373 java.io.InputStream input,
374 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
375 throws java.io.IOException {
376 return com.google.protobuf.GeneratedMessage
377 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
380 com.google.protobuf.CodedInputStream input)
381 throws java.io.IOException {
382 return com.google.protobuf.GeneratedMessage
383 .parseWithIOException(PARSER, input);
386 com.google.protobuf.CodedInputStream input,
387 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
388 throws java.io.IOException {
389 return com.google.protobuf.GeneratedMessage
390 .parseWithIOException(PARSER, input, extensionRegistry);
403 return this == DEFAULT_INSTANCE
409 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
421 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
424 public static final com.google.protobuf.Descriptors.Descriptor
426 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
430 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
432 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_fieldAccessorTable
433 .ensureFieldAccessorsInitialized(
434 com.google.ortools.sat.LinearObjective.class, com.google.ortools.sat.LinearObjective.Builder.class);
443 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
451 literals_ = emptyIntList();
452 coefficients_ = emptyLongList();
459 public com.google.protobuf.Descriptors.Descriptor
461 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
466 return com.google.ortools.sat.LinearObjective.getDefaultInstance();
473 throw newUninitializedMessageException(result);
481 if (bitField0_ != 0) { buildPartial0(result); }
486 private void buildPartial0(com.google.ortools.sat.LinearObjective result) {
487 int from_bitField0_ = bitField0_;
488 if (((from_bitField0_ & 0x00000001) != 0)) {
489 literals_.makeImmutable();
490 result.literals_ = literals_;
492 if (((from_bitField0_ & 0x00000002) != 0)) {
493 coefficients_.makeImmutable();
494 result.coefficients_ = coefficients_;
496 int to_bitField0_ = 0;
497 if (((from_bitField0_ & 0x00000004) != 0)) {
498 result.offset_ = offset_;
499 to_bitField0_ |= 0x00000001;
501 if (((from_bitField0_ & 0x00000008) != 0)) {
502 result.scalingFactor_ = scalingFactor_;
503 to_bitField0_ |= 0x00000002;
505 result.bitField0_ |= to_bitField0_;
510 if (other instanceof com.google.ortools.sat.LinearObjective) {
511 return mergeFrom((com.google.ortools.sat.LinearObjective)other);
513 super.mergeFrom(other);
519 if (other == com.google.ortools.sat.LinearObjective.getDefaultInstance())
return this;
520 if (!other.literals_.isEmpty()) {
521 if (literals_.isEmpty()) {
522 literals_ = other.literals_;
523 literals_.makeImmutable();
524 bitField0_ |= 0x00000001;
526 ensureLiteralsIsMutable();
527 literals_.addAll(other.literals_);
531 if (!other.coefficients_.isEmpty()) {
532 if (coefficients_.isEmpty()) {
533 coefficients_ = other.coefficients_;
534 coefficients_.makeImmutable();
535 bitField0_ |= 0x00000002;
537 ensureCoefficientsIsMutable();
538 coefficients_.addAll(other.coefficients_);
542 if (other.hasOffset()) {
545 if (other.hasScalingFactor()) {
548 this.mergeUnknownFields(other.getUnknownFields());
560 com.google.protobuf.CodedInputStream input,
561 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
562 throws java.io.IOException {
563 if (extensionRegistry ==
null) {
564 throw new java.lang.NullPointerException();
567 boolean done =
false;
569 int tag = input.readTag();
575 int v = input.readInt32();
576 ensureLiteralsIsMutable();
581 int length = input.readRawVarint32();
582 int limit = input.pushLimit(length);
583 ensureLiteralsIsMutable();
584 while (input.getBytesUntilLimit() > 0) {
585 literals_.addInt(input.readInt32());
587 input.popLimit(limit);
591 long v = input.readInt64();
592 ensureCoefficientsIsMutable();
593 coefficients_.addLong(v);
597 int length = input.readRawVarint32();
598 int limit = input.pushLimit(length);
599 ensureCoefficientsIsMutable();
600 while (input.getBytesUntilLimit() > 0) {
601 coefficients_.addLong(input.readInt64());
603 input.popLimit(limit);
607 offset_ = input.readDouble();
608 bitField0_ |= 0x00000004;
612 scalingFactor_ = input.readDouble();
613 bitField0_ |= 0x00000008;
617 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
624 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
625 throw e.unwrapIOException();
631 private int bitField0_;
633 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
634 private void ensureLiteralsIsMutable() {
635 if (!literals_.isModifiable()) {
636 literals_ = makeMutableCopy(literals_);
638 bitField0_ |= 0x00000001;
653 public java.util.List<java.lang.Integer>
655 literals_.makeImmutable();
672 return literals_.size();
689 return literals_.getInt(index);
707 int index,
int value) {
709 ensureLiteralsIsMutable();
710 literals_.setInt(index, value);
711 bitField0_ |= 0x00000001;
731 ensureLiteralsIsMutable();
732 literals_.addInt(value);
733 bitField0_ |= 0x00000001;
752 java.lang.Iterable<? extends java.lang.Integer> values) {
753 ensureLiteralsIsMutable();
754 com.google.protobuf.AbstractMessageLite.Builder.addAll(
756 bitField0_ |= 0x00000001;
774 literals_ = emptyIntList();
775 bitField0_ = (bitField0_ & ~0x00000001);
780 private com.google.protobuf.Internal.LongList coefficients_ = emptyLongList();
781 private void ensureCoefficientsIsMutable() {
782 if (!coefficients_.isModifiable()) {
783 coefficients_ = makeMutableCopy(coefficients_);
785 bitField0_ |= 0x00000002;
791 public java.util.List<java.lang.Long>
793 coefficients_.makeImmutable();
794 return coefficients_;
801 return coefficients_.size();
809 return coefficients_.getLong(index);
818 int index,
long value) {
820 ensureCoefficientsIsMutable();
821 coefficients_.setLong(index, value);
822 bitField0_ |= 0x00000002;
833 ensureCoefficientsIsMutable();
834 coefficients_.addLong(value);
835 bitField0_ |= 0x00000002;
845 java.lang.Iterable<? extends java.lang.Long> values) {
846 ensureCoefficientsIsMutable();
847 com.google.protobuf.AbstractMessageLite.Builder.addAll(
848 values, coefficients_);
849 bitField0_ |= 0x00000002;
858 coefficients_ = emptyLongList();
859 bitField0_ = (bitField0_ & ~0x00000002);
864 private double offset_ ;
881 return ((bitField0_ & 0x00000004) != 0);
919 bitField0_ |= 0x00000004;
938 bitField0_ = (bitField0_ & ~0x00000004);
944 private double scalingFactor_ = 1D;
951 return ((bitField0_ & 0x00000008) != 0);
959 return scalingFactor_;
968 scalingFactor_ = value;
969 bitField0_ |= 0x00000008;
978 bitField0_ = (bitField0_ & ~0x00000008);
990 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearObjective();
994 return DEFAULT_INSTANCE;
1001 com.google.protobuf.CodedInputStream input,
1002 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1003 throws com.google.protobuf.InvalidProtocolBufferException {
1006 builder.mergeFrom(input, extensionRegistry);
1007 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1008 throw e.setUnfinishedMessage(builder.buildPartial());
1009 }
catch (com.google.protobuf.UninitializedMessageException e) {
1010 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1011 }
catch (java.io.IOException e) {
1012 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1013 .setUnfinishedMessage(builder.buildPartial());
1015 return builder.buildPartial();
1030 return DEFAULT_INSTANCE;