Classes | Enumerations | Functions | Variables
operations_research Namespace Reference

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. More...

Classes

class  MPConstraintProto
 
class  MPGeneralConstraintProto
 
class  MPIndicatorConstraint
 
struct  MPModelExportOptions
 
class  MPModelProto
 
class  MPModelRequest
 
class  MPSolutionResponse
 
class  MPSolverCommonParameters
 
class  MPSosConstraint
 
class  MPVariableProto
 
class  OptionalDouble
 
class  PartialVariableAssignment
 

Enumerations

enum  MPSosConstraint_Type : int { MPSosConstraint_Type_SOS1_DEFAULT = 0, MPSosConstraint_Type_SOS2 = 1 }
 
enum  MPSolverCommonParameters_LPAlgorithmValues : int { MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_UNSPECIFIED = 0, MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_DUAL = 1, MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_PRIMAL = 2, MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_BARRIER = 3 }
 
enum  MPModelRequest_SolverType : int {
  MPModelRequest_SolverType_GLOP_LINEAR_PROGRAMMING = 2, MPModelRequest_SolverType_CLP_LINEAR_PROGRAMMING = 0, MPModelRequest_SolverType_GLPK_LINEAR_PROGRAMMING = 1, MPModelRequest_SolverType_GUROBI_LINEAR_PROGRAMMING = 6,
  MPModelRequest_SolverType_CPLEX_LINEAR_PROGRAMMING = 10, MPModelRequest_SolverType_SCIP_MIXED_INTEGER_PROGRAMMING = 3, MPModelRequest_SolverType_GLPK_MIXED_INTEGER_PROGRAMMING = 4, MPModelRequest_SolverType_CBC_MIXED_INTEGER_PROGRAMMING = 5,
  MPModelRequest_SolverType_GUROBI_MIXED_INTEGER_PROGRAMMING = 7, MPModelRequest_SolverType_CPLEX_MIXED_INTEGER_PROGRAMMING = 11, MPModelRequest_SolverType_BOP_INTEGER_PROGRAMMING = 12, MPModelRequest_SolverType_SAT_INTEGER_PROGRAMMING = 14,
  MPModelRequest_SolverType_KNAPSACK_MIXED_INTEGER_PROGRAMMING = 13
}
 
enum  MPSolverResponseStatus : int {
  MPSOLVER_OPTIMAL = 0, MPSOLVER_FEASIBLE = 1, MPSOLVER_INFEASIBLE = 2, MPSOLVER_UNBOUNDED = 3,
  MPSOLVER_ABNORMAL = 4, MPSOLVER_NOT_SOLVED = 6, MPSOLVER_MODEL_IS_VALID = 97, MPSOLVER_UNKNOWN_STATUS = 99,
  MPSOLVER_MODEL_INVALID = 5, MPSOLVER_MODEL_INVALID_SOLUTION_HINT = 84, MPSOLVER_MODEL_INVALID_SOLVER_PARAMETERS = 85, MPSOLVER_SOLVER_TYPE_UNAVAILABLE = 7
}
 

Functions

util::StatusOr< std::string > ExportModelAsLpFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions())
 Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-called "CPLEX LP file format" as generated by SCIP. More...
 
util::StatusOr< std::string > ExportModelAsMpsFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions())
 Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file format, using the "free" MPS format. More...
 
std::string ExportModelAsLpFormatReturnString (const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions())
 
std::string ExportModelAsMpsFormatReturnString (const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions())
 
std::string FindErrorInMPModelProto (const MPModelProto &model)
 Returns an empty std::string iff the model is valid and not trivially infeasible. More...
 
std::string FindFeasibilityErrorInSolutionHint (const MPModelProto &model, double tolerance)
 Returns an empty std::string if the solution hint given in the model is a feasible solution. More...
 
bool MPSosConstraint_Type_IsValid (int value)
 
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * MPSosConstraint_Type_descriptor ()
 
template<typename T >
const std::string & MPSosConstraint_Type_Name (T enum_t_value)
 
bool MPSosConstraint_Type_Parse (const std::string &name, MPSosConstraint_Type *value)
 
bool MPSolverCommonParameters_LPAlgorithmValues_IsValid (int value)
 
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * MPSolverCommonParameters_LPAlgorithmValues_descriptor ()
 
