com.google.ortools.linearsolver.MPSolutionResponse Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ortools/linear_solver/linear_solver.proto
package com.google.ortools.linearsolver;
/**
* Protobuf type {@code operations_research.MPSolutionResponse}
*/
public final class MPSolutionResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:operations_research.MPSolutionResponse)
MPSolutionResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use MPSolutionResponse.newBuilder() to construct.
private MPSolutionResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MPSolutionResponse() {
status_ = 99;
statusStr_ = "";
variableValue_ = emptyDoubleList();
dualValue_ = emptyDoubleList();
reducedCost_ = emptyDoubleList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new MPSolutionResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MPSolutionResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
@SuppressWarnings("deprecation")
com.google.ortools.linearsolver.MPSolverResponseStatus value = com.google.ortools.linearsolver.MPSolverResponseStatus.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(1, rawValue);
} else {
bitField0_ |= 0x00000001;
status_ = rawValue;
}
break;
}
case 17: {
bitField0_ |= 0x00000004;
objectiveValue_ = input.readDouble();
break;
}
case 25: {
if (!((mutable_bitField0_ & 0x00000010) != 0)) {
variableValue_ = newDoubleList();
mutable_bitField0_ |= 0x00000010;
}
variableValue_.addDouble(input.readDouble());
break;
}
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000010) != 0) && input.getBytesUntilLimit() > 0) {
variableValue_ = newDoubleList();
mutable_bitField0_ |= 0x00000010;
}
while (input.getBytesUntilLimit() > 0) {
variableValue_.addDouble(input.readDouble());
}
input.popLimit(limit);
break;
}
case 33: {
if (!((mutable_bitField0_ & 0x00000020) != 0)) {
dualValue_ = newDoubleList();
mutable_bitField0_ |= 0x00000020;
}
dualValue_.addDouble(input.readDouble());
break;
}
case 34: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000020) != 0) && input.getBytesUntilLimit() > 0) {
dualValue_ = newDoubleList();
mutable_bitField0_ |= 0x00000020;
}
while (input.getBytesUntilLimit() > 0) {
dualValue_.addDouble(input.readDouble());
}
input.popLimit(limit);
break;
}
case 41: {
bitField0_ |= 0x00000008;
bestObjectiveBound_ = input.readDouble();
break;
}
case 49: {
if (!((mutable_bitField0_ & 0x00000040) != 0)) {
reducedCost_ = newDoubleList();
mutable_bitField0_ |= 0x00000040;
}
reducedCost_.addDouble(input.readDouble());
break;
}
case 50: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000040) != 0) && input.getBytesUntilLimit() > 0) {
reducedCost_ = newDoubleList();
mutable_bitField0_ |= 0x00000040;
}
while (input.getBytesUntilLimit() > 0) {
reducedCost_.addDouble(input.readDouble());
}
input.popLimit(limit);
break;
}
case 58: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
statusStr_ = bs;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000010) != 0)) {
variableValue_.makeImmutable(); // C
}
if (((mutable_bitField0_ & 0x00000020) != 0)) {
dualValue_.makeImmutable(); // C
}
if (((mutable_bitField0_ & 0x00000040) != 0)) {
reducedCost_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolutionResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolutionResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.linearsolver.MPSolutionResponse.class, com.google.ortools.linearsolver.MPSolutionResponse.Builder.class);
}
private int bitField0_;
public static final int STATUS_FIELD_NUMBER = 1;
private int status_;
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @return Whether the status field is set.
*/
@java.lang.Override public boolean hasStatus() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @return The status.
*/
@java.lang.Override public com.google.ortools.linearsolver.MPSolverResponseStatus getStatus() {
@SuppressWarnings("deprecation")
com.google.ortools.linearsolver.MPSolverResponseStatus result = com.google.ortools.linearsolver.MPSolverResponseStatus.valueOf(status_);
return result == null ? com.google.ortools.linearsolver.MPSolverResponseStatus.MPSOLVER_UNKNOWN_STATUS : result;
}
public static final int STATUS_STR_FIELD_NUMBER = 7;
private volatile java.lang.Object statusStr_;
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return Whether the statusStr field is set.
*/
@java.lang.Override
public boolean hasStatusStr() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return The statusStr.
*/
@java.lang.Override
public java.lang.String getStatusStr() {
java.lang.Object ref = statusStr_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
statusStr_ = s;
}
return s;
}
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return The bytes for statusStr.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getStatusStrBytes() {
java.lang.Object ref = statusStr_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
statusStr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int OBJECTIVE_VALUE_FIELD_NUMBER = 2;
private double objectiveValue_;
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @return Whether the objectiveValue field is set.
*/
@java.lang.Override
public boolean hasObjectiveValue() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @return The objectiveValue.
*/
@java.lang.Override
public double getObjectiveValue() {
return objectiveValue_;
}
public static final int BEST_OBJECTIVE_BOUND_FIELD_NUMBER = 5;
private double bestObjectiveBound_;
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @return Whether the bestObjectiveBound field is set.
*/
@java.lang.Override
public boolean hasBestObjectiveBound() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @return The bestObjectiveBound.
*/
@java.lang.Override
public double getBestObjectiveBound() {
return bestObjectiveBound_;
}
public static final int VARIABLE_VALUE_FIELD_NUMBER = 3;
private com.google.protobuf.Internal.DoubleList variableValue_;
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @return A list containing the variableValue.
*/
@java.lang.Override
public java.util.List
getVariableValueList() {
return variableValue_;
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @return The count of variableValue.
*/
public int getVariableValueCount() {
return variableValue_.size();
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @param index The index of the element to return.
* @return The variableValue at the given index.
*/
public double getVariableValue(int index) {
return variableValue_.getDouble(index);
}
private int variableValueMemoizedSerializedSize = -1;
public static final int DUAL_VALUE_FIELD_NUMBER = 4;
private com.google.protobuf.Internal.DoubleList dualValue_;
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @return A list containing the dualValue.
*/
@java.lang.Override
public java.util.List
getDualValueList() {
return dualValue_;
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @return The count of dualValue.
*/
public int getDualValueCount() {
return dualValue_.size();
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @param index The index of the element to return.
* @return The dualValue at the given index.
*/
public double getDualValue(int index) {
return dualValue_.getDouble(index);
}
private int dualValueMemoizedSerializedSize = -1;
public static final int REDUCED_COST_FIELD_NUMBER = 6;
private com.google.protobuf.Internal.DoubleList reducedCost_;
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @return A list containing the reducedCost.
*/
@java.lang.Override
public java.util.List
getReducedCostList() {
return reducedCost_;
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @return The count of reducedCost.
*/
public int getReducedCostCount() {
return reducedCost_.size();
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @param index The index of the element to return.
* @return The reducedCost at the given index.
*/
public double getReducedCost(int index) {
return reducedCost_.getDouble(index);
}
private int reducedCostMemoizedSerializedSize = -1;
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) != 0)) {
output.writeEnum(1, status_);
}
if (((bitField0_ & 0x00000004) != 0)) {
output.writeDouble(2, objectiveValue_);
}
if (getVariableValueList().size() > 0) {
output.writeUInt32NoTag(26);
output.writeUInt32NoTag(variableValueMemoizedSerializedSize);
}
for (int i = 0; i < variableValue_.size(); i++) {
output.writeDoubleNoTag(variableValue_.getDouble(i));
}
if (getDualValueList().size() > 0) {
output.writeUInt32NoTag(34);
output.writeUInt32NoTag(dualValueMemoizedSerializedSize);
}
for (int i = 0; i < dualValue_.size(); i++) {
output.writeDoubleNoTag(dualValue_.getDouble(i));
}
if (((bitField0_ & 0x00000008) != 0)) {
output.writeDouble(5, bestObjectiveBound_);
}
if (getReducedCostList().size() > 0) {
output.writeUInt32NoTag(50);
output.writeUInt32NoTag(reducedCostMemoizedSerializedSize);
}
for (int i = 0; i < reducedCost_.size(); i++) {
output.writeDoubleNoTag(reducedCost_.getDouble(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, statusStr_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, status_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(2, objectiveValue_);
}
{
int dataSize = 0;
dataSize = 8 * getVariableValueList().size();
size += dataSize;
if (!getVariableValueList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
variableValueMemoizedSerializedSize = dataSize;
}
{
int dataSize = 0;
dataSize = 8 * getDualValueList().size();
size += dataSize;
if (!getDualValueList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
dualValueMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(5, bestObjectiveBound_);
}
{
int dataSize = 0;
dataSize = 8 * getReducedCostList().size();
size += dataSize;
if (!getReducedCostList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
reducedCostMemoizedSerializedSize = dataSize;
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, statusStr_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.ortools.linearsolver.MPSolutionResponse)) {
return super.equals(obj);
}
com.google.ortools.linearsolver.MPSolutionResponse other = (com.google.ortools.linearsolver.MPSolutionResponse) obj;
if (hasStatus() != other.hasStatus()) return false;
if (hasStatus()) {
if (status_ != other.status_) return false;
}
if (hasStatusStr() != other.hasStatusStr()) return false;
if (hasStatusStr()) {
if (!getStatusStr()
.equals(other.getStatusStr())) return false;
}
if (hasObjectiveValue() != other.hasObjectiveValue()) return false;
if (hasObjectiveValue()) {
if (java.lang.Double.doubleToLongBits(getObjectiveValue())
!= java.lang.Double.doubleToLongBits(
other.getObjectiveValue())) return false;
}
if (hasBestObjectiveBound() != other.hasBestObjectiveBound()) return false;
if (hasBestObjectiveBound()) {
if (java.lang.Double.doubleToLongBits(getBestObjectiveBound())
!= java.lang.Double.doubleToLongBits(
other.getBestObjectiveBound())) return false;
}
if (!getVariableValueList()
.equals(other.getVariableValueList())) return false;
if (!getDualValueList()
.equals(other.getDualValueList())) return false;
if (!getReducedCostList()
.equals(other.getReducedCostList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasStatus()) {
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + status_;
}
if (hasStatusStr()) {
hash = (37 * hash) + STATUS_STR_FIELD_NUMBER;
hash = (53 * hash) + getStatusStr().hashCode();
}
if (hasObjectiveValue()) {
hash = (37 * hash) + OBJECTIVE_VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getObjectiveValue()));
}
if (hasBestObjectiveBound()) {
hash = (37 * hash) + BEST_OBJECTIVE_BOUND_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getBestObjectiveBound()));
}
if (getVariableValueCount() > 0) {
hash = (37 * hash) + VARIABLE_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getVariableValueList().hashCode();
}
if (getDualValueCount() > 0) {
hash = (37 * hash) + DUAL_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getDualValueList().hashCode();
}
if (getReducedCostCount() > 0) {
hash = (37 * hash) + REDUCED_COST_FIELD_NUMBER;
hash = (53 * hash) + getReducedCostList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.ortools.linearsolver.MPSolutionResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code operations_research.MPSolutionResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:operations_research.MPSolutionResponse)
com.google.ortools.linearsolver.MPSolutionResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolutionResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolutionResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.ortools.linearsolver.MPSolutionResponse.class, com.google.ortools.linearsolver.MPSolutionResponse.Builder.class);
}
// Construct using com.google.ortools.linearsolver.MPSolutionResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
status_ = 99;
bitField0_ = (bitField0_ & ~0x00000001);
statusStr_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
objectiveValue_ = 0D;
bitField0_ = (bitField0_ & ~0x00000004);
bestObjectiveBound_ = 0D;
bitField0_ = (bitField0_ & ~0x00000008);
variableValue_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000010);
dualValue_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000020);
reducedCost_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSolutionResponse_descriptor;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPSolutionResponse getDefaultInstanceForType() {
return com.google.ortools.linearsolver.MPSolutionResponse.getDefaultInstance();
}
@java.lang.Override
public com.google.ortools.linearsolver.MPSolutionResponse build() {
com.google.ortools.linearsolver.MPSolutionResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPSolutionResponse buildPartial() {
com.google.ortools.linearsolver.MPSolutionResponse result = new com.google.ortools.linearsolver.MPSolutionResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.status_ = status_;
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.statusStr_ = statusStr_;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.objectiveValue_ = objectiveValue_;
to_bitField0_ |= 0x00000004;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.bestObjectiveBound_ = bestObjectiveBound_;
to_bitField0_ |= 0x00000008;
}
if (((bitField0_ & 0x00000010) != 0)) {
variableValue_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000010);
}
result.variableValue_ = variableValue_;
if (((bitField0_ & 0x00000020) != 0)) {
dualValue_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000020);
}
result.dualValue_ = dualValue_;
if (((bitField0_ & 0x00000040) != 0)) {
reducedCost_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000040);
}
result.reducedCost_ = reducedCost_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.ortools.linearsolver.MPSolutionResponse) {
return mergeFrom((com.google.ortools.linearsolver.MPSolutionResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.ortools.linearsolver.MPSolutionResponse other) {
if (other == com.google.ortools.linearsolver.MPSolutionResponse.getDefaultInstance()) return this;
if (other.hasStatus()) {
setStatus(other.getStatus());
}
if (other.hasStatusStr()) {
bitField0_ |= 0x00000002;
statusStr_ = other.statusStr_;
onChanged();
}
if (other.hasObjectiveValue()) {
setObjectiveValue(other.getObjectiveValue());
}
if (other.hasBestObjectiveBound()) {
setBestObjectiveBound(other.getBestObjectiveBound());
}
if (!other.variableValue_.isEmpty()) {
if (variableValue_.isEmpty()) {
variableValue_ = other.variableValue_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureVariableValueIsMutable();
variableValue_.addAll(other.variableValue_);
}
onChanged();
}
if (!other.dualValue_.isEmpty()) {
if (dualValue_.isEmpty()) {
dualValue_ = other.dualValue_;
bitField0_ = (bitField0_ & ~0x00000020);
} else {
ensureDualValueIsMutable();
dualValue_.addAll(other.dualValue_);
}
onChanged();
}
if (!other.reducedCost_.isEmpty()) {
if (reducedCost_.isEmpty()) {
reducedCost_ = other.reducedCost_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureReducedCostIsMutable();
reducedCost_.addAll(other.reducedCost_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.ortools.linearsolver.MPSolutionResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.ortools.linearsolver.MPSolutionResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int status_ = 99;
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @return Whether the status field is set.
*/
@java.lang.Override public boolean hasStatus() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @return The status.
*/
@java.lang.Override
public com.google.ortools.linearsolver.MPSolverResponseStatus getStatus() {
@SuppressWarnings("deprecation")
com.google.ortools.linearsolver.MPSolverResponseStatus result = com.google.ortools.linearsolver.MPSolverResponseStatus.valueOf(status_);
return result == null ? com.google.ortools.linearsolver.MPSolverResponseStatus.MPSOLVER_UNKNOWN_STATUS : result;
}
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @param value The status to set.
* @return This builder for chaining.
*/
public Builder setStatus(com.google.ortools.linearsolver.MPSolverResponseStatus value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
status_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Result of the optimization.
*
*
* optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
* @return This builder for chaining.
*/
public Builder clearStatus() {
bitField0_ = (bitField0_ & ~0x00000001);
status_ = 99;
onChanged();
return this;
}
private java.lang.Object statusStr_ = "";
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return Whether the statusStr field is set.
*/
public boolean hasStatusStr() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return The statusStr.
*/
public java.lang.String getStatusStr() {
java.lang.Object ref = statusStr_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
statusStr_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return The bytes for statusStr.
*/
public com.google.protobuf.ByteString
getStatusStrBytes() {
java.lang.Object ref = statusStr_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
statusStr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @param value The statusStr to set.
* @return This builder for chaining.
*/
public Builder setStatusStr(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
statusStr_ = value;
onChanged();
return this;
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @return This builder for chaining.
*/
public Builder clearStatusStr() {
bitField0_ = (bitField0_ & ~0x00000002);
statusStr_ = getDefaultInstance().getStatusStr();
onChanged();
return this;
}
/**
*
* Human-readable string giving more details about the status. For example,
* when the status is MPSOLVER_INVALID_MODE, this can hold a description of
* why the model is invalid.
* This isn't always filled: don't depend on its value or even its presence.
*
*
* optional string status_str = 7;
* @param value The bytes for statusStr to set.
* @return This builder for chaining.
*/
public Builder setStatusStrBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
statusStr_ = value;
onChanged();
return this;
}
private double objectiveValue_ ;
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @return Whether the objectiveValue field is set.
*/
@java.lang.Override
public boolean hasObjectiveValue() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @return The objectiveValue.
*/
@java.lang.Override
public double getObjectiveValue() {
return objectiveValue_;
}
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @param value The objectiveValue to set.
* @return This builder for chaining.
*/
public Builder setObjectiveValue(double value) {
bitField0_ |= 0x00000004;
objectiveValue_ = value;
onChanged();
return this;
}
/**
*
* Objective value corresponding to the "variable_value" below, taking into
* account the source "objective_offset" and "objective_coefficient".
* This is set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* optional double objective_value = 2;
* @return This builder for chaining.
*/
public Builder clearObjectiveValue() {
bitField0_ = (bitField0_ & ~0x00000004);
objectiveValue_ = 0D;
onChanged();
return this;
}
private double bestObjectiveBound_ ;
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @return Whether the bestObjectiveBound field is set.
*/
@java.lang.Override
public boolean hasBestObjectiveBound() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @return The bestObjectiveBound.
*/
@java.lang.Override
public double getBestObjectiveBound() {
return bestObjectiveBound_;
}
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @param value The bestObjectiveBound to set.
* @return This builder for chaining.
*/
public Builder setBestObjectiveBound(double value) {
bitField0_ |= 0x00000008;
bestObjectiveBound_ = value;
onChanged();
return this;
}
/**
*
* This field is only filled for MIP problems. For a minimization problem,
* this is a lower bound on the optimal objective value. For a maximization
* problem, it is an upper bound. It is only filled if the status is OPTIMAL
* or FEASIBLE. In the former case, best_objective_bound should be equal to
* objective_value (modulo numerical errors).
*
*
* optional double best_objective_bound = 5;
* @return This builder for chaining.
*/
public Builder clearBestObjectiveBound() {
bitField0_ = (bitField0_ & ~0x00000008);
bestObjectiveBound_ = 0D;
onChanged();
return this;
}
private com.google.protobuf.Internal.DoubleList variableValue_ = emptyDoubleList();
private void ensureVariableValueIsMutable() {
if (!((bitField0_ & 0x00000010) != 0)) {
variableValue_ = mutableCopy(variableValue_);
bitField0_ |= 0x00000010;
}
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @return A list containing the variableValue.
*/
public java.util.List
getVariableValueList() {
return ((bitField0_ & 0x00000010) != 0) ?
java.util.Collections.unmodifiableList(variableValue_) : variableValue_;
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @return The count of variableValue.
*/
public int getVariableValueCount() {
return variableValue_.size();
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @param index The index of the element to return.
* @return The variableValue at the given index.
*/
public double getVariableValue(int index) {
return variableValue_.getDouble(index);
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @param index The index to set the value at.
* @param value The variableValue to set.
* @return This builder for chaining.
*/
public Builder setVariableValue(
int index, double value) {
ensureVariableValueIsMutable();
variableValue_.setDouble(index, value);
onChanged();
return this;
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @param value The variableValue to add.
* @return This builder for chaining.
*/
public Builder addVariableValue(double value) {
ensureVariableValueIsMutable();
variableValue_.addDouble(value);
onChanged();
return this;
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @param values The variableValue to add.
* @return This builder for chaining.
*/
public Builder addAllVariableValue(
java.lang.Iterable extends java.lang.Double> values) {
ensureVariableValueIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, variableValue_);
onChanged();
return this;
}
/**
*
* Variable values in the same order as the MPModelProto::variable field.
* This is a dense representation. These are set iff 'status' is OPTIMAL or
* FEASIBLE.
*
*
* repeated double variable_value = 3 [packed = true];
* @return This builder for chaining.
*/
public Builder clearVariableValue() {
variableValue_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
private com.google.protobuf.Internal.DoubleList dualValue_ = emptyDoubleList();
private void ensureDualValueIsMutable() {
if (!((bitField0_ & 0x00000020) != 0)) {
dualValue_ = mutableCopy(dualValue_);
bitField0_ |= 0x00000020;
}
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @return A list containing the dualValue.
*/
public java.util.List
getDualValueList() {
return ((bitField0_ & 0x00000020) != 0) ?
java.util.Collections.unmodifiableList(dualValue_) : dualValue_;
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @return The count of dualValue.
*/
public int getDualValueCount() {
return dualValue_.size();
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @param index The index of the element to return.
* @return The dualValue at the given index.
*/
public double getDualValue(int index) {
return dualValue_.getDouble(index);
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @param index The index to set the value at.
* @param value The dualValue to set.
* @return This builder for chaining.
*/
public Builder setDualValue(
int index, double value) {
ensureDualValueIsMutable();
dualValue_.setDouble(index, value);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @param value The dualValue to add.
* @return This builder for chaining.
*/
public Builder addDualValue(double value) {
ensureDualValueIsMutable();
dualValue_.addDouble(value);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @param values The dualValue to add.
* @return This builder for chaining.
*/
public Builder addAllDualValue(
java.lang.Iterable extends java.lang.Double> values) {
ensureDualValueIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, dualValue_);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the dual variables values in the same order as the
* MPModelProto::constraint field. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if
* it is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double dual_value = 4 [packed = true];
* @return This builder for chaining.
*/
public Builder clearDualValue() {
dualValue_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000020);
onChanged();
return this;
}
private com.google.protobuf.Internal.DoubleList reducedCost_ = emptyDoubleList();
private void ensureReducedCostIsMutable() {
if (!((bitField0_ & 0x00000040) != 0)) {
reducedCost_ = mutableCopy(reducedCost_);
bitField0_ |= 0x00000040;
}
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @return A list containing the reducedCost.
*/
public java.util.List
getReducedCostList() {
return ((bitField0_ & 0x00000040) != 0) ?
java.util.Collections.unmodifiableList(reducedCost_) : reducedCost_;
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @return The count of reducedCost.
*/
public int getReducedCostCount() {
return reducedCost_.size();
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @param index The index of the element to return.
* @return The reducedCost at the given index.
*/
public double getReducedCost(int index) {
return reducedCost_.getDouble(index);
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @param index The index to set the value at.
* @param value The reducedCost to set.
* @return This builder for chaining.
*/
public Builder setReducedCost(
int index, double value) {
ensureReducedCostIsMutable();
reducedCost_.setDouble(index, value);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @param value The reducedCost to add.
* @return This builder for chaining.
*/
public Builder addReducedCost(double value) {
ensureReducedCostIsMutable();
reducedCost_.addDouble(value);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @param values The reducedCost to add.
* @return This builder for chaining.
*/
public Builder addAllReducedCost(
java.lang.Iterable extends java.lang.Double> values) {
ensureReducedCostIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, reducedCost_);
onChanged();
return this;
}
/**
*
* [Advanced usage.]
* Values of the reduced cost of the variables in the same order as the
* MPModelProto::variable. This is a dense representation.
* These are not set if the problem was solved with a MIP solver (even if it
* is actually a linear program).
* These are set iff 'status' is OPTIMAL or FEASIBLE.
*
*
* repeated double reduced_cost = 6 [packed = true];
* @return This builder for chaining.
*/
public Builder clearReducedCost() {
reducedCost_ = emptyDoubleList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:operations_research.MPSolutionResponse)
}
// @@protoc_insertion_point(class_scope:operations_research.MPSolutionResponse)
private static final com.google.ortools.linearsolver.MPSolutionResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPSolutionResponse();
}
public static com.google.ortools.linearsolver.MPSolutionResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public MPSolutionResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MPSolutionResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.ortools.linearsolver.MPSolutionResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy