5package com.google.ortools.sat;
15 com.google.protobuf.GeneratedMessageV3 implements
18private static final long serialVersionUID = 0L;
20 private CpObjectiveProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
24 vars_ = emptyIntList();
25 coeffs_ = emptyLongList();
26 domain_ = emptyLongList();
30 @SuppressWarnings({
"unused"})
32 UnusedPrivateParameter unused) {
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
42 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
44 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
50 @SuppressWarnings(
"serial")
51 private com.google.protobuf.Internal.IntList vars_ =
64 public java.util.List<java.lang.Integer>
93 return vars_.getInt(index);
95 private int varsMemoizedSerializedSize = -1;
98 @SuppressWarnings(
"serial")
99 private com.google.protobuf.Internal.LongList coeffs_ =
106 public java.util.List<java.lang.Long>
115 return coeffs_.size();
123 return coeffs_.getLong(index);
125 private int coeffsMemoizedSerializedSize = -1;
128 private double offset_ = 0D;
149 private double scalingFactor_ = 0D;
156 return scalingFactor_;
160 @SuppressWarnings(
"serial")
161 private com.google.protobuf.Internal.LongList domain_ =
174 public java.util.List<java.lang.Long>
189 return domain_.size();
203 return domain_.getLong(index);
205 private int domainMemoizedSerializedSize = -1;
208 private boolean scalingWasExact_ =
false;
223 return scalingWasExact_;
227 private long integerBeforeOffset_ = 0L;
249 return integerBeforeOffset_;
253 private long integerAfterOffset_ = 0L;
260 return integerAfterOffset_;
264 private long integerScalingFactor_ = 0L;
271 return integerScalingFactor_;
274 private byte memoizedIsInitialized = -1;
281 memoizedIsInitialized = 1;
286 public void writeTo(com.google.protobuf.CodedOutputStream output)
287 throws java.io.IOException {
290 output.writeUInt32NoTag(10);
291 output.writeUInt32NoTag(varsMemoizedSerializedSize);
293 for (
int i = 0; i < vars_.size(); i++) {
294 output.writeInt32NoTag(vars_.getInt(i));
296 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
297 output.writeDouble(2, offset_);
299 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
300 output.writeDouble(3, scalingFactor_);
303 output.writeUInt32NoTag(34);
304 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
306 for (
int i = 0; i < coeffs_.size(); i++) {
307 output.writeInt64NoTag(coeffs_.getLong(i));
310 output.writeUInt32NoTag(42);
311 output.writeUInt32NoTag(domainMemoizedSerializedSize);
313 for (
int i = 0; i < domain_.size(); i++) {
314 output.writeInt64NoTag(domain_.getLong(i));
316 if (scalingWasExact_ !=
false) {
317 output.writeBool(6, scalingWasExact_);
319 if (integerBeforeOffset_ != 0L) {
320 output.writeInt64(7, integerBeforeOffset_);
322 if (integerScalingFactor_ != 0L) {
323 output.writeInt64(8, integerScalingFactor_);
325 if (integerAfterOffset_ != 0L) {
326 output.writeInt64(9, integerAfterOffset_);
328 getUnknownFields().writeTo(output);
333 int size = memoizedSize;
334 if (size != -1)
return size;
339 for (
int i = 0; i < vars_.size(); i++) {
340 dataSize += com.google.protobuf.CodedOutputStream
341 .computeInt32SizeNoTag(vars_.getInt(i));
346 size += com.google.protobuf.CodedOutputStream
347 .computeInt32SizeNoTag(dataSize);
349 varsMemoizedSerializedSize = dataSize;
351 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
352 size += com.google.protobuf.CodedOutputStream
353 .computeDoubleSize(2, offset_);
355 if (java.lang.Double.doubleToRawLongBits(scalingFactor_) != 0) {
356 size += com.google.protobuf.CodedOutputStream
357 .computeDoubleSize(3, scalingFactor_);
361 for (
int i = 0; i < coeffs_.size(); i++) {
362 dataSize += com.google.protobuf.CodedOutputStream
363 .computeInt64SizeNoTag(coeffs_.getLong(i));
368 size += com.google.protobuf.CodedOutputStream
369 .computeInt32SizeNoTag(dataSize);
371 coeffsMemoizedSerializedSize = dataSize;
375 for (
int i = 0; i < domain_.size(); i++) {
376 dataSize += com.google.protobuf.CodedOutputStream
377 .computeInt64SizeNoTag(domain_.getLong(i));
382 size += com.google.protobuf.CodedOutputStream
383 .computeInt32SizeNoTag(dataSize);
385 domainMemoizedSerializedSize = dataSize;
387 if (scalingWasExact_ !=
false) {
388 size += com.google.protobuf.CodedOutputStream
389 .computeBoolSize(6, scalingWasExact_);
391 if (integerBeforeOffset_ != 0L) {
392 size += com.google.protobuf.CodedOutputStream
393 .computeInt64Size(7, integerBeforeOffset_);
395 if (integerScalingFactor_ != 0L) {
396 size += com.google.protobuf.CodedOutputStream
397 .computeInt64Size(8, integerScalingFactor_);
399 if (integerAfterOffset_ != 0L) {
400 size += com.google.protobuf.CodedOutputStream
401 .computeInt64Size(9, integerAfterOffset_);
403 size += getUnknownFields().getSerializedSize();
409 public boolean equals(
final java.lang.Object obj) {
413 if (!(obj instanceof com.google.ortools.sat.CpObjectiveProto)) {
414 return super.equals(obj);
422 if (java.lang.Double.doubleToLongBits(
getOffset())
423 != java.lang.Double.doubleToLongBits(
426 != java.lang.Double.doubleToLongBits(
438 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
444 if (memoizedHashCode != 0) {
445 return memoizedHashCode;
458 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
459 java.lang.Double.doubleToLongBits(
getOffset()));
461 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
468 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
471 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
474 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
477 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
479 hash = (29 * hash) + getUnknownFields().hashCode();
480 memoizedHashCode = hash;
485 java.nio.ByteBuffer data)
486 throws com.google.protobuf.InvalidProtocolBufferException {
487 return PARSER.parseFrom(data);
490 java.nio.ByteBuffer data,
491 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
492 throws com.google.protobuf.InvalidProtocolBufferException {
493 return PARSER.parseFrom(data, extensionRegistry);
496 com.google.protobuf.ByteString data)
497 throws com.google.protobuf.InvalidProtocolBufferException {
498 return PARSER.parseFrom(data);
501 com.google.protobuf.ByteString data,
502 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
503 throws com.google.protobuf.InvalidProtocolBufferException {
504 return PARSER.parseFrom(data, extensionRegistry);
507 throws com.google.protobuf.InvalidProtocolBufferException {
508 return PARSER.parseFrom(data);
512 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
513 throws com.google.protobuf.InvalidProtocolBufferException {
514 return PARSER.parseFrom(data, extensionRegistry);
517 throws java.io.IOException {
518 return com.google.protobuf.GeneratedMessageV3
519 .parseWithIOException(PARSER, input);
522 java.io.InputStream input,
523 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
524 throws java.io.IOException {
525 return com.google.protobuf.GeneratedMessageV3
526 .parseWithIOException(PARSER, input, extensionRegistry);
530 throws java.io.IOException {
531 return com.google.protobuf.GeneratedMessageV3
532 .parseDelimitedWithIOException(PARSER, input);
536 java.io.InputStream input,
537 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
538 throws java.io.IOException {
539 return com.google.protobuf.GeneratedMessageV3
540 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
543 com.google.protobuf.CodedInputStream input)
544 throws java.io.IOException {
545 return com.google.protobuf.GeneratedMessageV3
546 .parseWithIOException(PARSER, input);
549 com.google.protobuf.CodedInputStream input,
550 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
551 throws java.io.IOException {
552 return com.google.protobuf.GeneratedMessageV3
553 .parseWithIOException(PARSER, input, extensionRegistry);
566 return this == DEFAULT_INSTANCE
572 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
584 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
587 public static final com.google.protobuf.Descriptors.Descriptor
589 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
593 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
595 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_fieldAccessorTable
596 .ensureFieldAccessorsInitialized(
597 com.google.ortools.sat.CpObjectiveProto.class, com.google.ortools.sat.CpObjectiveProto.Builder.class);
606 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
614 vars_ = emptyIntList();
615 coeffs_ = emptyLongList();
618 domain_ = emptyLongList();
619 scalingWasExact_ =
false;
620 integerBeforeOffset_ = 0L;
621 integerAfterOffset_ = 0L;
622 integerScalingFactor_ = 0L;
627 public com.google.protobuf.Descriptors.Descriptor
629 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpObjectiveProto_descriptor;
634 return com.google.ortools.sat.CpObjectiveProto.getDefaultInstance();
641 throw newUninitializedMessageException(result);
649 if (bitField0_ != 0) { buildPartial0(result); }
654 private void buildPartial0(com.google.ortools.sat.CpObjectiveProto result) {
655 int from_bitField0_ = bitField0_;
656 if (((from_bitField0_ & 0x00000001) != 0)) {
657 vars_.makeImmutable();
658 result.vars_ = vars_;
660 if (((from_bitField0_ & 0x00000002) != 0)) {
661 coeffs_.makeImmutable();
662 result.coeffs_ = coeffs_;
664 if (((from_bitField0_ & 0x00000004) != 0)) {
665 result.offset_ = offset_;
667 if (((from_bitField0_ & 0x00000008) != 0)) {
668 result.scalingFactor_ = scalingFactor_;
670 if (((from_bitField0_ & 0x00000010) != 0)) {
671 domain_.makeImmutable();
672 result.domain_ = domain_;
674 if (((from_bitField0_ & 0x00000020) != 0)) {
675 result.scalingWasExact_ = scalingWasExact_;
677 if (((from_bitField0_ & 0x00000040) != 0)) {
678 result.integerBeforeOffset_ = integerBeforeOffset_;
680 if (((from_bitField0_ & 0x00000080) != 0)) {
681 result.integerAfterOffset_ = integerAfterOffset_;
683 if (((from_bitField0_ & 0x00000100) != 0)) {
684 result.integerScalingFactor_ = integerScalingFactor_;
690 return super.
clone();
694 com.google.protobuf.Descriptors.FieldDescriptor field,
695 java.lang.Object value) {
696 return super.
setField(field, value);
700 com.google.protobuf.Descriptors.FieldDescriptor field) {
705 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
710 com.google.protobuf.Descriptors.FieldDescriptor field,
711 int index, java.lang.Object value) {
716 com.google.protobuf.Descriptors.FieldDescriptor field,
717 java.lang.Object value) {
722 if (other instanceof com.google.ortools.sat.CpObjectiveProto) {
723 return mergeFrom((com.google.ortools.sat.CpObjectiveProto)other);
725 super.mergeFrom(other);
731 if (other == com.google.ortools.sat.CpObjectiveProto.getDefaultInstance())
return this;
732 if (!other.vars_.isEmpty()) {
733 if (vars_.isEmpty()) {
735 vars_.makeImmutable();
736 bitField0_ |= 0x00000001;
738 ensureVarsIsMutable();
739 vars_.addAll(other.vars_);
743 if (!other.coeffs_.isEmpty()) {
744 if (coeffs_.isEmpty()) {
745 coeffs_ = other.coeffs_;
746 coeffs_.makeImmutable();
747 bitField0_ |= 0x00000002;
749 ensureCoeffsIsMutable();
750 coeffs_.addAll(other.coeffs_);
754 if (other.getOffset() != 0D) {
757 if (other.getScalingFactor() != 0D) {
760 if (!other.domain_.isEmpty()) {
761 if (domain_.isEmpty()) {
762 domain_ = other.domain_;
763 domain_.makeImmutable();
764 bitField0_ |= 0x00000010;
766 ensureDomainIsMutable();
767 domain_.addAll(other.domain_);
771 if (other.getScalingWasExact() !=
false) {
774 if (other.getIntegerBeforeOffset() != 0L) {
777 if (other.getIntegerAfterOffset() != 0L) {
780 if (other.getIntegerScalingFactor() != 0L) {
795 com.google.protobuf.CodedInputStream input,
796 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
797 throws java.io.IOException {
798 if (extensionRegistry ==
null) {
799 throw new java.lang.NullPointerException();
802 boolean done =
false;
804 int tag = input.readTag();
810 int v = input.readInt32();
811 ensureVarsIsMutable();
816 int length = input.readRawVarint32();
817 int limit = input.pushLimit(length);
818 ensureVarsIsMutable();
819 while (input.getBytesUntilLimit() > 0) {
820 vars_.addInt(input.readInt32());
822 input.popLimit(limit);
826 offset_ = input.readDouble();
827 bitField0_ |= 0x00000004;
831 scalingFactor_ = input.readDouble();
832 bitField0_ |= 0x00000008;
836 long v = input.readInt64();
837 ensureCoeffsIsMutable();
842 int length = input.readRawVarint32();
843 int limit = input.pushLimit(length);
844 ensureCoeffsIsMutable();
845 while (input.getBytesUntilLimit() > 0) {
846 coeffs_.addLong(input.readInt64());
848 input.popLimit(limit);
852 long v = input.readInt64();
853 ensureDomainIsMutable();
858 int length = input.readRawVarint32();
859 int limit = input.pushLimit(length);
860 ensureDomainIsMutable();
861 while (input.getBytesUntilLimit() > 0) {
862 domain_.addLong(input.readInt64());
864 input.popLimit(limit);
868 scalingWasExact_ = input.readBool();
869 bitField0_ |= 0x00000020;
873 integerBeforeOffset_ = input.readInt64();
874 bitField0_ |= 0x00000040;
878 integerScalingFactor_ = input.readInt64();
879 bitField0_ |= 0x00000100;
883 integerAfterOffset_ = input.readInt64();
884 bitField0_ |= 0x00000080;
888 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
895 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
896 throw e.unwrapIOException();
902 private int bitField0_;
904 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
905 private void ensureVarsIsMutable() {
906 if (!vars_.isModifiable()) {
907 vars_ = makeMutableCopy(vars_);
909 bitField0_ |= 0x00000001;
921 public java.util.List<java.lang.Integer>
923 vars_.makeImmutable();
951 return vars_.getInt(index);
966 int index,
int value) {
968 ensureVarsIsMutable();
969 vars_.setInt(index, value);
970 bitField0_ |= 0x00000001;
987 ensureVarsIsMutable();
989 bitField0_ |= 0x00000001;
1005 java.lang.Iterable<? extends java.lang.Integer> values) {
1006 ensureVarsIsMutable();
1007 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1009 bitField0_ |= 0x00000001;
1024 vars_ = emptyIntList();
1025 bitField0_ = (bitField0_ & ~0x00000001);
1030 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
1031 private void ensureCoeffsIsMutable() {
1032 if (!coeffs_.isModifiable()) {
1033 coeffs_ = makeMutableCopy(coeffs_);
1035 bitField0_ |= 0x00000002;
1041 public java.util.List<java.lang.Long>
1043 coeffs_.makeImmutable();
1051 return coeffs_.size();
1059 return coeffs_.getLong(index);
1068 int index,
long value) {
1070 ensureCoeffsIsMutable();
1071 coeffs_.setLong(index, value);
1072 bitField0_ |= 0x00000002;
1083 ensureCoeffsIsMutable();
1084 coeffs_.addLong(value);
1085 bitField0_ |= 0x00000002;
1095 java.lang.Iterable<? extends java.lang.Long> values) {
1096 ensureCoeffsIsMutable();
1097 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1099 bitField0_ |= 0x00000002;
1108 coeffs_ = emptyLongList();
1109 bitField0_ = (bitField0_ & ~0x00000002);
1114 private double offset_ ;
1151 bitField0_ |= 0x00000004;
1170 bitField0_ = (bitField0_ & ~0x00000004);
1176 private double scalingFactor_ ;
1183 return scalingFactor_;
1192 scalingFactor_ = value;
1193 bitField0_ |= 0x00000008;
1202 bitField0_ = (bitField0_ & ~0x00000008);
1203 scalingFactor_ = 0D;
1208 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
1209 private void ensureDomainIsMutable() {
1210 if (!domain_.isModifiable()) {
1211 domain_ = makeMutableCopy(domain_);
1213 bitField0_ |= 0x00000010;
1225 public java.util.List<java.lang.Long>
1227 domain_.makeImmutable();
1241 return domain_.size();
1255 return domain_.getLong(index);
1270 int index,
long value) {
1272 ensureDomainIsMutable();
1273 domain_.setLong(index, value);
1274 bitField0_ |= 0x00000010;
1291 ensureDomainIsMutable();
1292 domain_.addLong(value);
1293 bitField0_ |= 0x00000010;
1309 java.lang.Iterable<? extends java.lang.Long> values) {
1310 ensureDomainIsMutable();
1311 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1313 bitField0_ |= 0x00000010;
1328 domain_ = emptyLongList();
1329 bitField0_ = (bitField0_ & ~0x00000010);
1334 private boolean scalingWasExact_ ;
1349 return scalingWasExact_;
1366 scalingWasExact_ = value;
1367 bitField0_ |= 0x00000020;
1384 bitField0_ = (bitField0_ & ~0x00000020);
1385 scalingWasExact_ =
false;
1390 private long integerBeforeOffset_ ;
1412 return integerBeforeOffset_;
1436 integerBeforeOffset_ = value;
1437 bitField0_ |= 0x00000040;
1461 bitField0_ = (bitField0_ & ~0x00000040);
1462 integerBeforeOffset_ = 0L;
1467 private long integerAfterOffset_ ;
1474 return integerAfterOffset_;
1483 integerAfterOffset_ = value;
1484 bitField0_ |= 0x00000080;
1493 bitField0_ = (bitField0_ & ~0x00000080);
1494 integerAfterOffset_ = 0L;
1499 private long integerScalingFactor_ ;
1506 return integerScalingFactor_;
1515 integerScalingFactor_ = value;
1516 bitField0_ |= 0x00000100;
1525 bitField0_ = (bitField0_ & ~0x00000100);
1526 integerScalingFactor_ = 0L;
1532 final com.google.protobuf.UnknownFieldSet unknownFields) {
1538 final com.google.protobuf.UnknownFieldSet unknownFields) {
1549 DEFAULT_INSTANCE =
new com.google.ortools.sat.CpObjectiveProto();
1553 return DEFAULT_INSTANCE;
1560 com.google.protobuf.CodedInputStream input,
1561 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1562 throws com.google.protobuf.InvalidProtocolBufferException {
1565 builder.mergeFrom(input, extensionRegistry);
1566 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1567 throw e.setUnfinishedMessage(builder.buildPartial());
1568 }
catch (com.google.protobuf.UninitializedMessageException e) {
1569 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1570 }
catch (java.io.IOException e) {
1571 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1572 .setUnfinishedMessage(builder.buildPartial());
1574 return builder.buildPartial();
1589 return DEFAULT_INSTANCE;