template<typename T >
const std::string & MPSolverCommonParameters_LPAlgorithmValues_Name (T enum_t_value)
 
bool MPSolverCommonParameters_LPAlgorithmValues_Parse (const std::string &name, MPSolverCommonParameters_LPAlgorithmValues *value)
 
bool MPModelRequest_SolverType_IsValid (int value)
 
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * MPModelRequest_SolverType_descriptor ()
 
template<typename T >
const std::string & MPModelRequest_SolverType_Name (T enum_t_value)
 
bool MPModelRequest_SolverType_Parse (const std::string &name, MPModelRequest_SolverType *value)
 
bool MPSolverResponseStatus_IsValid (int value)
 
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * MPSolverResponseStatus_descriptor ()
 
template<typename T >
const std::string & MPSolverResponseStatus_Name (T enum_t_value)
 
bool MPSolverResponseStatus_Parse (const std::string &name, MPSolverResponseStatus *value)
 

Variables

MPConstraintProtoDefaultTypeInternal _MPConstraintProto_default_instance_
 
MPGeneralConstraintProtoDefaultTypeInternal _MPGeneralConstraintProto_default_instance_
 
MPIndicatorConstraintDefaultTypeInternal _MPIndicatorConstraint_default_instance_
 
MPModelProtoDefaultTypeInternal _MPModelProto_default_instance_
 
MPModelRequestDefaultTypeInternal _MPModelRequest_default_instance_
 
MPSolutionResponseDefaultTypeInternal _MPSolutionResponse_default_instance_
 
MPSolverCommonParametersDefaultTypeInternal _MPSolverCommonParameters_default_instance_
 
MPSosConstraintDefaultTypeInternal _MPSosConstraint_default_instance_
 
MPVariableProtoDefaultTypeInternal _MPVariableProto_default_instance_
 
OptionalDoubleDefaultTypeInternal _OptionalDouble_default_instance_
 
PartialVariableAssignmentDefaultTypeInternal _PartialVariableAssignment_default_instance_
 
constexpr MPSosConstraint_Type MPSosConstraint_Type_Type_MIN = MPSosConstraint_Type_SOS1_DEFAULT
 
constexpr MPSosConstraint_Type MPSosConstraint_Type_Type_MAX = MPSosConstraint_Type_SOS2
 
constexpr int MPSosConstraint_Type_Type_ARRAYSIZE = MPSosConstraint_Type_Type_MAX + 1
 
constexpr MPSolverCommonParameters_LPAlgorithmValues MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MIN = MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_UNSPECIFIED
 
constexpr MPSolverCommonParameters_LPAlgorithmValues MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MAX = MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_BARRIER
 
constexpr int MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_ARRAYSIZE = MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MAX + 1
 
constexpr MPModelRequest_SolverType MPModelRequest_SolverType_SolverType_MIN = MPModelRequest_SolverType_CLP_LINEAR_PROGRAMMING
 
constexpr MPModelRequest_SolverType MPModelRequest_SolverType_SolverType_MAX = MPModelRequest_SolverType_SAT_INTEGER_PROGRAMMING
 
constexpr int MPModelRequest_SolverType_SolverType_ARRAYSIZE = MPModelRequest_SolverType_SolverType_MAX + 1
 
constexpr MPSolverResponseStatus MPSolverResponseStatus_MIN = MPSOLVER_OPTIMAL
 
constexpr MPSolverResponseStatus MPSolverResponseStatus_MAX = MPSOLVER_UNKNOWN_STATUS
 
constexpr int MPSolverResponseStatus_ARRAYSIZE = MPSolverResponseStatus_MAX + 1
 

Detailed Description

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Enumeration Type Documentation

◆ MPModelRequest_SolverType

Enumerator
MPModelRequest_SolverType_GLOP_LINEAR_PROGRAMMING 
MPModelRequest_SolverType_CLP_LINEAR_PROGRAMMING 
MPModelRequest_SolverType_GLPK_LINEAR_PROGRAMMING 
MPModelRequest_SolverType_GUROBI_LINEAR_PROGRAMMING 
MPModelRequest_SolverType_CPLEX_LINEAR_PROGRAMMING 
MPModelRequest_SolverType_SCIP_MIXED_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_GLPK_MIXED_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_CBC_MIXED_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_GUROBI_MIXED_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_CPLEX_MIXED_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_BOP_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_SAT_INTEGER_PROGRAMMING 
MPModelRequest_SolverType_KNAPSACK_MIXED_INTEGER_PROGRAMMING 

