5package com.google.ortools.sat;
15 com.google.protobuf.GeneratedMessageV3 implements
18private static final long serialVersionUID = 0L;
20 private LinearObjective(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
24 literals_ = emptyIntList();
25 coefficients_ = emptyLongList();
30 @SuppressWarnings({
"unused"})
32 UnusedPrivateParameter unused) {
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
42 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
44 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.sat.LinearObjective.class, com.google.ortools.sat.LinearObjective.Builder.class);
49 private int bitField0_;
51 @SuppressWarnings(
"serial")
52 private com.google.protobuf.Internal.IntList literals_ =
68 public java.util.List<java.lang.Integer>
86 return literals_.size();
103 return literals_.getInt(index);
107 @SuppressWarnings(
"serial")
108 private com.google.protobuf.Internal.LongList coefficients_ =
115 public java.util.List<java.lang.Long>
117 return coefficients_;
124 return coefficients_.size();
132 return coefficients_.getLong(index);
136 private double offset_ = 0D;
153 return ((bitField0_ & 0x00000001) != 0);
175 private double scalingFactor_ = 1D;
182 return ((bitField0_ & 0x00000002) != 0);
190 return scalingFactor_;
193 private byte memoizedIsInitialized = -1;
200 memoizedIsInitialized = 1;
205 public void writeTo(com.google.protobuf.CodedOutputStream output)
206 throws java.io.IOException {
207 for (
int i = 0; i < literals_.size(); i++) {
208 output.writeInt32(1, literals_.getInt(i));
210 for (
int i = 0; i < coefficients_.size(); i++) {
211 output.writeInt64(2, coefficients_.getLong(i));
213 if (((bitField0_ & 0x00000001) != 0)) {
214 output.writeDouble(3, offset_);
216 if (((bitField0_ & 0x00000002) != 0)) {
217 output.writeDouble(4, scalingFactor_);
219 getUnknownFields().writeTo(output);
224 int size = memoizedSize;
225 if (size != -1)
return size;
230 for (
int i = 0; i < literals_.size(); i++) {
231 dataSize += com.google.protobuf.CodedOutputStream
232 .computeInt32SizeNoTag(literals_.getInt(i));
239 for (
int i = 0; i < coefficients_.size(); i++) {
240 dataSize += com.google.protobuf.CodedOutputStream
241 .computeInt64SizeNoTag(coefficients_.getLong(i));
246 if (((bitField0_ & 0x00000001) != 0)) {
247 size += com.google.protobuf.CodedOutputStream
248 .computeDoubleSize(3, offset_);
250 if (((bitField0_ & 0x00000002) != 0)) {
251 size += com.google.protobuf.CodedOutputStream
252 .computeDoubleSize(4, scalingFactor_);
254 size += getUnknownFields().getSerializedSize();
260 public boolean equals(
final java.lang.Object obj) {
264 if (!(obj instanceof com.google.ortools.sat.LinearObjective)) {
265 return super.equals(obj);
275 if (java.lang.Double.doubleToLongBits(
getOffset())
276 != java.lang.Double.doubleToLongBits(
282 != java.lang.Double.doubleToLongBits(
285 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
291 if (memoizedHashCode != 0) {
292 return memoizedHashCode;
306 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
307 java.lang.Double.doubleToLongBits(
getOffset()));
311 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
314 hash = (29 * hash) + getUnknownFields().hashCode();
315 memoizedHashCode = hash;
320 java.nio.ByteBuffer data)
321 throws com.google.protobuf.InvalidProtocolBufferException {
325 java.nio.ByteBuffer data,
326 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
327 throws com.google.protobuf.InvalidProtocolBufferException {
331 com.google.protobuf.ByteString data)
332 throws com.google.protobuf.InvalidProtocolBufferException {
336 com.google.protobuf.ByteString data,
337 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338 throws com.google.protobuf.InvalidProtocolBufferException {
342 throws com.google.protobuf.InvalidProtocolBufferException {
347 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
348 throws com.google.protobuf.InvalidProtocolBufferException {
352 throws java.io.IOException {
353 return com.google.protobuf.GeneratedMessageV3
354 .parseWithIOException(
PARSER, input);
357 java.io.InputStream input,
358 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
359 throws java.io.IOException {
360 return com.google.protobuf.GeneratedMessageV3
361 .parseWithIOException(
PARSER, input, extensionRegistry);
365 throws java.io.IOException {
366 return com.google.protobuf.GeneratedMessageV3
367 .parseDelimitedWithIOException(
PARSER, input);
371 java.io.InputStream input,
372 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
373 throws java.io.IOException {
374 return com.google.protobuf.GeneratedMessageV3
375 .parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
378 com.google.protobuf.CodedInputStream input)
379 throws java.io.IOException {
380 return com.google.protobuf.GeneratedMessageV3
381 .parseWithIOException(
PARSER, input);
384 com.google.protobuf.CodedInputStream input,
385 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
386 throws java.io.IOException {
387 return com.google.protobuf.GeneratedMessageV3
388 .parseWithIOException(
PARSER, input, extensionRegistry);
401 return this == DEFAULT_INSTANCE
407 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
419 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
422 public static final com.google.protobuf.Descriptors.Descriptor
424 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
428 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
430 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_fieldAccessorTable
431 .ensureFieldAccessorsInitialized(
432 com.google.ortools.sat.LinearObjective.class, com.google.ortools.sat.LinearObjective.Builder.class);
441 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
449 literals_ = emptyIntList();
450 coefficients_ = emptyLongList();
457 public com.google.protobuf.Descriptors.Descriptor
459 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearObjective_descriptor;
464 return com.google.ortools.sat.LinearObjective.getDefaultInstance();
471 throw newUninitializedMessageException(result);
479 if (bitField0_ != 0) { buildPartial0(result); }
484 private void buildPartial0(com.google.ortools.sat.LinearObjective result) {
485 int from_bitField0_ = bitField0_;
486 if (((from_bitField0_ & 0x00000001) != 0)) {
487 literals_.makeImmutable();
488 result.literals_ = literals_;
490 if (((from_bitField0_ & 0x00000002) != 0)) {
491 coefficients_.makeImmutable();
492 result.coefficients_ = coefficients_;
494 int to_bitField0_ = 0;
495 if (((from_bitField0_ & 0x00000004) != 0)) {
496 result.offset_ = offset_;
497 to_bitField0_ |= 0x00000001;
499 if (((from_bitField0_ & 0x00000008) != 0)) {
500 result.scalingFactor_ = scalingFactor_;
501 to_bitField0_ |= 0x00000002;
503 result.bitField0_ |= to_bitField0_;
508 return super.
clone();
512 com.google.protobuf.Descriptors.FieldDescriptor field,
513 java.lang.Object value) {
514 return super.
setField(field, value);
518 com.google.protobuf.Descriptors.FieldDescriptor field) {
523 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
528 com.google.protobuf.Descriptors.FieldDescriptor field,
529 int index, java.lang.Object value) {
534 com.google.protobuf.Descriptors.FieldDescriptor field,
535 java.lang.Object value) {
540 if (other instanceof com.google.ortools.sat.LinearObjective) {
541 return mergeFrom((com.google.ortools.sat.LinearObjective)other);
543 super.mergeFrom(other);
549 if (other == com.google.ortools.sat.LinearObjective.getDefaultInstance())
return this;
550 if (!other.literals_.isEmpty()) {
551 if (literals_.isEmpty()) {
552 literals_ = other.literals_;
553 literals_.makeImmutable();
554 bitField0_ |= 0x00000001;
556 ensureLiteralsIsMutable();
557 literals_.addAll(other.literals_);
561 if (!other.coefficients_.isEmpty()) {
562 if (coefficients_.isEmpty()) {
563 coefficients_ = other.coefficients_;
564 coefficients_.makeImmutable();
565 bitField0_ |= 0x00000002;
567 ensureCoefficientsIsMutable();
568 coefficients_.addAll(other.coefficients_);
572 if (other.hasOffset()) {
575 if (other.hasScalingFactor()) {
590 com.google.protobuf.CodedInputStream input,
591 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
592 throws java.io.IOException {
593 if (extensionRegistry ==
null) {
594 throw new java.lang.NullPointerException();
597 boolean done =
false;
599 int tag = input.readTag();
605 int v = input.readInt32();
606 ensureLiteralsIsMutable();
611 int length = input.readRawVarint32();
612 int limit = input.pushLimit(length);
613 ensureLiteralsIsMutable();
614 while (input.getBytesUntilLimit() > 0) {
615 literals_.addInt(input.readInt32());
617 input.popLimit(limit);
621 long v = input.readInt64();
622 ensureCoefficientsIsMutable();
623 coefficients_.addLong(v);
627 int length = input.readRawVarint32();
628 int limit = input.pushLimit(length);
629 ensureCoefficientsIsMutable();
630 while (input.getBytesUntilLimit() > 0) {
631 coefficients_.addLong(input.readInt64());
633 input.popLimit(limit);
637 offset_ = input.readDouble();
638 bitField0_ |= 0x00000004;
642 scalingFactor_ = input.readDouble();
643 bitField0_ |= 0x00000008;
647 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
654 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
655 throw e.unwrapIOException();
661 private int bitField0_;
663 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
664 private void ensureLiteralsIsMutable() {
665 if (!literals_.isModifiable()) {
666 literals_ = makeMutableCopy(literals_);
668 bitField0_ |= 0x00000001;
683 public java.util.List<java.lang.Integer>
685 literals_.makeImmutable();
702 return literals_.size();
719 return literals_.getInt(index);
737 int index,
int value) {
739 ensureLiteralsIsMutable();
740 literals_.setInt(index, value);
741 bitField0_ |= 0x00000001;
761 ensureLiteralsIsMutable();
762 literals_.addInt(value);
763 bitField0_ |= 0x00000001;
782 java.lang.Iterable<? extends java.lang.Integer> values) {
783 ensureLiteralsIsMutable();
784 com.google.protobuf.AbstractMessageLite.Builder.addAll(
786 bitField0_ |= 0x00000001;
804 literals_ = emptyIntList();
805 bitField0_ = (bitField0_ & ~0x00000001);
810 private com.google.protobuf.Internal.LongList coefficients_ = emptyLongList();
811 private void ensureCoefficientsIsMutable() {
812 if (!coefficients_.isModifiable()) {
813 coefficients_ = makeMutableCopy(coefficients_);
815 bitField0_ |= 0x00000002;
821 public java.util.List<java.lang.Long>
823 coefficients_.makeImmutable();
824 return coefficients_;
831 return coefficients_.size();
839 return coefficients_.getLong(index);
848 int index,
long value) {
850 ensureCoefficientsIsMutable();
851 coefficients_.setLong(index, value);
852 bitField0_ |= 0x00000002;
863 ensureCoefficientsIsMutable();
864 coefficients_.addLong(value);
865 bitField0_ |= 0x00000002;
875 java.lang.Iterable<? extends java.lang.Long> values) {
876 ensureCoefficientsIsMutable();
877 com.google.protobuf.AbstractMessageLite.Builder.addAll(
878 values, coefficients_);
879 bitField0_ |= 0x00000002;
888 coefficients_ = emptyLongList();
889 bitField0_ = (bitField0_ & ~0x00000002);
894 private double offset_ ;
911 return ((bitField0_ & 0x00000004) != 0);
949 bitField0_ |= 0x00000004;
968 bitField0_ = (bitField0_ & ~0x00000004);
974 private double scalingFactor_ = 1D;
981 return ((bitField0_ & 0x00000008) != 0);
989 return scalingFactor_;
998 scalingFactor_ = value;
999 bitField0_ |= 0x00000008;
1008 bitField0_ = (bitField0_ & ~0x00000008);
1009 scalingFactor_ = 1D;
1015 final com.google.protobuf.UnknownFieldSet unknownFields) {
1021 final com.google.protobuf.UnknownFieldSet unknownFields) {
1032 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearObjective();
1036 return DEFAULT_INSTANCE;
1039 @java.lang.Deprecated
public static final com.google.protobuf.Parser<
LinearObjective>
1043 com.google.protobuf.CodedInputStream input,
1044 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1045 throws com.google.protobuf.InvalidProtocolBufferException {
1048 builder.
mergeFrom(input, extensionRegistry);
1049 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1051 }
catch (com.google.protobuf.UninitializedMessageException e) {
1052 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.
buildPartial());
1053 }
catch (java.io.IOException e) {
1054 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1072 return DEFAULT_INSTANCE;