5package com.google.ortools.sat;
16 com.google.protobuf.GeneratedMessageV3 implements
19private static final long serialVersionUID = 0L;
25 vars_ = emptyIntList();
26 coeffs_ = emptyDoubleList();
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_FloatObjectiveProto_descriptor;
42 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
44 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
50 @SuppressWarnings(
"serial")
51 private com.google.protobuf.Internal.IntList vars_ =
58 public java.util.List<java.lang.Integer>
75 return vars_.getInt(index);
77 private int varsMemoizedSerializedSize = -1;
80 @SuppressWarnings(
"serial")
81 private com.google.protobuf.Internal.DoubleList coeffs_ =
88 public java.util.List<java.lang.Double>
97 return coeffs_.size();
105 return coeffs_.getDouble(index);
107 private int coeffsMemoizedSerializedSize = -1;
110 private double offset_ = 0D;
121 private boolean maximize_ =
false;
135 private byte memoizedIsInitialized = -1;
142 memoizedIsInitialized = 1;
147 public void writeTo(com.google.protobuf.CodedOutputStream output)
148 throws java.io.IOException {
151 output.writeUInt32NoTag(10);
152 output.writeUInt32NoTag(varsMemoizedSerializedSize);
154 for (
int i = 0; i < vars_.size(); i++) {
155 output.writeInt32NoTag(vars_.getInt(i));
158 output.writeUInt32NoTag(18);
159 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
161 for (
int i = 0; i < coeffs_.size(); i++) {
162 output.writeDoubleNoTag(coeffs_.getDouble(i));
164 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
165 output.writeDouble(3, offset_);
167 if (maximize_ !=
false) {
168 output.writeBool(4, maximize_);
170 getUnknownFields().writeTo(output);
175 int size = memoizedSize;
176 if (size != -1)
return size;
181 for (
int i = 0; i < vars_.size(); i++) {
182 dataSize += com.google.protobuf.CodedOutputStream
183 .computeInt32SizeNoTag(vars_.getInt(i));
188 size += com.google.protobuf.CodedOutputStream
189 .computeInt32SizeNoTag(dataSize);
191 varsMemoizedSerializedSize = dataSize;
199 size += com.google.protobuf.CodedOutputStream
200 .computeInt32SizeNoTag(dataSize);
202 coeffsMemoizedSerializedSize = dataSize;
204 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
205 size += com.google.protobuf.CodedOutputStream
206 .computeDoubleSize(3, offset_);
208 if (maximize_ !=
false) {
209 size += com.google.protobuf.CodedOutputStream
210 .computeBoolSize(4, maximize_);
212 size += getUnknownFields().getSerializedSize();
218 public boolean equals(
final java.lang.Object obj) {
222 if (!(obj instanceof com.google.ortools.sat.FloatObjectiveProto)) {
223 return super.equals(obj);
231 if (java.lang.Double.doubleToLongBits(
getOffset())
232 != java.lang.Double.doubleToLongBits(
236 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
242 if (memoizedHashCode != 0) {
243 return memoizedHashCode;
256 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
257 java.lang.Double.doubleToLongBits(
getOffset()));
259 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
261 hash = (29 * hash) + getUnknownFields().hashCode();
262 memoizedHashCode = hash;
267 java.nio.ByteBuffer data)
268 throws com.google.protobuf.InvalidProtocolBufferException {
269 return PARSER.parseFrom(data);
272 java.nio.ByteBuffer data,
273 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
274 throws com.google.protobuf.InvalidProtocolBufferException {
275 return PARSER.parseFrom(data, extensionRegistry);
278 com.google.protobuf.ByteString data)
279 throws com.google.protobuf.InvalidProtocolBufferException {
280 return PARSER.parseFrom(data);
283 com.google.protobuf.ByteString data,
284 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
285 throws com.google.protobuf.InvalidProtocolBufferException {
286 return PARSER.parseFrom(data, extensionRegistry);
289 throws com.google.protobuf.InvalidProtocolBufferException {
290 return PARSER.parseFrom(data);
294 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
295 throws com.google.protobuf.InvalidProtocolBufferException {
296 return PARSER.parseFrom(data, extensionRegistry);
299 throws java.io.IOException {
300 return com.google.protobuf.GeneratedMessageV3
301 .parseWithIOException(PARSER, input);
304 java.io.InputStream input,
305 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306 throws java.io.IOException {
307 return com.google.protobuf.GeneratedMessageV3
308 .parseWithIOException(PARSER, input, extensionRegistry);
312 throws java.io.IOException {
313 return com.google.protobuf.GeneratedMessageV3
314 .parseDelimitedWithIOException(PARSER, input);
318 java.io.InputStream input,
319 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
320 throws java.io.IOException {
321 return com.google.protobuf.GeneratedMessageV3
322 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
325 com.google.protobuf.CodedInputStream input)
326 throws java.io.IOException {
327 return com.google.protobuf.GeneratedMessageV3
328 .parseWithIOException(PARSER, input);
331 com.google.protobuf.CodedInputStream input,
332 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
333 throws java.io.IOException {
334 return com.google.protobuf.GeneratedMessageV3
335 .parseWithIOException(PARSER, input, extensionRegistry);
348 return this == DEFAULT_INSTANCE
354 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
367 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
370 public static final com.google.protobuf.Descriptors.Descriptor
372 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
376 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
378 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
379 .ensureFieldAccessorsInitialized(
380 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
389 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
397 vars_ = emptyIntList();
398 coeffs_ = emptyDoubleList();
405 public com.google.protobuf.Descriptors.Descriptor
407 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
412 return com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance();
419 throw newUninitializedMessageException(result);
427 if (bitField0_ != 0) { buildPartial0(result); }
432 private void buildPartial0(com.google.ortools.sat.FloatObjectiveProto result) {
433 int from_bitField0_ = bitField0_;
434 if (((from_bitField0_ & 0x00000001) != 0)) {
435 vars_.makeImmutable();
436 result.vars_ = vars_;
438 if (((from_bitField0_ & 0x00000002) != 0)) {
439 coeffs_.makeImmutable();
440 result.coeffs_ = coeffs_;
442 if (((from_bitField0_ & 0x00000004) != 0)) {
443 result.offset_ = offset_;
445 if (((from_bitField0_ & 0x00000008) != 0)) {
446 result.maximize_ = maximize_;
452 return super.
clone();
456 com.google.protobuf.Descriptors.FieldDescriptor field,
457 java.lang.Object value) {
458 return super.
setField(field, value);
462 com.google.protobuf.Descriptors.FieldDescriptor field) {
467 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
472 com.google.protobuf.Descriptors.FieldDescriptor field,
473 int index, java.lang.Object value) {
478 com.google.protobuf.Descriptors.FieldDescriptor field,
479 java.lang.Object value) {
484 if (other instanceof com.google.ortools.sat.FloatObjectiveProto) {
485 return mergeFrom((com.google.ortools.sat.FloatObjectiveProto)other);
487 super.mergeFrom(other);
493 if (other == com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance())
return this;
494 if (!other.vars_.isEmpty()) {
495 if (vars_.isEmpty()) {
497 vars_.makeImmutable();
498 bitField0_ |= 0x00000001;
500 ensureVarsIsMutable();
501 vars_.addAll(other.vars_);
505 if (!other.coeffs_.isEmpty()) {
506 if (coeffs_.isEmpty()) {
507 coeffs_ = other.coeffs_;
508 coeffs_.makeImmutable();
509 bitField0_ |= 0x00000002;
511 ensureCoeffsIsMutable();
512 coeffs_.addAll(other.coeffs_);
516 if (other.getOffset() != 0D) {
519 if (other.getMaximize() !=
false) {
534 com.google.protobuf.CodedInputStream input,
535 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
536 throws java.io.IOException {
537 if (extensionRegistry ==
null) {
538 throw new java.lang.NullPointerException();
541 boolean done =
false;
543 int tag = input.readTag();
549 int v = input.readInt32();
550 ensureVarsIsMutable();
555 int length = input.readRawVarint32();
556 int limit = input.pushLimit(length);
557 ensureVarsIsMutable();
558 while (input.getBytesUntilLimit() > 0) {
559 vars_.addInt(input.readInt32());
561 input.popLimit(limit);
565 double v = input.readDouble();
566 ensureCoeffsIsMutable();
567 coeffs_.addDouble(v);
571 int length = input.readRawVarint32();
572 int limit = input.pushLimit(length);
573 int alloc = length > 4096 ? 4096 : length;
574 ensureCoeffsIsMutable(alloc / 8);
575 while (input.getBytesUntilLimit() > 0) {
576 coeffs_.addDouble(input.readDouble());
578 input.popLimit(limit);
582 offset_ = input.readDouble();
583 bitField0_ |= 0x00000004;
587 maximize_ = input.readBool();
588 bitField0_ |= 0x00000008;
592 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
599 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
600 throw e.unwrapIOException();
606 private int bitField0_;
608 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
609 private void ensureVarsIsMutable() {
610 if (!vars_.isModifiable()) {
611 vars_ = makeMutableCopy(vars_);
613 bitField0_ |= 0x00000001;
619 public java.util.List<java.lang.Integer>
621 vars_.makeImmutable();
637 return vars_.getInt(index);
646 int index,
int value) {
648 ensureVarsIsMutable();
649 vars_.setInt(index, value);
650 bitField0_ |= 0x00000001;
661 ensureVarsIsMutable();
663 bitField0_ |= 0x00000001;
673 java.lang.Iterable<? extends java.lang.Integer> values) {
674 ensureVarsIsMutable();
675 com.google.protobuf.AbstractMessageLite.Builder.addAll(
677 bitField0_ |= 0x00000001;
686 vars_ = emptyIntList();
687 bitField0_ = (bitField0_ & ~0x00000001);
692 private com.google.protobuf.Internal.DoubleList coeffs_ = emptyDoubleList();
693 private void ensureCoeffsIsMutable() {
694 if (!coeffs_.isModifiable()) {
695 coeffs_ = makeMutableCopy(coeffs_);
697 bitField0_ |= 0x00000002;
699 private void ensureCoeffsIsMutable(
int capacity) {
700 if (!coeffs_.isModifiable()) {
701 coeffs_ = makeMutableCopy(coeffs_, capacity);
703 bitField0_ |= 0x00000002;
709 public java.util.List<java.lang.Double>
711 coeffs_.makeImmutable();
719 return coeffs_.size();
727 return coeffs_.getDouble(index);
736 int index,
double value) {
738 ensureCoeffsIsMutable();
739 coeffs_.setDouble(index, value);
740 bitField0_ |= 0x00000002;
751 ensureCoeffsIsMutable();
752 coeffs_.addDouble(value);
753 bitField0_ |= 0x00000002;
763 java.lang.Iterable<? extends java.lang.Double> values) {
764 ensureCoeffsIsMutable();
765 com.google.protobuf.AbstractMessageLite.Builder.addAll(
767 bitField0_ |= 0x00000002;
776 coeffs_ = emptyDoubleList();
777 bitField0_ = (bitField0_ & ~0x00000002);
782 private double offset_ ;
799 bitField0_ |= 0x00000004;
808 bitField0_ = (bitField0_ & ~0x00000004);
814 private boolean maximize_ ;
839 bitField0_ |= 0x00000008;
852 bitField0_ = (bitField0_ & ~0x00000008);
859 final com.google.protobuf.UnknownFieldSet unknownFields) {
865 final com.google.protobuf.UnknownFieldSet unknownFields) {
876 DEFAULT_INSTANCE =
new com.google.ortools.sat.FloatObjectiveProto();
880 return DEFAULT_INSTANCE;
887 com.google.protobuf.CodedInputStream input,
888 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
889 throws com.google.protobuf.InvalidProtocolBufferException {
892 builder.mergeFrom(input, extensionRegistry);
893 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
894 throw e.setUnfinishedMessage(builder.buildPartial());
895 }
catch (com.google.protobuf.UninitializedMessageException e) {
896 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
897 }
catch (java.io.IOException e) {
898 throw new com.google.protobuf.InvalidProtocolBufferException(e)
899 .setUnfinishedMessage(builder.buildPartial());
901 return builder.buildPartial();
916 return DEFAULT_INSTANCE;