Definition at line 157 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues

Enumerator
MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_UNSPECIFIED 
MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_DUAL 
MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_PRIMAL 
MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_BARRIER 

Definition at line 132 of file linear_solver.pb.h.

◆ MPSolverResponseStatus

Enumerator
MPSOLVER_OPTIMAL 
MPSOLVER_FEASIBLE 
MPSOLVER_INFEASIBLE 
MPSOLVER_UNBOUNDED 
MPSOLVER_ABNORMAL 
MPSOLVER_NOT_SOLVED 
MPSOLVER_MODEL_IS_VALID 
MPSOLVER_UNKNOWN_STATUS 
MPSOLVER_MODEL_INVALID 
MPSOLVER_MODEL_INVALID_SOLUTION_HINT 
MPSOLVER_MODEL_INVALID_SOLVER_PARAMETERS 
MPSOLVER_SOLVER_TYPE_UNAVAILABLE 

Definition at line 191 of file linear_solver.pb.h.

◆ MPSosConstraint_Type

Enumerator
MPSosConstraint_Type_SOS1_DEFAULT 
MPSosConstraint_Type_SOS2 

Definition at line 109 of file linear_solver.pb.h.

Function Documentation

◆ ExportModelAsLpFormat()

util::StatusOr<std::string> operations_research::ExportModelAsLpFormat ( const MPModelProto model,
const MPModelExportOptions options = MPModelExportOptions() 
)

Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-called "CPLEX LP file format" as generated by SCIP.

The LP file format is easily readable by a human.

Returns false if some error has occurred during execution. The validity of names is automatically checked. If a variable name or a constraint name is invalid or non-existent, a new valid name is automatically generated.

If 'obfuscated' is true, the variable and constraint names of proto_ are not used. Variable and constraint names of the form "V12345" and "C12345" are used instead.

For more information about the different LP file formats: http://lpsolve.sourceforge.net/5.5/lp-format.htm The following give a reasonable idea of the CPLEX LP file format: http://lpsolve.sourceforge.net/5.5/CPLEX-format.htm http://tinyurl.com/cplex-lp-format http://www.gurobi.com/documentation/5.1/reference-manual/node871

◆ ExportModelAsLpFormatReturnString()

std::string operations_research::ExportModelAsLpFormatReturnString ( const MPModelProto input_model,
const MPModelExportOptions options = MPModelExportOptions() 
)

Definition at line 24 of file model_exporter_swig_helper.h.

◆ ExportModelAsMpsFormat()

util::StatusOr<std::string> operations_research::ExportModelAsMpsFormat ( const MPModelProto model,
const MPModelExportOptions options = MPModelExportOptions() 
)

Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file format, using the "free" MPS format.

Returns false if some error has occurred during execution. Models with maximization objectives trigger an error, because MPS can encode only minimization problems.

The validity of names is automatically checked. If a variable name or a constraint name is invalid or non-existent, a new valid name is automatically generated.

Name validity and obfuscation works exactly as in ExportModelAsLpFormat().

For more information about the MPS format: http://en.wikipedia.org/wiki/MPS_(format) A close-to-original description coming from OSL: http://tinyurl.com/mps-format-by-osl A recent description from CPLEX: http://tinyurl.com/mps-format-by-cplex CPLEX extensions: http://tinyurl.com/mps-extensions-by-cplex Gurobi's description: http://www.gurobi.com/documentation/5.1/reference-manual/node869

◆ ExportModelAsMpsFormatReturnString()

std::string operations_research::ExportModelAsMpsFormatReturnString ( const MPModelProto input_model,
const MPModelExportOptions options = MPModelExportOptions() 
)

Definition at line 31 of file model_exporter_swig_helper.h.

◆ FindErrorInMPModelProto()

std::string operations_research::FindErrorInMPModelProto ( const MPModelProto model)

