5package com.google.ortools.linearsolver;
11 com.google.protobuf.GeneratedMessage implements
14private static final long serialVersionUID = 0L;
16 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
17 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
25 private MPSolution(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
29 variableValue_ = emptyDoubleList();
32 public static final com.google.protobuf.Descriptors.Descriptor
34 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
38 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
40 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
41 .ensureFieldAccessorsInitialized(
42 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
45 private int bitField0_;
47 private double objectiveValue_ = 0D;
54 return ((bitField0_ & 0x00000001) != 0);
62 return objectiveValue_;
66 @SuppressWarnings(
"serial")
67 private com.google.protobuf.Internal.DoubleList variableValue_ =
74 public java.util.List<java.lang.Double>
76 return variableValue_;
83 return variableValue_.size();
91 return variableValue_.getDouble(index);
93 private int variableValueMemoizedSerializedSize = -1;
95 private byte memoizedIsInitialized = -1;
102 memoizedIsInitialized = 1;
107 public void writeTo(com.google.protobuf.CodedOutputStream output)
108 throws java.io.IOException {
110 if (((bitField0_ & 0x00000001) != 0)) {
111 output.writeDouble(1, objectiveValue_);
114 output.writeUInt32NoTag(18);
115 output.writeUInt32NoTag(variableValueMemoizedSerializedSize);
117 for (
int i = 0; i < variableValue_.size(); i++) {
118 output.writeDoubleNoTag(variableValue_.getDouble(i));
120 getUnknownFields().writeTo(output);
125 int size = memoizedSize;
126 if (size != -1)
return size;
129 if (((bitField0_ & 0x00000001) != 0)) {
130 size += com.google.protobuf.CodedOutputStream
131 .computeDoubleSize(1, objectiveValue_);
139 size += com.google.protobuf.CodedOutputStream
140 .computeInt32SizeNoTag(dataSize);
142 variableValueMemoizedSerializedSize = dataSize;
144 size += getUnknownFields().getSerializedSize();
150 public boolean equals(
final java.lang.Object obj) {
154 if (!(obj instanceof com.google.ortools.linearsolver.MPSolution)) {
155 return super.equals(obj);
162 != java.lang.Double.doubleToLongBits(
167 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
173 if (memoizedHashCode != 0) {
174 return memoizedHashCode;
180 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
187 hash = (29 * hash) + getUnknownFields().hashCode();
188 memoizedHashCode = hash;
193 java.nio.ByteBuffer data)
194 throws com.google.protobuf.InvalidProtocolBufferException {
195 return PARSER.parseFrom(data);
198 java.nio.ByteBuffer data,
199 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
200 throws com.google.protobuf.InvalidProtocolBufferException {
201 return PARSER.parseFrom(data, extensionRegistry);
204 com.google.protobuf.ByteString data)
205 throws com.google.protobuf.InvalidProtocolBufferException {
206 return PARSER.parseFrom(data);
209 com.google.protobuf.ByteString data,
210 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
211 throws com.google.protobuf.InvalidProtocolBufferException {
212 return PARSER.parseFrom(data, extensionRegistry);
215 throws com.google.protobuf.InvalidProtocolBufferException {
216 return PARSER.parseFrom(data);
220 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
221 throws com.google.protobuf.InvalidProtocolBufferException {
222 return PARSER.parseFrom(data, extensionRegistry);
225 throws java.io.IOException {
226 return com.google.protobuf.GeneratedMessage
227 .parseWithIOException(PARSER, input);
230 java.io.InputStream input,
231 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
232 throws java.io.IOException {
233 return com.google.protobuf.GeneratedMessage
234 .parseWithIOException(PARSER, input, extensionRegistry);
238 throws java.io.IOException {
239 return com.google.protobuf.GeneratedMessage
240 .parseDelimitedWithIOException(PARSER, input);
244 java.io.InputStream input,
245 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
246 throws java.io.IOException {
247 return com.google.protobuf.GeneratedMessage
248 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
251 com.google.protobuf.CodedInputStream input)
252 throws java.io.IOException {
253 return com.google.protobuf.GeneratedMessage
254 .parseWithIOException(PARSER, input);
257 com.google.protobuf.CodedInputStream input,
258 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
259 throws java.io.IOException {
260 return com.google.protobuf.GeneratedMessage
261 .parseWithIOException(PARSER, input, extensionRegistry);
274 return this == DEFAULT_INSTANCE
280 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
288 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
291 public static final com.google.protobuf.Descriptors.Descriptor
293 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
297 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
299 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_fieldAccessorTable
300 .ensureFieldAccessorsInitialized(
301 com.google.ortools.linearsolver.MPSolution.class, com.google.ortools.linearsolver.MPSolution.Builder.class);
310 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
318 objectiveValue_ = 0D;
319 variableValue_ = emptyDoubleList();
324 public com.google.protobuf.Descriptors.Descriptor
326 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolution_descriptor;
331 return com.google.ortools.linearsolver.MPSolution.getDefaultInstance();
338 throw newUninitializedMessageException(result);
346 if (bitField0_ != 0) { buildPartial0(result); }
351 private void buildPartial0(com.google.ortools.linearsolver.MPSolution result) {
352 int from_bitField0_ = bitField0_;
353 int to_bitField0_ = 0;
354 if (((from_bitField0_ & 0x00000001) != 0)) {
355 result.objectiveValue_ = objectiveValue_;
356 to_bitField0_ |= 0x00000001;
358 if (((from_bitField0_ & 0x00000002) != 0)) {
359 variableValue_.makeImmutable();
360 result.variableValue_ = variableValue_;
362 result.bitField0_ |= to_bitField0_;
367 if (other instanceof com.google.ortools.linearsolver.MPSolution) {
368 return mergeFrom((com.google.ortools.linearsolver.MPSolution)other);
370 super.mergeFrom(other);
376 if (other == com.google.ortools.linearsolver.MPSolution.getDefaultInstance())
return this;
377 if (other.hasObjectiveValue()) {
380 if (!other.variableValue_.isEmpty()) {
381 if (variableValue_.isEmpty()) {
382 variableValue_ = other.variableValue_;
383 variableValue_.makeImmutable();
384 bitField0_ |= 0x00000002;
386 ensureVariableValueIsMutable();
387 variableValue_.addAll(other.variableValue_);
391 this.mergeUnknownFields(other.getUnknownFields());
403 com.google.protobuf.CodedInputStream input,
404 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
405 throws java.io.IOException {
406 if (extensionRegistry ==
null) {
407 throw new java.lang.NullPointerException();
410 boolean done =
false;
412 int tag = input.readTag();
418 objectiveValue_ = input.readDouble();
419 bitField0_ |= 0x00000001;
423 double v = input.readDouble();
424 ensureVariableValueIsMutable();
425 variableValue_.addDouble(v);
429 int length = input.readRawVarint32();
430 int limit = input.pushLimit(length);
431 int alloc = length > 4096 ? 4096 : length;
432 ensureVariableValueIsMutable(alloc / 8);
433 while (input.getBytesUntilLimit() > 0) {
434 variableValue_.addDouble(input.readDouble());
436 input.popLimit(limit);
440 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
447 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
448 throw e.unwrapIOException();
454 private int bitField0_;
456 private double objectiveValue_ ;
463 return ((bitField0_ & 0x00000001) != 0);
471 return objectiveValue_;
480 objectiveValue_ = value;
481 bitField0_ |= 0x00000001;
490 bitField0_ = (bitField0_ & ~0x00000001);
491 objectiveValue_ = 0D;
496 private com.google.protobuf.Internal.DoubleList variableValue_ = emptyDoubleList();
497 private void ensureVariableValueIsMutable() {
498 if (!variableValue_.isModifiable()) {
499 variableValue_ = makeMutableCopy(variableValue_);
501 bitField0_ |= 0x00000002;
503 private void ensureVariableValueIsMutable(
int capacity) {
504 if (!variableValue_.isModifiable()) {
505 variableValue_ = makeMutableCopy(variableValue_, capacity);
507 bitField0_ |= 0x00000002;
513 public java.util.List<java.lang.Double>
515 variableValue_.makeImmutable();
516 return variableValue_;
523 return variableValue_.size();
531 return variableValue_.getDouble(index);
540 int index,
double value) {
542 ensureVariableValueIsMutable();
543 variableValue_.setDouble(index, value);
544 bitField0_ |= 0x00000002;
555 ensureVariableValueIsMutable();
556 variableValue_.addDouble(value);
557 bitField0_ |= 0x00000002;
567 java.lang.Iterable<? extends java.lang.Double> values) {
568 ensureVariableValueIsMutable();
569 com.google.protobuf.AbstractMessageLite.Builder.addAll(
570 values, variableValue_);
571 bitField0_ |= 0x00000002;
580 variableValue_ = emptyDoubleList();
581 bitField0_ = (bitField0_ & ~0x00000002);
592 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSolution();
596 return DEFAULT_INSTANCE;
599 private static final com.google.protobuf.Parser<
MPSolution>
600 PARSER =
new com.google.protobuf.AbstractParser<
MPSolution>() {
603 com.google.protobuf.CodedInputStream input,
604 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
605 throws com.google.protobuf.InvalidProtocolBufferException {
608 builder.mergeFrom(input, extensionRegistry);
609 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
610 throw e.setUnfinishedMessage(builder.buildPartial());
611 }
catch (com.google.protobuf.UninitializedMessageException e) {
612 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
613 }
catch (java.io.IOException e) {
614 throw new com.google.protobuf.InvalidProtocolBufferException(e)
615 .setUnfinishedMessage(builder.buildPartial());
617 return builder.buildPartial();
632 return DEFAULT_INSTANCE;