6package com.google.ortools.linearsolver;
11@com.google.protobuf.Generated
12public final class MPSolution
extends
13 com.google.protobuf.GeneratedMessage implements
16private static final long serialVersionUID = 0L;
18 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
19 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
24 MPSolution.class.getName());
27 private MPSolution(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
30 private MPSolution() {
31 variableValue_ = emptyDoubleList();
34 public static final com.google.protobuf.Descriptors.Descriptor
36 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
40 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
42 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
43 .ensureFieldAccessorsInitialized(
44 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
47 private int bitField0_;
49 private double objectiveValue_ = 0D;
56 return ((bitField0_ & 0x00000001) != 0);
64 return objectiveValue_;
68 @SuppressWarnings(
"serial")
69 private com.google.protobuf.Internal.DoubleList variableValue_ =
76 public java.
util.List<java.lang.Double>
78 return variableValue_;
85 return variableValue_.size();
93 return variableValue_.getDouble(index);
95 private int variableValueMemoizedSerializedSize = -1;
97 private byte memoizedIsInitialized = -1;
104 memoizedIsInitialized = 1;
109 public void writeTo(com.google.protobuf.CodedOutputStream output)
110 throws java.io.IOException {
112 if (((bitField0_ & 0x00000001) != 0)) {
113 output.writeDouble(1, objectiveValue_);
116 output.writeUInt32NoTag(18);
117 output.writeUInt32NoTag(variableValueMemoizedSerializedSize);
119 for (
int i = 0; i < variableValue_.size(); i++) {
120 output.writeDoubleNoTag(variableValue_.getDouble(i));
122 getUnknownFields().writeTo(output);
127 int size = memoizedSize;
128 if (size != -1)
return size;
131 if (((bitField0_ & 0x00000001) != 0)) {
132 size += com.google.protobuf.CodedOutputStream
133 .computeDoubleSize(1, objectiveValue_);
141 size += com.google.protobuf.CodedOutputStream
142 .computeInt32SizeNoTag(dataSize);
144 variableValueMemoizedSerializedSize = dataSize;
146 size += getUnknownFields().getSerializedSize();
152 public boolean equals(
final java.lang.Object obj) {
156 if (!(obj instanceof com.google.ortools.linearsolver.MPSolution)) {
157 return super.equals(obj);
164 != java.lang.Double.doubleToLongBits(
169 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
175 if (memoizedHashCode != 0) {
176 return memoizedHashCode;
182 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
189 hash = (29 * hash) + getUnknownFields().hashCode();
190 memoizedHashCode = hash;
195 java.nio.ByteBuffer data)
196 throws com.google.protobuf.InvalidProtocolBufferException {
197 return PARSER.parseFrom(data);
200 java.nio.ByteBuffer data,
201 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
202 throws com.google.protobuf.InvalidProtocolBufferException {
203 return PARSER.parseFrom(data, extensionRegistry);
206 com.google.protobuf.ByteString data)
207 throws com.google.protobuf.InvalidProtocolBufferException {
208 return PARSER.parseFrom(data);
211 com.google.protobuf.ByteString data,
212 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
213 throws com.google.protobuf.InvalidProtocolBufferException {
214 return PARSER.parseFrom(data, extensionRegistry);
217 throws com.google.protobuf.InvalidProtocolBufferException {
218 return PARSER.parseFrom(data);
222 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
223 throws com.google.protobuf.InvalidProtocolBufferException {
224 return PARSER.parseFrom(data, extensionRegistry);
227 throws java.io.IOException {
228 return com.google.protobuf.GeneratedMessage
229 .parseWithIOException(PARSER, input);
232 java.io.InputStream input,
233 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
234 throws java.io.IOException {
235 return com.google.protobuf.GeneratedMessage
236 .parseWithIOException(PARSER, input, extensionRegistry);
240 throws java.io.IOException {
241 return com.google.protobuf.GeneratedMessage
242 .parseDelimitedWithIOException(PARSER, input);
246 java.io.InputStream input,
247 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
248 throws java.io.IOException {
249 return com.google.protobuf.GeneratedMessage
250 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
253 com.google.protobuf.CodedInputStream input)
254 throws java.io.IOException {
255 return com.google.protobuf.GeneratedMessage
256 .parseWithIOException(PARSER, input);
259 com.google.protobuf.CodedInputStream input,
260 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
261 throws java.io.IOException {
262 return com.google.protobuf.GeneratedMessage
263 .parseWithIOException(PARSER, input, extensionRegistry);
269 return DEFAULT_INSTANCE.toBuilder();
272 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
276 return this == DEFAULT_INSTANCE
282 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
289 public static final class Builder
extends
290 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
293 public static final com.google.protobuf.Descriptors.Descriptor
295 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
299 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
301 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
302 .ensureFieldAccessorsInitialized(
303 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
312 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
320 objectiveValue_ = 0D;
321 variableValue_ = emptyDoubleList();
326 public com.google.protobuf.Descriptors.Descriptor
328 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
333 return com.google.ortools.linearsolver.MPSolution.getDefaultInstance();
340 throw newUninitializedMessageException(result);
348 if (bitField0_ != 0) { buildPartial0(result); }
353 private void buildPartial0(com.google.ortools.linearsolver.MPSolution result) {
354 int from_bitField0_ = bitField0_;
355 int to_bitField0_ = 0;
356 if (((from_bitField0_ & 0x00000001) != 0)) {
357 result.objectiveValue_ = objectiveValue_;
358 to_bitField0_ |= 0x00000001;
360 if (((from_bitField0_ & 0x00000002) != 0)) {
361 variableValue_.makeImmutable();
362 result.variableValue_ = variableValue_;
364 result.bitField0_ |= to_bitField0_;
368 public Builder
mergeFrom(com.google.protobuf.Message other) {
369 if (other instanceof com.google.ortools.linearsolver.MPSolution) {
370 return mergeFrom((com.google.ortools.linearsolver.MPSolution)other);
372 super.mergeFrom(other);
377 public Builder
mergeFrom(com.google.ortools.linearsolver.MPSolution other) {
378 if (other == com.google.ortools.linearsolver.MPSolution.getDefaultInstance())
return this;
379 if (other.hasObjectiveValue()) {
382 if (!other.variableValue_.isEmpty()) {
383 if (variableValue_.isEmpty()) {
384 variableValue_ = other.variableValue_;
385 variableValue_.makeImmutable();
386 bitField0_ |= 0x00000002;
388 ensureVariableValueIsMutable();
389 variableValue_.addAll(other.variableValue_);
393 this.mergeUnknownFields(other.getUnknownFields());
405 com.google.protobuf.CodedInputStream input,
406 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
407 throws java.io.IOException {
408 if (extensionRegistry ==
null) {
409 throw new java.lang.NullPointerException();
412 boolean done =
false;
414 int tag = input.readTag();
420 objectiveValue_ = input.readDouble();
421 bitField0_ |= 0x00000001;
425 double v = input.readDouble();
426 ensureVariableValueIsMutable();
427 variableValue_.addDouble(v);
431 int length = input.readRawVarint32();
432 int limit = input.pushLimit(length);
433 int alloc = length > 4096 ? 4096 : length;
434 ensureVariableValueIsMutable(alloc / 8);
435 while (input.getBytesUntilLimit() > 0) {
436 variableValue_.addDouble(input.readDouble());
438 input.popLimit(limit);
442 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
449 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
450 throw e.unwrapIOException();
456 private int bitField0_;
458 private double objectiveValue_ ;
465 return ((bitField0_ & 0x00000001) != 0);
473 return objectiveValue_;
482 objectiveValue_ = value;
483 bitField0_ |= 0x00000001;
492 bitField0_ = (bitField0_ & ~0x00000001);
493 objectiveValue_ = 0D;
498 private com.google.protobuf.Internal.DoubleList variableValue_ = emptyDoubleList();
499 private void ensureVariableValueIsMutable() {
500 if (!variableValue_.isModifiable()) {
501 variableValue_ = makeMutableCopy(variableValue_);
503 bitField0_ |= 0x00000002;
505 private void ensureVariableValueIsMutable(
int capacity) {
506 if (!variableValue_.isModifiable()) {
507 variableValue_ = makeMutableCopy(variableValue_, capacity);
509 bitField0_ |= 0x00000002;
515 public java.util.List<java.lang.Double>
517 variableValue_.makeImmutable();
518 return variableValue_;
525 return variableValue_.size();
533 return variableValue_.getDouble(index);
542 int index,
double value) {
544 ensureVariableValueIsMutable();
545 variableValue_.setDouble(index, value);
546 bitField0_ |= 0x00000002;
557 ensureVariableValueIsMutable();
558 variableValue_.addDouble(value);
559 bitField0_ |= 0x00000002;
569 java.lang.Iterable<? extends java.lang.Double> values) {
570 ensureVariableValueIsMutable();
571 com.google.protobuf.AbstractMessageLite.Builder.addAll(
572 values, variableValue_);
573 bitField0_ |= 0x00000002;
582 variableValue_ = emptyDoubleList();
583 bitField0_ = (bitField0_ & ~0x00000002);
594 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSolution();
598 return DEFAULT_INSTANCE;
601 private static final com.google.protobuf.Parser<
MPSolution>
602 PARSER =
new com.google.protobuf.AbstractParser<
MPSolution>() {
605 com.google.protobuf.CodedInputStream input,
606 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
607 throws com.google.protobuf.InvalidProtocolBufferException {
610 builder.mergeFrom(input, extensionRegistry);
611 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
612 throw e.setUnfinishedMessage(builder.buildPartial());
613 }
catch (com.google.protobuf.UninitializedMessageException e) {
614 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
615 }
catch (java.io.IOException e) {
616 throw new com.google.protobuf.InvalidProtocolBufferException(e)
617 .setUnfinishedMessage(builder.buildPartial());
619 return builder.buildPartial();
623 public static com.google.protobuf.Parser<MPSolution>
parser() {
634 return DEFAULT_INSTANCE;