6package com.google.ortools.sat;
16public final class FloatObjectiveProto
extends
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
28 FloatObjectiveProto.class.getName());
31 private FloatObjectiveProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 private FloatObjectiveProto() {
35 vars_ = emptyIntList();
36 coeffs_ = emptyDoubleList();
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList vars_ =
61 public java.
util.List<java.lang.Integer>
78 return vars_.getInt(index);
80 private int varsMemoizedSerializedSize = -1;
83 @SuppressWarnings(
"serial")
84 private com.google.protobuf.Internal.DoubleList coeffs_ =
91 public java.
util.List<java.lang.Double>
100 return coeffs_.size();
108 return coeffs_.getDouble(index);
110 private int coeffsMemoizedSerializedSize = -1;
113 private double offset_ = 0D;
124 private boolean maximize_ =
false;
138 private byte memoizedIsInitialized = -1;
145 memoizedIsInitialized = 1;
150 public void writeTo(com.google.protobuf.CodedOutputStream output)
151 throws java.io.IOException {
154 output.writeUInt32NoTag(10);
155 output.writeUInt32NoTag(varsMemoizedSerializedSize);
157 for (
int i = 0; i < vars_.size(); i++) {
158 output.writeInt32NoTag(vars_.getInt(i));
161 output.writeUInt32NoTag(18);
162 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
164 for (
int i = 0; i < coeffs_.size(); i++) {
165 output.writeDoubleNoTag(coeffs_.getDouble(i));
167 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
168 output.writeDouble(3, offset_);
170 if (maximize_ !=
false) {
171 output.writeBool(4, maximize_);
173 getUnknownFields().writeTo(output);
178 int size = memoizedSize;
179 if (size != -1)
return size;
184 for (
int i = 0; i < vars_.size(); i++) {
185 dataSize += com.google.protobuf.CodedOutputStream
186 .computeInt32SizeNoTag(vars_.getInt(i));
191 size += com.google.protobuf.CodedOutputStream
192 .computeInt32SizeNoTag(dataSize);
194 varsMemoizedSerializedSize = dataSize;
202 size += com.google.protobuf.CodedOutputStream
203 .computeInt32SizeNoTag(dataSize);
205 coeffsMemoizedSerializedSize = dataSize;
207 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
208 size += com.google.protobuf.CodedOutputStream
209 .computeDoubleSize(3, offset_);
211 if (maximize_ !=
false) {
212 size += com.google.protobuf.CodedOutputStream
213 .computeBoolSize(4, maximize_);
215 size += getUnknownFields().getSerializedSize();
221 public boolean equals(
final java.lang.Object obj) {
225 if (!(obj instanceof com.google.ortools.sat.FloatObjectiveProto)) {
226 return super.equals(obj);
234 if (java.lang.Double.doubleToLongBits(
getOffset())
235 != java.lang.Double.doubleToLongBits(
239 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
245 if (memoizedHashCode != 0) {
246 return memoizedHashCode;
259 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
260 java.lang.Double.doubleToLongBits(
getOffset()));
262 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
264 hash = (29 * hash) + getUnknownFields().hashCode();
265 memoizedHashCode = hash;
270 java.nio.ByteBuffer data)
271 throws com.google.protobuf.InvalidProtocolBufferException {
272 return PARSER.parseFrom(data);
275 java.nio.ByteBuffer data,
276 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
277 throws com.google.protobuf.InvalidProtocolBufferException {
278 return PARSER.parseFrom(data, extensionRegistry);
281 com.google.protobuf.ByteString data)
282 throws com.google.protobuf.InvalidProtocolBufferException {
283 return PARSER.parseFrom(data);
286 com.google.protobuf.ByteString data,
287 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
288 throws com.google.protobuf.InvalidProtocolBufferException {
289 return PARSER.parseFrom(data, extensionRegistry);
292 throws com.google.protobuf.InvalidProtocolBufferException {
293 return PARSER.parseFrom(data);
297 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
298 throws com.google.protobuf.InvalidProtocolBufferException {
299 return PARSER.parseFrom(data, extensionRegistry);
302 throws java.io.IOException {
303 return com.google.protobuf.GeneratedMessage
304 .parseWithIOException(PARSER, input);
307 java.io.InputStream input,
308 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
309 throws java.io.IOException {
310 return com.google.protobuf.GeneratedMessage
311 .parseWithIOException(PARSER, input, extensionRegistry);
315 throws java.io.IOException {
316 return com.google.protobuf.GeneratedMessage
317 .parseDelimitedWithIOException(PARSER, input);
321 java.io.InputStream input,
322 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
323 throws java.io.IOException {
324 return com.google.protobuf.GeneratedMessage
325 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
328 com.google.protobuf.CodedInputStream input)
329 throws java.io.IOException {
330 return com.google.protobuf.GeneratedMessage
331 .parseWithIOException(PARSER, input);
334 com.google.protobuf.CodedInputStream input,
335 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
336 throws java.io.IOException {
337 return com.google.protobuf.GeneratedMessage
338 .parseWithIOException(PARSER, input, extensionRegistry);
344 return DEFAULT_INSTANCE.toBuilder();
347 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
351 return this == DEFAULT_INSTANCE
357 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
369 public static final class Builder
extends
370 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
373 public static final com.google.protobuf.Descriptors.Descriptor
375 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
379 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
381 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
382 .ensureFieldAccessorsInitialized(
383 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
392 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
400 vars_ = emptyIntList();
401 coeffs_ = emptyDoubleList();
408 public com.google.protobuf.Descriptors.Descriptor
410 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
415 return com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance();
422 throw newUninitializedMessageException(result);
430 if (bitField0_ != 0) { buildPartial0(result); }
435 private void buildPartial0(com.google.ortools.sat.FloatObjectiveProto result) {
436 int from_bitField0_ = bitField0_;
437 if (((from_bitField0_ & 0x00000001) != 0)) {
438 vars_.makeImmutable();
439 result.vars_ = vars_;
441 if (((from_bitField0_ & 0x00000002) != 0)) {
442 coeffs_.makeImmutable();
443 result.coeffs_ = coeffs_;
445 if (((from_bitField0_ & 0x00000004) != 0)) {
446 result.offset_ = offset_;
448 if (((from_bitField0_ & 0x00000008) != 0)) {
449 result.maximize_ = maximize_;
454 public Builder
mergeFrom(com.google.protobuf.Message other) {
455 if (other instanceof com.google.ortools.sat.FloatObjectiveProto) {
456 return mergeFrom((com.google.ortools.sat.FloatObjectiveProto)other);
458 super.mergeFrom(other);
463 public Builder
mergeFrom(com.google.ortools.sat.FloatObjectiveProto other) {
464 if (other == com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance())
return this;
465 if (!other.vars_.isEmpty()) {
466 if (vars_.isEmpty()) {
468 vars_.makeImmutable();
469 bitField0_ |= 0x00000001;
471 ensureVarsIsMutable();
472 vars_.addAll(other.vars_);
476 if (!other.coeffs_.isEmpty()) {
477 if (coeffs_.isEmpty()) {
478 coeffs_ = other.coeffs_;
479 coeffs_.makeImmutable();
480 bitField0_ |= 0x00000002;
482 ensureCoeffsIsMutable();
483 coeffs_.addAll(other.coeffs_);
487 if (other.getOffset() != 0D) {
490 if (other.getMaximize() !=
false) {
493 this.mergeUnknownFields(other.getUnknownFields());
505 com.google.protobuf.CodedInputStream input,
506 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
507 throws java.io.IOException {
508 if (extensionRegistry ==
null) {
509 throw new java.lang.NullPointerException();
512 boolean done =
false;
514 int tag = input.readTag();
520 int v = input.readInt32();
521 ensureVarsIsMutable();
526 int length = input.readRawVarint32();
527 int limit = input.pushLimit(length);
528 ensureVarsIsMutable();
529 while (input.getBytesUntilLimit() > 0) {
530 vars_.addInt(input.readInt32());
532 input.popLimit(limit);
536 double v = input.readDouble();
537 ensureCoeffsIsMutable();
538 coeffs_.addDouble(v);
542 int length = input.readRawVarint32();
543 int limit = input.pushLimit(length);
544 int alloc = length > 4096 ? 4096 : length;
545 ensureCoeffsIsMutable(alloc / 8);
546 while (input.getBytesUntilLimit() > 0) {
547 coeffs_.addDouble(input.readDouble());
549 input.popLimit(limit);
553 offset_ = input.readDouble();
554 bitField0_ |= 0x00000004;
558 maximize_ = input.readBool();
559 bitField0_ |= 0x00000008;
563 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
570 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
571 throw e.unwrapIOException();
577 private int bitField0_;
579 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
580 private void ensureVarsIsMutable() {
581 if (!vars_.isModifiable()) {
582 vars_ = makeMutableCopy(vars_);
584 bitField0_ |= 0x00000001;
590 public java.util.List<java.lang.Integer>
592 vars_.makeImmutable();
608 return vars_.getInt(index);
617 int index,
int value) {
619 ensureVarsIsMutable();
620 vars_.setInt(index, value);
621 bitField0_ |= 0x00000001;
632 ensureVarsIsMutable();
634 bitField0_ |= 0x00000001;
644 java.lang.Iterable<? extends java.lang.Integer> values) {
645 ensureVarsIsMutable();
646 com.google.protobuf.AbstractMessageLite.Builder.addAll(
648 bitField0_ |= 0x00000001;
657 vars_ = emptyIntList();
658 bitField0_ = (bitField0_ & ~0x00000001);
663 private com.google.protobuf.Internal.DoubleList coeffs_ = emptyDoubleList();
664 private void ensureCoeffsIsMutable() {
665 if (!coeffs_.isModifiable()) {
666 coeffs_ = makeMutableCopy(coeffs_);
668 bitField0_ |= 0x00000002;
670 private void ensureCoeffsIsMutable(
int capacity) {
671 if (!coeffs_.isModifiable()) {
672 coeffs_ = makeMutableCopy(coeffs_, capacity);
674 bitField0_ |= 0x00000002;
680 public java.util.List<java.lang.Double>
682 coeffs_.makeImmutable();
690 return coeffs_.size();
698 return coeffs_.getDouble(index);
707 int index,
double value) {
709 ensureCoeffsIsMutable();
710 coeffs_.setDouble(index, value);
711 bitField0_ |= 0x00000002;
722 ensureCoeffsIsMutable();
723 coeffs_.addDouble(value);
724 bitField0_ |= 0x00000002;
734 java.lang.Iterable<? extends java.lang.Double> values) {
735 ensureCoeffsIsMutable();
736 com.google.protobuf.AbstractMessageLite.Builder.addAll(
738 bitField0_ |= 0x00000002;
747 coeffs_ = emptyDoubleList();
748 bitField0_ = (bitField0_ & ~0x00000002);
753 private double offset_ ;
770 bitField0_ |= 0x00000004;
779 bitField0_ = (bitField0_ & ~0x00000004);
785 private boolean maximize_ ;
810 bitField0_ |= 0x00000008;
823 bitField0_ = (bitField0_ & ~0x00000008);
835 DEFAULT_INSTANCE =
new com.google.ortools.sat.FloatObjectiveProto();
839 return DEFAULT_INSTANCE;
846 com.google.protobuf.CodedInputStream input,
847 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
848 throws com.google.protobuf.InvalidProtocolBufferException {
851 builder.mergeFrom(input, extensionRegistry);
852 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
853 throw e.setUnfinishedMessage(builder.buildPartial());
854 }
catch (com.google.protobuf.UninitializedMessageException e) {
855 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
856 }
catch (java.io.IOException e) {
857 throw new com.google.protobuf.InvalidProtocolBufferException(e)
858 .setUnfinishedMessage(builder.buildPartial());
860 return builder.buildPartial();
864 public static com.google.protobuf.Parser<FloatObjectiveProto>
parser() {
875 return DEFAULT_INSTANCE;