5package com.google.ortools.sat;
16 com.google.protobuf.GeneratedMessage implements
19private static final long serialVersionUID = 0L;
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 vars_ = emptyIntList();
35 coeffs_ = emptyDoubleList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
52 @SuppressWarnings(
"serial")
53 private com.google.protobuf.Internal.IntList vars_ =
60 public java.util.List<java.lang.Integer>
77 return vars_.getInt(index);
79 private int varsMemoizedSerializedSize = -1;
82 @SuppressWarnings(
"serial")
83 private com.google.protobuf.Internal.DoubleList coeffs_ =
90 public java.util.List<java.lang.Double>
99 return coeffs_.size();
107 return coeffs_.getDouble(index);
109 private int coeffsMemoizedSerializedSize = -1;
112 private double offset_ = 0D;
123 private boolean maximize_ =
false;
137 private byte memoizedIsInitialized = -1;
144 memoizedIsInitialized = 1;
149 public void writeTo(com.google.protobuf.CodedOutputStream output)
150 throws java.io.IOException {
153 output.writeUInt32NoTag(10);
154 output.writeUInt32NoTag(varsMemoizedSerializedSize);
156 for (
int i = 0; i < vars_.size(); i++) {
157 output.writeInt32NoTag(vars_.getInt(i));
160 output.writeUInt32NoTag(18);
161 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
163 for (
int i = 0; i < coeffs_.size(); i++) {
164 output.writeDoubleNoTag(coeffs_.getDouble(i));
166 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
167 output.writeDouble(3, offset_);
169 if (maximize_ !=
false) {
170 output.writeBool(4, maximize_);
172 getUnknownFields().writeTo(output);
177 int size = memoizedSize;
178 if (size != -1)
return size;
183 for (
int i = 0; i < vars_.size(); i++) {
184 dataSize += com.google.protobuf.CodedOutputStream
185 .computeInt32SizeNoTag(vars_.getInt(i));
190 size += com.google.protobuf.CodedOutputStream
191 .computeInt32SizeNoTag(dataSize);
193 varsMemoizedSerializedSize = dataSize;
201 size += com.google.protobuf.CodedOutputStream
202 .computeInt32SizeNoTag(dataSize);
204 coeffsMemoizedSerializedSize = dataSize;
206 if (java.lang.Double.doubleToRawLongBits(offset_) != 0) {
207 size += com.google.protobuf.CodedOutputStream
208 .computeDoubleSize(3, offset_);
210 if (maximize_ !=
false) {
211 size += com.google.protobuf.CodedOutputStream
212 .computeBoolSize(4, maximize_);
214 size += getUnknownFields().getSerializedSize();
220 public boolean equals(
final java.lang.Object obj) {
224 if (!(obj instanceof com.google.ortools.sat.FloatObjectiveProto)) {
225 return super.equals(obj);
233 if (java.lang.Double.doubleToLongBits(
getOffset())
234 != java.lang.Double.doubleToLongBits(
238 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
244 if (memoizedHashCode != 0) {
245 return memoizedHashCode;
258 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
259 java.lang.Double.doubleToLongBits(
getOffset()));
261 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
263 hash = (29 * hash) + getUnknownFields().hashCode();
264 memoizedHashCode = hash;
269 java.nio.ByteBuffer data)
270 throws com.google.protobuf.InvalidProtocolBufferException {
271 return PARSER.parseFrom(data);
274 java.nio.ByteBuffer data,
275 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
276 throws com.google.protobuf.InvalidProtocolBufferException {
277 return PARSER.parseFrom(data, extensionRegistry);
280 com.google.protobuf.ByteString data)
281 throws com.google.protobuf.InvalidProtocolBufferException {
282 return PARSER.parseFrom(data);
285 com.google.protobuf.ByteString data,
286 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
287 throws com.google.protobuf.InvalidProtocolBufferException {
288 return PARSER.parseFrom(data, extensionRegistry);
291 throws com.google.protobuf.InvalidProtocolBufferException {
292 return PARSER.parseFrom(data);
296 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
297 throws com.google.protobuf.InvalidProtocolBufferException {
298 return PARSER.parseFrom(data, extensionRegistry);
301 throws java.io.IOException {
302 return com.google.protobuf.GeneratedMessage
303 .parseWithIOException(PARSER, input);
306 java.io.InputStream input,
307 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
308 throws java.io.IOException {
309 return com.google.protobuf.GeneratedMessage
310 .parseWithIOException(PARSER, input, extensionRegistry);
314 throws java.io.IOException {
315 return com.google.protobuf.GeneratedMessage
316 .parseDelimitedWithIOException(PARSER, input);
320 java.io.InputStream input,
321 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
322 throws java.io.IOException {
323 return com.google.protobuf.GeneratedMessage
324 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
327 com.google.protobuf.CodedInputStream input)
328 throws java.io.IOException {
329 return com.google.protobuf.GeneratedMessage
330 .parseWithIOException(PARSER, input);
333 com.google.protobuf.CodedInputStream input,
334 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
335 throws java.io.IOException {
336 return com.google.protobuf.GeneratedMessage
337 .parseWithIOException(PARSER, input, extensionRegistry);
350 return this == DEFAULT_INSTANCE
356 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
369 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
372 public static final com.google.protobuf.Descriptors.Descriptor
374 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
378 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
380 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_fieldAccessorTable
381 .ensureFieldAccessorsInitialized(
382 com.google.ortools.sat.FloatObjectiveProto.class, com.google.ortools.sat.FloatObjectiveProto.Builder.class);
391 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
399 vars_ = emptyIntList();
400 coeffs_ = emptyDoubleList();
407 public com.google.protobuf.Descriptors.Descriptor
409 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_FloatObjectiveProto_descriptor;
414 return com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance();
421 throw newUninitializedMessageException(result);
429 if (bitField0_ != 0) { buildPartial0(result); }
434 private void buildPartial0(com.google.ortools.sat.FloatObjectiveProto result) {
435 int from_bitField0_ = bitField0_;
436 if (((from_bitField0_ & 0x00000001) != 0)) {
437 vars_.makeImmutable();
438 result.vars_ = vars_;
440 if (((from_bitField0_ & 0x00000002) != 0)) {
441 coeffs_.makeImmutable();
442 result.coeffs_ = coeffs_;
444 if (((from_bitField0_ & 0x00000004) != 0)) {
445 result.offset_ = offset_;
447 if (((from_bitField0_ & 0x00000008) != 0)) {
448 result.maximize_ = maximize_;
454 if (other instanceof com.google.ortools.sat.FloatObjectiveProto) {
455 return mergeFrom((com.google.ortools.sat.FloatObjectiveProto)other);
457 super.mergeFrom(other);
463 if (other == com.google.ortools.sat.FloatObjectiveProto.getDefaultInstance())
return this;
464 if (!other.vars_.isEmpty()) {
465 if (vars_.isEmpty()) {
467 vars_.makeImmutable();
468 bitField0_ |= 0x00000001;
470 ensureVarsIsMutable();
471 vars_.addAll(other.vars_);
475 if (!other.coeffs_.isEmpty()) {
476 if (coeffs_.isEmpty()) {
477 coeffs_ = other.coeffs_;
478 coeffs_.makeImmutable();
479 bitField0_ |= 0x00000002;
481 ensureCoeffsIsMutable();
482 coeffs_.addAll(other.coeffs_);
486 if (other.getOffset() != 0D) {
489 if (other.getMaximize() !=
false) {
492 this.mergeUnknownFields(other.getUnknownFields());
504 com.google.protobuf.CodedInputStream input,
505 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
506 throws java.io.IOException {
507 if (extensionRegistry ==
null) {
508 throw new java.lang.NullPointerException();
511 boolean done =
false;
513 int tag = input.readTag();
519 int v = input.readInt32();
520 ensureVarsIsMutable();
525 int length = input.readRawVarint32();
526 int limit = input.pushLimit(length);
527 ensureVarsIsMutable();
528 while (input.getBytesUntilLimit() > 0) {
529 vars_.addInt(input.readInt32());
531 input.popLimit(limit);
535 double v = input.readDouble();
536 ensureCoeffsIsMutable();
537 coeffs_.addDouble(v);
541 int length = input.readRawVarint32();
542 int limit = input.pushLimit(length);
543 int alloc = length > 4096 ? 4096 : length;
544 ensureCoeffsIsMutable(alloc / 8);
545 while (input.getBytesUntilLimit() > 0) {
546 coeffs_.addDouble(input.readDouble());
548 input.popLimit(limit);
552 offset_ = input.readDouble();
553 bitField0_ |= 0x00000004;
557 maximize_ = input.readBool();
558 bitField0_ |= 0x00000008;
562 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
569 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
570 throw e.unwrapIOException();
576 private int bitField0_;
578 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
579 private void ensureVarsIsMutable() {
580 if (!vars_.isModifiable()) {
581 vars_ = makeMutableCopy(vars_);
583 bitField0_ |= 0x00000001;
589 public java.util.List<java.lang.Integer>
591 vars_.makeImmutable();
607 return vars_.getInt(index);
616 int index,
int value) {
618 ensureVarsIsMutable();
619 vars_.setInt(index, value);
620 bitField0_ |= 0x00000001;
631 ensureVarsIsMutable();
633 bitField0_ |= 0x00000001;
643 java.lang.Iterable<? extends java.lang.Integer> values) {
644 ensureVarsIsMutable();
645 com.google.protobuf.AbstractMessageLite.Builder.addAll(
647 bitField0_ |= 0x00000001;
656 vars_ = emptyIntList();
657 bitField0_ = (bitField0_ & ~0x00000001);
662 private com.google.protobuf.Internal.DoubleList coeffs_ = emptyDoubleList();
663 private void ensureCoeffsIsMutable() {
664 if (!coeffs_.isModifiable()) {
665 coeffs_ = makeMutableCopy(coeffs_);
667 bitField0_ |= 0x00000002;
669 private void ensureCoeffsIsMutable(
int capacity) {
670 if (!coeffs_.isModifiable()) {
671 coeffs_ = makeMutableCopy(coeffs_, capacity);
673 bitField0_ |= 0x00000002;
679 public java.util.List<java.lang.Double>
681 coeffs_.makeImmutable();
689 return coeffs_.size();
697 return coeffs_.getDouble(index);
706 int index,
double value) {
708 ensureCoeffsIsMutable();
709 coeffs_.setDouble(index, value);
710 bitField0_ |= 0x00000002;
721 ensureCoeffsIsMutable();
722 coeffs_.addDouble(value);
723 bitField0_ |= 0x00000002;
733 java.lang.Iterable<? extends java.lang.Double> values) {
734 ensureCoeffsIsMutable();
735 com.google.protobuf.AbstractMessageLite.Builder.addAll(
737 bitField0_ |= 0x00000002;
746 coeffs_ = emptyDoubleList();
747 bitField0_ = (bitField0_ & ~0x00000002);
752 private double offset_ ;
769 bitField0_ |= 0x00000004;
778 bitField0_ = (bitField0_ & ~0x00000004);
784 private boolean maximize_ ;
809 bitField0_ |= 0x00000008;
822 bitField0_ = (bitField0_ & ~0x00000008);
834 DEFAULT_INSTANCE =
new com.google.ortools.sat.FloatObjectiveProto();
838 return DEFAULT_INSTANCE;
845 com.google.protobuf.CodedInputStream input,
846 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
847 throws com.google.protobuf.InvalidProtocolBufferException {
850 builder.mergeFrom(input, extensionRegistry);
851 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
852 throw e.setUnfinishedMessage(builder.buildPartial());
853 }
catch (com.google.protobuf.UninitializedMessageException e) {
854 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
855 }
catch (java.io.IOException e) {
856 throw new com.google.protobuf.InvalidProtocolBufferException(e)
857 .setUnfinishedMessage(builder.buildPartial());
859 return builder.buildPartial();
874 return DEFAULT_INSTANCE;