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 CpObjectiveProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 vars_ = emptyIntList();
34 coeffs_ = emptyLongList();
35 domain_ = emptyLongList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
52 @SuppressWarnings(
"serial")
53 private com.google.protobuf.Internal.IntList vars_ =
66 public java.util.List<java.lang.Integer>
95 return vars_.getInt(index);
97 private int varsMemoizedSerializedSize = -1;
100 @SuppressWarnings(
"serial")
101 private com.google.protobuf.Internal.LongList coeffs_ =
108 public java.util.List<java.lang.Long>
117 return coeffs_.size();
125 return coeffs_.getLong(index);
127 private int coeffsMemoizedSerializedSize = -1;
130 private double offset_ = 0D;
151 private double scalingFactor_ = 0D;
158 return scalingFactor_;
162 @SuppressWarnings(
"serial")
163 private com.google.protobuf.Internal.LongList domain_ =
176 public java.util.List<java.lang.Long>
191 return domain_.size();
205 return domain_.getLong(index);
207 private int domainMemoizedSerializedSize = -1;
210 private boolean scalingWasExact_ =
false;
225 return scalingWasExact_;
229 private long integerBeforeOffset_ = 0L;
251 return integerBeforeOffset_;
255 private long integerAfterOffset_ = 0L;
262 return integerAfterOffset_;
266 private long integerScalingFactor_ = 0L;
273 return integerScalingFactor_;
276 private byte memoizedIsInitialized = -1;
283 memoizedIsInitialized = 1;
288 public void writeTo(com.google.protobuf.CodedOutputStream output)
289 throws java.io.IOException {
292 output.writeUInt32NoTag(10);
293 output.writeUInt32NoTag(varsMemoizedSerializedSize);
295 for (
int i = 0; i < vars_.size(); i++) {
296 output.writeInt32NoTag(vars_.getInt(i));
298 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
299 output.writeDouble(2, offset_);
301 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
302 output.writeDouble(3, scalingFactor_);
305 output.writeUInt32NoTag(34);
306 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
308 for (
int i = 0; i < coeffs_.size(); i++) {
309 output.writeInt64NoTag(coeffs_.getLong(i));
312 output.writeUInt32NoTag(42);
313 output.writeUInt32NoTag(domainMemoizedSerializedSize);
315 for (
int i = 0; i < domain_.size(); i++) {
316 output.writeInt64NoTag(domain_.getLong(i));
318 if (scalingWasExact_ !=
false) {
319 output.writeBool(6, scalingWasExact_);
321 if (integerBeforeOffset_ != 0L) {
322 output.writeInt64(7, integerBeforeOffset_);
324 if (integerScalingFactor_ != 0L) {
325 output.writeInt64(8, integerScalingFactor_);
327 if (integerAfterOffset_ != 0L) {
328 output.writeInt64(9, integerAfterOffset_);
330 getUnknownFields().writeTo(output);
335 int size = memoizedSize;
336 if (size != -1)
return size;
341 for (
int i = 0; i < vars_.size(); i++) {
342 dataSize += com.google.protobuf.CodedOutputStream
343 .computeInt32SizeNoTag(vars_.getInt(i));
348 size += com.google.protobuf.CodedOutputStream
349 .computeInt32SizeNoTag(dataSize);
351 varsMemoizedSerializedSize = dataSize;
353 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
354 size += com.google.protobuf.CodedOutputStream
355 .computeDoubleSize(2, offset_);
357 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
358 size += com.google.protobuf.CodedOutputStream
359 .computeDoubleSize(3, scalingFactor_);
363 for (
int i = 0; i < coeffs_.size(); i++) {
364 dataSize += com.google.protobuf.CodedOutputStream
365 .computeInt64SizeNoTag(coeffs_.getLong(i));
370 size += com.google.protobuf.CodedOutputStream
371 .computeInt32SizeNoTag(dataSize);
373 coeffsMemoizedSerializedSize = dataSize;
377 for (
int i = 0; i < domain_.size(); i++) {
378 dataSize += com.google.protobuf.CodedOutputStream
379 .computeInt64SizeNoTag(domain_.getLong(i));
384 size += com.google.protobuf.CodedOutputStream
385 .computeInt32SizeNoTag(dataSize);
387 domainMemoizedSerializedSize = dataSize;
389 if (scalingWasExact_ !=
false) {
390 size += com.google.protobuf.CodedOutputStream
391 .computeBoolSize(6, scalingWasExact_);
393 if (integerBeforeOffset_ != 0L) {
394 size += com.google.protobuf.CodedOutputStream
395 .computeInt64Size(7, integerBeforeOffset_);
397 if (integerScalingFactor_ != 0L) {
398 size += com.google.protobuf.CodedOutputStream
399 .computeInt64Size(8, integerScalingFactor_);
401 if (integerAfterOffset_ != 0L) {
402 size += com.google.protobuf.CodedOutputStream
403 .computeInt64Size(9, integerAfterOffset_);
405 size += getUnknownFields().getSerializedSize();
411 public boolean equals(
final java.lang.Object obj) {
415 if (!(obj instanceof com.google.ortools.sat.CpObjectiveProto)) {
416 return super.equals(obj);
424 if (java.lang.Double.doubleToLongBits(
getOffset())
425 != java.lang.Double.doubleToLongBits(
428 != java.lang.Double.doubleToLongBits(
440 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
446 if (memoizedHashCode != 0) {
447 return memoizedHashCode;
460 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
461 java.lang.Double.doubleToLongBits(
getOffset()));
463 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
470 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
473 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
476 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
479 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
481 hash = (29 * hash) + getUnknownFields().hashCode();
482 memoizedHashCode = hash;
487 java.nio.ByteBuffer data)
488 throws com.google.protobuf.InvalidProtocolBufferException {
489 return PARSER.parseFrom(data);
492 java.nio.ByteBuffer data,
493 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
494 throws com.google.protobuf.InvalidProtocolBufferException {
495 return PARSER.parseFrom(data, extensionRegistry);
498 com.google.protobuf.ByteString data)
499 throws com.google.protobuf.InvalidProtocolBufferException {
500 return PARSER.parseFrom(data);
503 com.google.protobuf.ByteString data,
504 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
505 throws com.google.protobuf.InvalidProtocolBufferException {
506 return PARSER.parseFrom(data, extensionRegistry);
509 throws com.google.protobuf.InvalidProtocolBufferException {
510 return PARSER.parseFrom(data);
514 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
515 throws com.google.protobuf.InvalidProtocolBufferException {
516 return PARSER.parseFrom(data, extensionRegistry);
519 throws java.io.IOException {
520 return com.google.protobuf.GeneratedMessage
521 .parseWithIOException(PARSER, input);
524 java.io.InputStream input,
525 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
526 throws java.io.IOException {
527 return com.google.protobuf.GeneratedMessage
528 .parseWithIOException(PARSER, input, extensionRegistry);
532 throws java.io.IOException {
533 return com.google.protobuf.GeneratedMessage
534 .parseDelimitedWithIOException(PARSER, input);
538 java.io.InputStream input,
539 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
540 throws java.io.IOException {
541 return com.google.protobuf.GeneratedMessage
542 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
545 com.google.protobuf.CodedInputStream input)
546 throws java.io.IOException {
547 return com.google.protobuf.GeneratedMessage
548 .parseWithIOException(PARSER, input);
551 com.google.protobuf.CodedInputStream input,
552 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
553 throws java.io.IOException {
554 return com.google.protobuf.GeneratedMessage
555 .parseWithIOException(PARSER, input, extensionRegistry);
568 return this == DEFAULT_INSTANCE
574 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
586 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
589 public static final com.google.protobuf.Descriptors.Descriptor
591 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
595 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
597 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
598 .ensureFieldAccessorsInitialized(
599 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
608 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
616 vars_ = emptyIntList();
617 coeffs_ = emptyLongList();
620 domain_ = emptyLongList();
621 scalingWasExact_ =
false;
622 integerBeforeOffset_ = 0L;
623 integerAfterOffset_ = 0L;
624 integerScalingFactor_ = 0L;
629 public com.google.protobuf.Descriptors.Descriptor
631 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
636 return com.google.ortools.sat.CpObjectiveProto.getDefaultInstance();
643 throw newUninitializedMessageException(result);
651 if (bitField0_ != 0) { buildPartial0(result); }
656 private void buildPartial0(com.google.ortools.sat.CpObjectiveProto result) {
657 int from_bitField0_ = bitField0_;
658 if (((from_bitField0_ & 0x00000001) != 0)) {
659 vars_.makeImmutable();
660 result.vars_ = vars_;
662 if (((from_bitField0_ & 0x00000002) != 0)) {
663 coeffs_.makeImmutable();
664 result.coeffs_ = coeffs_;
666 if (((from_bitField0_ & 0x00000004) != 0)) {
667 result.offset_ = offset_;
669 if (((from_bitField0_ & 0x00000008) != 0)) {
670 result.scalingFactor_ = scalingFactor_;
672 if (((from_bitField0_ & 0x00000010) != 0)) {
673 domain_.makeImmutable();
674 result.domain_ = domain_;
676 if (((from_bitField0_ & 0x00000020) != 0)) {
677 result.scalingWasExact_ = scalingWasExact_;
679 if (((from_bitField0_ & 0x00000040) != 0)) {
680 result.integerBeforeOffset_ = integerBeforeOffset_;
682 if (((from_bitField0_ & 0x00000080) != 0)) {
683 result.integerAfterOffset_ = integerAfterOffset_;
685 if (((from_bitField0_ & 0x00000100) != 0)) {
686 result.integerScalingFactor_ = integerScalingFactor_;
692 if (other instanceof com.google.ortools.sat.CpObjectiveProto) {
693 return mergeFrom((com.google.ortools.sat.CpObjectiveProto)other);
695 super.mergeFrom(other);
701 if (other == com.google.ortools.sat.CpObjectiveProto.getDefaultInstance())
return this;
702 if (!other.vars_.isEmpty()) {
703 if (vars_.isEmpty()) {
705 vars_.makeImmutable();
706 bitField0_ |= 0x00000001;
708 ensureVarsIsMutable();
709 vars_.addAll(other.vars_);
713 if (!other.coeffs_.isEmpty()) {
714 if (coeffs_.isEmpty()) {
715 coeffs_ = other.coeffs_;
716 coeffs_.makeImmutable();
717 bitField0_ |= 0x00000002;
719 ensureCoeffsIsMutable();
720 coeffs_.addAll(other.coeffs_);
724 if (other.getOffset() != 0D) {
727 if (other.getScalingFactor() != 0D) {
730 if (!other.domain_.isEmpty()) {
731 if (domain_.isEmpty()) {
732 domain_ = other.domain_;
733 domain_.makeImmutable();
734 bitField0_ |= 0x00000010;
736 ensureDomainIsMutable();
737 domain_.addAll(other.domain_);
741 if (other.getScalingWasExact() !=
false) {
744 if (other.getIntegerBeforeOffset() != 0L) {
747 if (other.getIntegerAfterOffset() != 0L) {
750 if (other.getIntegerScalingFactor() != 0L) {
753 this.mergeUnknownFields(other.getUnknownFields());
765 com.google.protobuf.CodedInputStream input,
766 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
767 throws java.io.IOException {
768 if (extensionRegistry ==
null) {
769 throw new java.lang.NullPointerException();
772 boolean done =
false;
774 int tag = input.readTag();
780 int v = input.readInt32();
781 ensureVarsIsMutable();
786 int length = input.readRawVarint32();
787 int limit = input.pushLimit(length);
788 ensureVarsIsMutable();
789 while (input.getBytesUntilLimit() > 0) {
790 vars_.addInt(input.readInt32());
792 input.popLimit(limit);
796 offset_ = input.readDouble();
797 bitField0_ |= 0x00000004;
801 scalingFactor_ = input.readDouble();
802 bitField0_ |= 0x00000008;
806 long v = input.readInt64();
807 ensureCoeffsIsMutable();
812 int length = input.readRawVarint32();
813 int limit = input.pushLimit(length);
814 ensureCoeffsIsMutable();
815 while (input.getBytesUntilLimit() > 0) {
816 coeffs_.addLong(input.readInt64());
818 input.popLimit(limit);
822 long v = input.readInt64();
823 ensureDomainIsMutable();
828 int length = input.readRawVarint32();
829 int limit = input.pushLimit(length);
830 ensureDomainIsMutable();
831 while (input.getBytesUntilLimit() > 0) {
832 domain_.addLong(input.readInt64());
834 input.popLimit(limit);
838 scalingWasExact_ = input.readBool();
839 bitField0_ |= 0x00000020;
843 integerBeforeOffset_ = input.readInt64();
844 bitField0_ |= 0x00000040;
848 integerScalingFactor_ = input.readInt64();
849 bitField0_ |= 0x00000100;
853 integerAfterOffset_ = input.readInt64();
854 bitField0_ |= 0x00000080;
858 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
865 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
866 throw e.unwrapIOException();
872 private int bitField0_;
874 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
875 private void ensureVarsIsMutable() {
876 if (!vars_.isModifiable()) {
877 vars_ = makeMutableCopy(vars_);
879 bitField0_ |= 0x00000001;
891 public java.util.List<java.lang.Integer>
893 vars_.makeImmutable();
921 return vars_.getInt(index);
936 int index,
int value) {
938 ensureVarsIsMutable();
939 vars_.setInt(index, value);
940 bitField0_ |= 0x00000001;
957 ensureVarsIsMutable();
959 bitField0_ |= 0x00000001;
975 java.lang.Iterable<? extends java.lang.Integer> values) {
976 ensureVarsIsMutable();
977 com.google.protobuf.AbstractMessageLite.Builder.addAll(
979 bitField0_ |= 0x00000001;
994 vars_ = emptyIntList();
995 bitField0_ = (bitField0_ & ~0x00000001);
1000 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
1001 private void ensureCoeffsIsMutable() {
1002 if (!coeffs_.isModifiable()) {
1003 coeffs_ = makeMutableCopy(coeffs_);
1005 bitField0_ |= 0x00000002;
1011 public java.util.List<java.lang.Long>
1013 coeffs_.makeImmutable();
1021 return coeffs_.size();
1029 return coeffs_.getLong(index);
1038 int index,
long value) {
1040 ensureCoeffsIsMutable();
1041 coeffs_.setLong(index, value);
1042 bitField0_ |= 0x00000002;
1053 ensureCoeffsIsMutable();
1054 coeffs_.addLong(value);
1055 bitField0_ |= 0x00000002;
1065 java.lang.Iterable<? extends java.lang.Long> values) {
1066 ensureCoeffsIsMutable();
1067 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1069 bitField0_ |= 0x00000002;
1078 coeffs_ = emptyLongList();
1079 bitField0_ = (bitField0_ & ~0x00000002);
1084 private double offset_ ;
1121 bitField0_ |= 0x00000004;
1140 bitField0_ = (bitField0_ & ~0x00000004);
1146 private double scalingFactor_ ;
1153 return scalingFactor_;
1162 scalingFactor_ = value;
1163 bitField0_ |= 0x00000008;
1172 bitField0_ = (bitField0_ & ~0x00000008);
1173 scalingFactor_ = 0D;
1178 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
1179 private void ensureDomainIsMutable() {
1180 if (!domain_.isModifiable()) {
1181 domain_ = makeMutableCopy(domain_);
1183 bitField0_ |= 0x00000010;
1195 public java.util.List<java.lang.Long>
1197 domain_.makeImmutable();
1211 return domain_.size();
1225 return domain_.getLong(index);
1240 int index,
long value) {
1242 ensureDomainIsMutable();
1243 domain_.setLong(index, value);
1244 bitField0_ |= 0x00000010;
1261 ensureDomainIsMutable();
1262 domain_.addLong(value);
1263 bitField0_ |= 0x00000010;
1279 java.lang.Iterable<? extends java.lang.Long> values) {
1280 ensureDomainIsMutable();
1281 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1283 bitField0_ |= 0x00000010;
1298 domain_ = emptyLongList();
1299 bitField0_ = (bitField0_ & ~0x00000010);
1304 private boolean scalingWasExact_ ;
1319 return scalingWasExact_;
1336 scalingWasExact_ = value;
1337 bitField0_ |= 0x00000020;
1354 bitField0_ = (bitField0_ & ~0x00000020);
1355 scalingWasExact_ =
false;
1360 private long integerBeforeOffset_ ;
1382 return integerBeforeOffset_;
1406 integerBeforeOffset_ = value;
1407 bitField0_ |= 0x00000040;
1431 bitField0_ = (bitField0_ & ~0x00000040);
1432 integerBeforeOffset_ = 0L;
1437 private long integerAfterOffset_ ;
1444 return integerAfterOffset_;
1453 integerAfterOffset_ = value;
1454 bitField0_ |= 0x00000080;
1463 bitField0_ = (bitField0_ & ~0x00000080);
1464 integerAfterOffset_ = 0L;
1469 private long integerScalingFactor_ ;
1476 return integerScalingFactor_;
1485 integerScalingFactor_ = value;
1486 bitField0_ |= 0x00000100;
1495 bitField0_ = (bitField0_ & ~0x00000100);
1496 integerScalingFactor_ = 0L;
1507 DEFAULT_INSTANCE =
new com.google.ortools.sat.CpObjectiveProto();
1511 return DEFAULT_INSTANCE;
1518 com.google.protobuf.CodedInputStream input,
1519 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1520 throws com.google.protobuf.InvalidProtocolBufferException {
1523 builder.mergeFrom(input, extensionRegistry);
1524 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1525 throw e.setUnfinishedMessage(builder.buildPartial());
1526 }
catch (com.google.protobuf.UninitializedMessageException e) {
1527 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1528 }
catch (java.io.IOException e) {
1529 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1530 .setUnfinishedMessage(builder.buildPartial());
1532 return builder.buildPartial();
1547 return DEFAULT_INSTANCE;