6package com.google.ortools.linearsolver;
11public final class MPSolution
extends
12 com.google.protobuf.GeneratedMessage implements
15private static final long serialVersionUID = 0L;
17 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
18 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
23 MPSolution.class.getName());
26 private MPSolution(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
29 private MPSolution() {
30 variableValue_ = emptyDoubleList();
33 public static final com.google.protobuf.Descriptors.Descriptor
35 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
39 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
41 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
42 .ensureFieldAccessorsInitialized(
43 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
46 private int bitField0_;
48 private double objectiveValue_ = 0D;
55 return ((bitField0_ & 0x00000001) != 0);
63 return objectiveValue_;
67 @SuppressWarnings(
"serial")
68 private com.google.protobuf.Internal.DoubleList variableValue_ =
75 public java.
util.List<java.lang.Double>
77 return variableValue_;
84 return variableValue_.size();
92 return variableValue_.getDouble(index);
94 private int variableValueMemoizedSerializedSize = -1;
96 private byte memoizedIsInitialized = -1;
103 memoizedIsInitialized = 1;
108 public void writeTo(com.google.protobuf.CodedOutputStream output)
109 throws java.io.IOException {
111 if (((bitField0_ & 0x00000001) != 0)) {
112 output.writeDouble(1, objectiveValue_);
115 output.writeUInt32NoTag(18);
116 output.writeUInt32NoTag(variableValueMemoizedSerializedSize);
118 for (
int i = 0; i < variableValue_.size(); i++) {
119 output.writeDoubleNoTag(variableValue_.getDouble(i));
121 getUnknownFields().writeTo(output);
126 int size = memoizedSize;
127 if (size != -1)
return size;
130 if (((bitField0_ & 0x00000001) != 0)) {
131 size += com.google.protobuf.CodedOutputStream
132 .computeDoubleSize(1, objectiveValue_);
140 size += com.google.protobuf.CodedOutputStream
141 .computeInt32SizeNoTag(dataSize);
143 variableValueMemoizedSerializedSize = dataSize;
145 size += getUnknownFields().getSerializedSize();
151 public boolean equals(
final java.lang.Object obj) {
155 if (!(obj instanceof com.google.ortools.linearsolver.MPSolution)) {
156 return super.equals(obj);
163 != java.lang.Double.doubleToLongBits(
168 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
174 if (memoizedHashCode != 0) {
175 return memoizedHashCode;
181 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
188 hash = (29 * hash) + getUnknownFields().hashCode();
189 memoizedHashCode = hash;
194 java.nio.ByteBuffer data)
195 throws com.google.protobuf.InvalidProtocolBufferException {
196 return PARSER.parseFrom(data);
199 java.nio.ByteBuffer data,
200 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
201 throws com.google.protobuf.InvalidProtocolBufferException {
202 return PARSER.parseFrom(data, extensionRegistry);
205 com.google.protobuf.ByteString data)
206 throws com.google.protobuf.InvalidProtocolBufferException {
207 return PARSER.parseFrom(data);
210 com.google.protobuf.ByteString data,
211 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
212 throws com.google.protobuf.InvalidProtocolBufferException {
213 return PARSER.parseFrom(data, extensionRegistry);
216 throws com.google.protobuf.InvalidProtocolBufferException {
217 return PARSER.parseFrom(data);
221 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
222 throws com.google.protobuf.InvalidProtocolBufferException {
223 return PARSER.parseFrom(data, extensionRegistry);
226 throws java.io.IOException {
227 return com.google.protobuf.GeneratedMessage
228 .parseWithIOException(PARSER, input);
231 java.io.InputStream input,
232 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
233 throws java.io.IOException {
234 return com.google.protobuf.GeneratedMessage
235 .parseWithIOException(PARSER, input, extensionRegistry);
239 throws java.io.IOException {
240 return com.google.protobuf.GeneratedMessage
241 .parseDelimitedWithIOException(PARSER, input);
245 java.io.InputStream input,
246 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
247 throws java.io.IOException {
248 return com.google.protobuf.GeneratedMessage
249 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
252 com.google.protobuf.CodedInputStream input)
253 throws java.io.IOException {
254 return com.google.protobuf.GeneratedMessage
255 .parseWithIOException(PARSER, input);
258 com.google.protobuf.CodedInputStream input,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws java.io.IOException {
261 return com.google.protobuf.GeneratedMessage
262 .parseWithIOException(PARSER, input, extensionRegistry);
268 return DEFAULT_INSTANCE.toBuilder();
271 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
275 return this == DEFAULT_INSTANCE
281 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
288 public static final class Builder
extends
289 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
292 public static final com.google.protobuf.Descriptors.Descriptor
294 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
298 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
300 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
301 .ensureFieldAccessorsInitialized(
302 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
311 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
319 objectiveValue_ = 0D;
320 variableValue_ = emptyDoubleList();
325 public com.google.protobuf.Descriptors.Descriptor
327 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
332 return com.google.ortools.linearsolver.MPSolution.getDefaultInstance();
339 throw newUninitializedMessageException(result);
347 if (bitField0_ != 0) { buildPartial0(result); }
352 private void buildPartial0(com.google.ortools.linearsolver.MPSolution result) {
353 int from_bitField0_ = bitField0_;
354 int to_bitField0_ = 0;
355 if (((from_bitField0_ & 0x00000001) != 0)) {
356 result.objectiveValue_ = objectiveValue_;
357 to_bitField0_ |= 0x00000001;
359 if (((from_bitField0_ & 0x00000002) != 0)) {
360 variableValue_.makeImmutable();
361 result.variableValue_ = variableValue_;
363 result.bitField0_ |= to_bitField0_;
367 public Builder
mergeFrom(com.google.protobuf.Message other) {
368 if (other instanceof com.google.ortools.linearsolver.MPSolution) {
369 return mergeFrom((com.google.ortools.linearsolver.MPSolution)other);
371 super.mergeFrom(other);
376 public Builder
mergeFrom(com.google.ortools.linearsolver.MPSolution other) {
377 if (other == com.google.ortools.linearsolver.MPSolution.getDefaultInstance())
return this;
378 if (other.hasObjectiveValue()) {
381 if (!other.variableValue_.isEmpty()) {
382 if (variableValue_.isEmpty()) {
383 variableValue_ = other.variableValue_;
384 variableValue_.makeImmutable();
385 bitField0_ |= 0x00000002;
387 ensureVariableValueIsMutable();
388 variableValue_.addAll(other.variableValue_);
392 this.mergeUnknownFields(other.getUnknownFields());
404 com.google.protobuf.CodedInputStream input,
405 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
406 throws java.io.IOException {
407 if (extensionRegistry ==
null) {
408 throw new java.lang.NullPointerException();
411 boolean done =
false;
413 int tag = input.readTag();
419 objectiveValue_ = input.readDouble();
420 bitField0_ |= 0x00000001;
424 double v = input.readDouble();
425 ensureVariableValueIsMutable();
426 variableValue_.addDouble(v);
430 int length = input.readRawVarint32();
431 int limit = input.pushLimit(length);
432 int alloc = length > 4096 ? 4096 : length;
433 ensureVariableValueIsMutable(alloc / 8);
434 while (input.getBytesUntilLimit() > 0) {
435 variableValue_.addDouble(input.readDouble());
437 input.popLimit(limit);
441 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
448 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
449 throw e.unwrapIOException();
455 private int bitField0_;
457 private double objectiveValue_ ;
464 return ((bitField0_ & 0x00000001) != 0);
472 return objectiveValue_;
481 objectiveValue_ = value;
482 bitField0_ |= 0x00000001;
491 bitField0_ = (bitField0_ & ~0x00000001);
492 objectiveValue_ = 0D;
497 private com.google.protobuf.Internal.DoubleList variableValue_ = emptyDoubleList();
498 private void ensureVariableValueIsMutable() {
499 if (!variableValue_.isModifiable()) {
500 variableValue_ = makeMutableCopy(variableValue_);
502 bitField0_ |= 0x00000002;
504 private void ensureVariableValueIsMutable(
int capacity) {
505 if (!variableValue_.isModifiable()) {
506 variableValue_ = makeMutableCopy(variableValue_, capacity);
508 bitField0_ |= 0x00000002;
514 public java.util.List<java.lang.Double>
516 variableValue_.makeImmutable();
517 return variableValue_;
524 return variableValue_.size();
532 return variableValue_.getDouble(index);
541 int index,
double value) {
543 ensureVariableValueIsMutable();
544 variableValue_.setDouble(index, value);
545 bitField0_ |= 0x00000002;
556 ensureVariableValueIsMutable();
557 variableValue_.addDouble(value);
558 bitField0_ |= 0x00000002;
568 java.lang.Iterable<? extends java.lang.Double> values) {
569 ensureVariableValueIsMutable();
570 com.google.protobuf.AbstractMessageLite.Builder.addAll(
571 values, variableValue_);
572 bitField0_ |= 0x00000002;
581 variableValue_ = emptyDoubleList();
582 bitField0_ = (bitField0_ & ~0x00000002);
593 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSolution();
597 return DEFAULT_INSTANCE;
600 private static final com.google.protobuf.Parser<
MPSolution>
601 PARSER =
new com.google.protobuf.AbstractParser<
MPSolution>() {
604 com.google.protobuf.CodedInputStream input,
605 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
606 throws com.google.protobuf.InvalidProtocolBufferException {
609 builder.mergeFrom(input, extensionRegistry);
610 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
611 throw e.setUnfinishedMessage(builder.buildPartial());
612 }
catch (com.google.protobuf.UninitializedMessageException e) {
613 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
614 }
catch (java.io.IOException e) {
615 throw new com.google.protobuf.InvalidProtocolBufferException(e)
616 .setUnfinishedMessage(builder.buildPartial());
618 return builder.buildPartial();
622 public static com.google.protobuf.Parser<MPSolution>
parser() {
633 return DEFAULT_INSTANCE;