Returns an empty std::string iff the model is valid and not trivially infeasible.

Otherwise, returns a description of the first error or trivial infeasibility encountered.

NOTE(user): the code of this method (and the client code too!) is considerably simplified by this std::string-based, simple API. If clients require it, we could add a formal error status enum.

◆ FindFeasibilityErrorInSolutionHint()

std::string operations_research::FindFeasibilityErrorInSolutionHint ( const MPModelProto model,
double  tolerance 
)

Returns an empty std::string if the solution hint given in the model is a feasible solution.

Otherwise, returns a description of the first reason for infeasibility.

This function can be useful for debugging/checking that the given solution hint is feasible when it is expected to be the case. The feasibility is checked up to the given tolerance using the ::operations_research::IsLowerWithinTolerance() function.

◆ MPModelRequest_SolverType_descriptor()

const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* operations_research::MPModelRequest_SolverType_descriptor ( )

◆ MPModelRequest_SolverType_IsValid()

bool operations_research::MPModelRequest_SolverType_IsValid ( int  value)

◆ MPModelRequest_SolverType_Name()

template<typename T >
const std::string& operations_research::MPModelRequest_SolverType_Name ( enum_t_value)
inline

Definition at line 179 of file linear_solver.pb.h.

◆ MPModelRequest_SolverType_Parse()

bool operations_research::MPModelRequest_SolverType_Parse ( const std::string &  name,
MPModelRequest_SolverType value 
)
inline

Definition at line 186 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues_descriptor()

const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* operations_research::MPSolverCommonParameters_LPAlgorithmValues_descriptor ( )

◆ MPSolverCommonParameters_LPAlgorithmValues_IsValid()

bool operations_research::MPSolverCommonParameters_LPAlgorithmValues_IsValid ( int  value)

◆ MPSolverCommonParameters_LPAlgorithmValues_Name()

template<typename T >
const std::string& operations_research::MPSolverCommonParameters_LPAlgorithmValues_Name ( enum_t_value)
inline

Definition at line 145 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues_Parse()

bool operations_research::MPSolverCommonParameters_LPAlgorithmValues_Parse ( const std::string &  name,
MPSolverCommonParameters_LPAlgorithmValues value 
)
inline

Definition at line 152 of file linear_solver.pb.h.

◆ MPSolverResponseStatus_descriptor()

const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* operations_research::MPSolverResponseStatus_descriptor ( )

◆ MPSolverResponseStatus_IsValid()

bool operations_research::MPSolverResponseStatus_IsValid ( int  value)

◆ MPSolverResponseStatus_Name()

template<typename T >
const std::string& operations_research::MPSolverResponseStatus_Name ( enum_t_value)
inline

Definition at line 212 of file linear_solver.pb.h.

◆ MPSolverResponseStatus_Parse()

bool operations_research::MPSolverResponseStatus_Parse ( const std::string &  name,
MPSolverResponseStatus value 
)
inline

Definition at line 219 of file linear_solver.pb.h.

◆ MPSosConstraint_Type_descriptor()

const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* operations_research::MPSosConstraint_Type_descriptor ( )

◆ MPSosConstraint_Type_IsValid()

bool operations_research::MPSosConstraint_Type_IsValid ( int  value)

◆ MPSosConstraint_Type_Name()

template<typename T >
const std::string& operations_research::MPSosConstraint_Type_Name ( enum_t_value)
inline

Definition at line 120 of file linear_solver.pb.h.

◆ MPSosConstraint_Type_Parse()

bool operations_research::MPSosConstraint_Type_Parse ( const std::string &  name,
MPSosConstraint_Type value 
)
inline

Definition at line 127 of file linear_solver.pb.h.

Variable Documentation

◆ _MPConstraintProto_default_instance_

MPConstraintProtoDefaultTypeInternal operations_research::_MPConstraintProto_default_instance_

◆ _MPGeneralConstraintProto_default_instance_

MPGeneralConstraintProtoDefaultTypeInternal operations_research::_MPGeneralConstraintProto_default_instance_

◆ _MPIndicatorConstraint_default_instance_

MPIndicatorConstraintDefaultTypeInternal operations_research::_MPIndicatorConstraint_default_instance_

◆ _MPModelProto_default_instance_

