6package com.google.ortools.sat;
16@com.google.protobuf.Generated
17public final class FloatObjectiveProto
extends
18 com.google.protobuf.GeneratedMessage implements
21private static final long serialVersionUID = 0L;
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 FloatObjectiveProto.class.getName());
32 private FloatObjectiveProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
35 private FloatObjectiveProto() {
36 vars_ = emptyIntList();
37 coeffs_ = emptyDoubleList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList vars_ =
62 public java.
util.List<java.lang.Integer>
79 return vars_.getInt(index);
81 private int varsMemoizedSerializedSize = -1;
84 @SuppressWarnings(
"serial")
85 private com.google.protobuf.Internal.DoubleList coeffs_ =
92 public java.
util.List<java.lang.Double>
101 return coeffs_.size();
109 return coeffs_.getDouble(index);
111 private int coeffsMemoizedSerializedSize = -1;
114 private double offset_ = 0D;
125 private boolean maximize_ =
false;
139 private byte memoizedIsInitialized = -1;
146 memoizedIsInitialized = 1;
151 public void writeTo(com.google.protobuf.CodedOutputStream output)
152 throws java.io.IOException {
155 output.writeUInt32NoTag(10);
156 output.writeUInt32NoTag(varsMemoizedSerializedSize);
158 for (
int i = 0; i < vars_.size(); i++) {
159 output.writeInt32NoTag(vars_.getInt(i));
162 output.writeUInt32NoTag(18);
163 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
165 for (
int i = 0; i < coeffs_.size(); i++) {
166 output.writeDoubleNoTag(coeffs_.getDouble(i));
168 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
169 output.writeDouble(3, offset_);
171 if (maximize_ !=
false) {
172 output.writeBool(4, maximize_);
174 getUnknownFields().writeTo(output);
179 int size = memoizedSize;
180 if (size != -1)
return size;
185 for (
int i = 0; i < vars_.size(); i++) {
186 dataSize += com.google.protobuf.CodedOutputStream
187 .computeInt32SizeNoTag(vars_.getInt(i));
192 size += com.google.protobuf.CodedOutputStream
193 .computeInt32SizeNoTag(dataSize);
195 varsMemoizedSerializedSize = dataSize;
203 size += com.google.protobuf.CodedOutputStream
204 .computeInt32SizeNoTag(dataSize);
206 coeffsMemoizedSerializedSize = dataSize;
208 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
209 size += com.google.protobuf.CodedOutputStream
210 .computeDoubleSize(3, offset_);
212 if (maximize_ !=
false) {
213 size += com.google.protobuf.CodedOutputStream
214 .computeBoolSize(4, maximize_);
216 size += getUnknownFields().getSerializedSize();
222 public boolean equals(
final java.lang.Object obj) {
226 if (!(obj instanceof com.google.ortools.sat.FloatObjectiveProto)) {
227 return super.equals(obj);
235 if (java.lang.Double.doubleToLongBits(
getOffset())
236 != java.lang.Double.doubleToLongBits(
240 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
246 if (memoizedHashCode != 0) {
247 return memoizedHashCode;
260 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
261 java.lang.Double.doubleToLongBits(
getOffset()));
263 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
265 hash = (29 * hash) + getUnknownFields().hashCode();
266 memoizedHashCode = hash;
271 java.nio.ByteBuffer data)
272 throws com.google.protobuf.InvalidProtocolBufferException {
273 return PARSER.parseFrom(data);
276 java.nio.ByteBuffer data,
277 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
278 throws com.google.protobuf.InvalidProtocolBufferException {
279 return PARSER.parseFrom(data, extensionRegistry);
282 com.google.protobuf.ByteString data)
283 throws com.google.protobuf.InvalidProtocolBufferException {
284 return PARSER.parseFrom(data);
287 com.google.protobuf.ByteString data,
288 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
289 throws com.google.protobuf.InvalidProtocolBufferException {
290 return PARSER.parseFrom(data, extensionRegistry);
293 throws com.google.protobuf.InvalidProtocolBufferException {
294 return PARSER.parseFrom(data);
298 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
299 throws com.google.protobuf.InvalidProtocolBufferException {
300 return PARSER.parseFrom(data, extensionRegistry);
303 throws java.io.IOException {
304 return com.google.protobuf.GeneratedMessage
305 .parseWithIOException(PARSER, input);
308 java.io.InputStream input,
309 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
310 throws java.io.IOException {
311 return com.google.protobuf.GeneratedMessage
312 .parseWithIOException(PARSER, input, extensionRegistry);
316 throws java.io.IOException {
317 return com.google.protobuf.GeneratedMessage
318 .parseDelimitedWithIOException(PARSER, input);
322 java.io.InputStream input,
323 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
324 throws java.io.IOException {
325 return com.google.protobuf.GeneratedMessage
326 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
329 com.google.protobuf.CodedInputStream input)
330 throws java.io.IOException {
331 return com.google.protobuf.GeneratedMessage
332 .parseWithIOException(PARSER, input);
335 com.google.protobuf.CodedInputStream input,
336 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
337 throws java.io.IOException {
338 return com.google.protobuf.GeneratedMessage
339 .parseWithIOException(PARSER, input, extensionRegistry);
345 return DEFAULT_INSTANCE.toBuilder();
348 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
352 return this == DEFAULT_INSTANCE
358 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
370 public static final class Builder
extends
371 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
374 public static final com.google.protobuf.Descriptors.Descriptor
376 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
380 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
382 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
383 .ensureFieldAccessorsInitialized(
384 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
393 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
401 vars_ = emptyIntList();
402 coeffs_ = emptyDoubleList();
409 public com.google.protobuf.Descriptors.Descriptor
411 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
416 return com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance();
423 throw newUninitializedMessageException(result);
431 if (bitField0_ != 0) { buildPartial0(result); }
436 private void buildPartial0(com.google.ortools.sat.FloatObjectiveProto result) {
437 int from_bitField0_ = bitField0_;
438 if (((from_bitField0_ & 0x00000001) != 0)) {
439 vars_.makeImmutable();
440 result.vars_ = vars_;
442 if (((from_bitField0_ & 0x00000002) != 0)) {
443 coeffs_.makeImmutable();
444 result.coeffs_ = coeffs_;
446 if (((from_bitField0_ & 0x00000004) != 0)) {
447 result.offset_ = offset_;
449 if (((from_bitField0_ & 0x00000008) != 0)) {
450 result.maximize_ = maximize_;
455 public Builder
mergeFrom(com.google.protobuf.Message other) {
456 if (other instanceof com.google.ortools.sat.FloatObjectiveProto) {
457 return mergeFrom((com.google.ortools.sat.FloatObjectiveProto)other);
459 super.mergeFrom(other);
464 public Builder
mergeFrom(com.google.ortools.sat.FloatObjectiveProto other) {
465 if (other == com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance())
return this;
466 if (!other.vars_.isEmpty()) {
467 if (vars_.isEmpty()) {
469 vars_.makeImmutable();
470 bitField0_ |= 0x00000001;
472 ensureVarsIsMutable();
473 vars_.addAll(other.vars_);
477 if (!other.coeffs_.isEmpty()) {
478 if (coeffs_.isEmpty()) {
479 coeffs_ = other.coeffs_;
480 coeffs_.makeImmutable();
481 bitField0_ |= 0x00000002;
483 ensureCoeffsIsMutable();
484 coeffs_.addAll(other.coeffs_);
488 if (java.lang.Double.doubleToRawLongBits(other.getOffset()) != 0) {
491 if (other.getMaximize() !=
false) {
494 this.mergeUnknownFields(other.getUnknownFields());
506 com.google.protobuf.CodedInputStream input,
507 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
508 throws java.io.IOException {
509 if (extensionRegistry ==
null) {
510 throw new java.lang.NullPointerException();
513 boolean done =
false;
515 int tag = input.readTag();
521 int v = input.readInt32();
522 ensureVarsIsMutable();
527 int length = input.readRawVarint32();
528 int limit = input.pushLimit(length);
529 ensureVarsIsMutable();
530 while (input.getBytesUntilLimit() > 0) {
531 vars_.addInt(input.readInt32());
533 input.popLimit(limit);
537 double v = input.readDouble();
538 ensureCoeffsIsMutable();
539 coeffs_.addDouble(v);
543 int length = input.readRawVarint32();
544 int limit = input.pushLimit(length);
545 int alloc = length > 4096 ? 4096 : length;
546 ensureCoeffsIsMutable(alloc / 8);
547 while (input.getBytesUntilLimit() > 0) {
548 coeffs_.addDouble(input.readDouble());
550 input.popLimit(limit);
554 offset_ = input.readDouble();
555 bitField0_ |= 0x00000004;
559 maximize_ = input.readBool();
560 bitField0_ |= 0x00000008;
564 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
571 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
572 throw e.unwrapIOException();
578 private int bitField0_;
580 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
581 private void ensureVarsIsMutable() {
582 if (!vars_.isModifiable()) {
583 vars_ = makeMutableCopy(vars_);
585 bitField0_ |= 0x00000001;
591 public java.util.List<java.lang.Integer>
593 vars_.makeImmutable();
609 return vars_.getInt(index);
618 int index,
int value) {
620 ensureVarsIsMutable();
621 vars_.setInt(index, value);
622 bitField0_ |= 0x00000001;
633 ensureVarsIsMutable();
635 bitField0_ |= 0x00000001;
645 java.lang.Iterable<? extends java.lang.Integer> values) {
646 ensureVarsIsMutable();
647 com.google.protobuf.AbstractMessageLite.Builder.addAll(
649 bitField0_ |= 0x00000001;
658 vars_ = emptyIntList();
659 bitField0_ = (bitField0_ & ~0x00000001);
664 private com.google.protobuf.Internal.DoubleList coeffs_ = emptyDoubleList();
665 private void ensureCoeffsIsMutable() {
666 if (!coeffs_.isModifiable()) {
667 coeffs_ = makeMutableCopy(coeffs_);
669 bitField0_ |= 0x00000002;
671 private void ensureCoeffsIsMutable(
int capacity) {
672 if (!coeffs_.isModifiable()) {
673 coeffs_ = makeMutableCopy(coeffs_, capacity);
675 bitField0_ |= 0x00000002;
681 public java.util.List<java.lang.Double>
683 coeffs_.makeImmutable();
691 return coeffs_.size();
699 return coeffs_.getDouble(index);
708 int index,
double value) {
710 ensureCoeffsIsMutable();
711 coeffs_.setDouble(index, value);
712 bitField0_ |= 0x00000002;
723 ensureCoeffsIsMutable();
724 coeffs_.addDouble(value);
725 bitField0_ |= 0x00000002;
735 java.lang.Iterable<? extends java.lang.Double> values) {
736 ensureCoeffsIsMutable();
737 com.google.protobuf.AbstractMessageLite.Builder.addAll(
739 bitField0_ |= 0x00000002;
748 coeffs_ = emptyDoubleList();
749 bitField0_ = (bitField0_ & ~0x00000002);
754 private double offset_ ;
771 bitField0_ |= 0x00000004;
780 bitField0_ = (bitField0_ & ~0x00000004);
786 private boolean maximize_ ;
811 bitField0_ |= 0x00000008;
824 bitField0_ = (bitField0_ & ~0x00000008);
836 DEFAULT_INSTANCE =
new com.google.ortools.sat.FloatObjectiveProto();
840 return DEFAULT_INSTANCE;
847 com.google.protobuf.CodedInputStream input,
848 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
849 throws com.google.protobuf.InvalidProtocolBufferException {
852 builder.mergeFrom(input, extensionRegistry);
853 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
854 throw e.setUnfinishedMessage(builder.buildPartial());
855 }
catch (com.google.protobuf.UninitializedMessageException e) {
856 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
857 }
catch (java.io.IOException e) {
858 throw new com.google.protobuf.InvalidProtocolBufferException(e)
859 .setUnfinishedMessage(builder.buildPartial());
861 return builder.buildPartial();
865 public static com.google.protobuf.Parser<FloatObjectiveProto>
parser() {
876 return DEFAULT_INSTANCE;