MPModelProtoDefaultTypeInternal operations_research::_MPModelProto_default_instance_

◆ _MPModelRequest_default_instance_

MPModelRequestDefaultTypeInternal operations_research::_MPModelRequest_default_instance_

◆ _MPSolutionResponse_default_instance_

MPSolutionResponseDefaultTypeInternal operations_research::_MPSolutionResponse_default_instance_

◆ _MPSolverCommonParameters_default_instance_

MPSolverCommonParametersDefaultTypeInternal operations_research::_MPSolverCommonParameters_default_instance_

◆ _MPSosConstraint_default_instance_

MPSosConstraintDefaultTypeInternal operations_research::_MPSosConstraint_default_instance_

◆ _MPVariableProto_default_instance_

MPVariableProtoDefaultTypeInternal operations_research::_MPVariableProto_default_instance_

◆ _OptionalDouble_default_instance_

OptionalDoubleDefaultTypeInternal operations_research::_OptionalDouble_default_instance_

◆ _PartialVariableAssignment_default_instance_

PartialVariableAssignmentDefaultTypeInternal operations_research::_PartialVariableAssignment_default_instance_

◆ MPModelRequest_SolverType_SolverType_ARRAYSIZE

constexpr int operations_research::MPModelRequest_SolverType_SolverType_ARRAYSIZE = MPModelRequest_SolverType_SolverType_MAX + 1

Definition at line 175 of file linear_solver.pb.h.

◆ MPModelRequest_SolverType_SolverType_MAX

constexpr MPModelRequest_SolverType operations_research::MPModelRequest_SolverType_SolverType_MAX = MPModelRequest_SolverType_SAT_INTEGER_PROGRAMMING

Definition at line 174 of file linear_solver.pb.h.

◆ MPModelRequest_SolverType_SolverType_MIN

constexpr MPModelRequest_SolverType operations_research::MPModelRequest_SolverType_SolverType_MIN = MPModelRequest_SolverType_CLP_LINEAR_PROGRAMMING

Definition at line 173 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_ARRAYSIZE

constexpr int operations_research::MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_ARRAYSIZE = MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MAX + 1

Definition at line 141 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MAX

constexpr MPSolverCommonParameters_LPAlgorithmValues operations_research::MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MAX = MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_BARRIER

Definition at line 140 of file linear_solver.pb.h.

◆ MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MIN

constexpr MPSolverCommonParameters_LPAlgorithmValues operations_research::MPSolverCommonParameters_LPAlgorithmValues_LPAlgorithmValues_MIN = MPSolverCommonParameters_LPAlgorithmValues_LP_ALGO_UNSPECIFIED

Definition at line 139 of file linear_solver.pb.h.

◆ MPSolverResponseStatus_ARRAYSIZE

constexpr int operations_research::MPSolverResponseStatus_ARRAYSIZE = MPSolverResponseStatus_MAX + 1

Definition at line 208 of file linear_solver.pb.h.

◆ MPSolverResponseStatus_MAX

constexpr MPSolverResponseStatus operations_research::MPSolverResponseStatus_MAX = MPSOLVER_UNKNOWN_STATUS

Definition at line 207 of file linear_solver.pb.h.

◆ MPSolverResponseStatus_MIN

constexpr MPSolverResponseStatus operations_research::MPSolverResponseStatus_MIN = MPSOLVER_OPTIMAL

Definition at line 206 of file linear_solver.pb.h.

◆ MPSosConstraint_Type_Type_ARRAYSIZE

constexpr int operations_research::MPSosConstraint_Type_Type_ARRAYSIZE = MPSosConstraint_Type_Type_MAX + 1

Definition at line 116 of file linear_solver.pb.h.

◆ MPSosConstraint_Type_Type_MAX

constexpr MPSosConstraint_Type operations_research::MPSosConstraint_Type_Type_MAX = MPSosConstraint_Type_SOS2

Definition at line 115 of file linear_solver.pb.h.

◆ MPSosConstraint_Type_Type_MIN

constexpr MPSosConstraint_Type operations_research::MPSosConstraint_Type_Type_MIN = MPSosConstraint_Type_SOS1_DEFAULT

Definition at line 114 of file linear_solver.pb.h.