OR-Tools  9.0
operations_research::math_opt Namespace Reference

Namespaces

 internal
 

Classes

struct  CallbackData
 
struct  CallbackRegistration
 
struct  CallbackResult
 
class  IdMap
 
class  IdSet
 
class  LinearConstraint
 
struct  MapFilter
 
class  MathOpt
 
struct  ModelSolveParameters
 
class  Objective
 
struct  Result
 
class  Variable
 
struct  LinearTerm
 
class  LinearExpression
 
struct  LowerBoundedLinearExpression
 
struct  UpperBoundedLinearExpression
 
struct  BoundedLinearExpression
 
class  IndexedModel
 
struct  IndexedPrimalSolution
 
struct  IndexedPrimalRay
 
struct  IndexedDualSolution
 
struct  IndexedDualRay
 
struct  IndexedBasis
 
struct  IndexedSolutions
 
class  SparseVectorFilterPredicate
 
class  IdNameBiMap
 
struct  ModelSummary
 
class  Solver
 
class  SolverInterface
 
class  AllSolversRegistry
 
class  CpSatSolver
 
class  GlopSolver
 
class  GScipSolver
 
class  GScipSolverCallbackHandler
 
struct  GurobiCallbackInput
 
class  GurobiSolver
 
class  MessageCallbackData
 
class  SparseVectorView
 
class  IdUpdateValidator
 
struct  DoubleOptions
 

Typedefs

template<typename V >
using LinearConstraintMap = IdMap< LinearConstraint, V >
 
template<typename V >
using VariableMap = IdMap< Variable, V >
 
template<typename SparseVector >
using sparse_value_type = typename std::remove_reference< decltype(SparseVector().values())>::type::value_type
 

Functions

template<typename K , typename V >
void swap (IdMap< K, V > &a, IdMap< K, V > &b)
 
template<typename K >
void swap (IdSet< K > &a, IdSet< K > &b)
 
std::ostream & operator<< (std::ostream &ostr, const LinearConstraint &linear_constraint)
 
bool operator== (const LinearConstraint &lhs, const LinearConstraint &rhs)
 
bool operator!= (const LinearConstraint &lhs, const LinearConstraint &rhs)
 
template<typename H >
AbslHashValue (H h, const LinearConstraint &linear_constraint)
 
template<typename KeyType >
MapFilter< KeyType > MakeSkipAllFilter ()
 
template<typename KeyType >
MapFilter< KeyType > MakeSkipZerosFilter ()
 
template<typename Collection , typename ValueType = typename Collection::value_type>
MapFilter< ValueType > MakeKeepKeysFilter (const Collection &keys)
 
template<typename KeyType >
MapFilter< KeyType > MakeKeepKeysFilter (std::initializer_list< KeyType > keys)
 
std::ostream & operator<< (std::ostream &ostr, const LinearExpression &expression)
 
std::ostream & operator<< (std::ostream &ostr, const BoundedLinearExpression &bounded_expression)
 
std::ostream & operator<< (std::ostream &ostr, const Variable &variable)
 
LinearTerm operator* (double coefficient, LinearTerm term)
 
LinearTerm operator* (LinearTerm term, double coefficient)
 
LinearTerm operator* (double coefficient, Variable variable)
 
LinearTerm operator* (Variable variable, double coefficient)
 
LinearTerm operator/ (LinearTerm term, double coefficient)
 
LinearTerm operator/ (Variable variable, double coefficient)
 
template<typename Iterable >
LinearExpression Sum (const Iterable &items)
 
template<typename LeftIterable , typename RightIterable >
LinearExpression InnerProduct (const LeftIterable &left, const RightIterable &right)
 
LinearExpression operator- (LinearExpression expr)
 
LinearExpression operator+ (Variable lhs, double rhs)
 
LinearExpression operator+ (double lhs, Variable rhs)
 
LinearExpression operator+ (Variable lhs, Variable rhs)
 
LinearExpression operator+ (const LinearTerm &lhs, double rhs)
 
LinearExpression operator+ (double lhs, const LinearTerm &rhs)
 
LinearExpression operator+ (const LinearTerm &lhs, Variable rhs)
 
LinearExpression operator+ (Variable lhs, const LinearTerm &rhs)
 
LinearExpression operator+ (const LinearTerm &lhs, const LinearTerm &rhs)
 
LinearExpression operator+ (LinearExpression lhs, double rhs)
 
LinearExpression operator+ (double lhs, LinearExpression rhs)
 
LinearExpression operator+ (LinearExpression lhs, Variable rhs)
 
LinearExpression operator+ (Variable lhs, LinearExpression rhs)
 
LinearExpression operator+ (LinearExpression lhs, const LinearTerm &rhs)
 
LinearExpression operator+ (LinearTerm lhs, LinearExpression rhs)
 
LinearExpression operator+ (LinearExpression lhs, const LinearExpression &rhs)
 
LinearExpression operator- (Variable lhs, double rhs)
 
LinearExpression operator- (double lhs, Variable rhs)
 
LinearExpression operator- (Variable lhs, Variable rhs)
 
LinearExpression operator- (const LinearTerm &lhs, double rhs)
 
LinearExpression operator- (double lhs, const LinearTerm &rhs)
 
LinearExpression operator- (const LinearTerm &lhs, Variable rhs)
 
LinearExpression operator- (Variable lhs, const LinearTerm &rhs)
 
LinearExpression operator- (const LinearTerm &lhs, const LinearTerm &rhs)
 
LinearExpression operator- (LinearExpression lhs, double rhs)
 
LinearExpression operator- (double lhs, LinearExpression rhs)
 
LinearExpression operator- (LinearExpression lhs, Variable rhs)
 
LinearExpression operator- (Variable lhs, LinearExpression rhs)
 
LinearExpression operator- (LinearExpression lhs, const LinearTerm &rhs)
 
LinearExpression operator- (LinearTerm lhs, LinearExpression rhs)
 
LinearExpression operator- (LinearExpression lhs, const LinearExpression &rhs)
 
LinearExpression operator* (LinearExpression lhs, double rhs)
 
LinearExpression operator* (double lhs, LinearExpression rhs)
 
LinearExpression operator/ (LinearExpression lhs, double rhs)
 
internal::VariablesEquality operator== (const Variable &lhs, const Variable &rhs)
 
bool operator!= (const Variable &lhs, const Variable &rhs)
 
LowerBoundedLinearExpression operator>= (LinearExpression expression, double constant)
 
LowerBoundedLinearExpression operator<= (double constant, LinearExpression expression)
 
LowerBoundedLinearExpression operator>= (const LinearTerm &term, double constant)
 
LowerBoundedLinearExpression operator<= (double constant, const LinearTerm &term)
 
LowerBoundedLinearExpression operator>= (Variable variable, double constant)
 
LowerBoundedLinearExpression operator<= (double constant, Variable variable)
 
UpperBoundedLinearExpression operator<= (LinearExpression expression, double constant)
 
UpperBoundedLinearExpression operator>= (double constant, LinearExpression expression)
 
UpperBoundedLinearExpression operator<= (const LinearTerm &term, double constant)
 
UpperBoundedLinearExpression operator>= (double constant, const LinearTerm &term)
 
UpperBoundedLinearExpression operator<= (Variable variable, double constant)
 
UpperBoundedLinearExpression operator>= (double constant, Variable variable)
 
BoundedLinearExpression operator<= (LowerBoundedLinearExpression lhs, double rhs)
 
BoundedLinearExpression operator>= (double lhs, LowerBoundedLinearExpression rhs)
 
BoundedLinearExpression operator>= (UpperBoundedLinearExpression lhs, double rhs)
 
BoundedLinearExpression operator<= (double lhs, UpperBoundedLinearExpression rhs)
 
BoundedLinearExpression operator<= (LinearExpression lhs, const LinearExpression &rhs)
 
BoundedLinearExpression operator>= (LinearExpression lhs, const LinearExpression &rhs)
 
BoundedLinearExpression operator<= (LinearExpression lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator>= (LinearExpression lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator<= (const LinearTerm &lhs, LinearExpression rhs)
 
BoundedLinearExpression operator>= (const LinearTerm &lhs, LinearExpression rhs)
 
BoundedLinearExpression operator<= (LinearExpression lhs, Variable rhs)
 
BoundedLinearExpression operator>= (LinearExpression lhs, Variable rhs)
 
BoundedLinearExpression operator<= (Variable lhs, LinearExpression rhs)
 
BoundedLinearExpression operator>= (Variable lhs, LinearExpression rhs)
 
BoundedLinearExpression operator<= (const LinearTerm &lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator>= (const LinearTerm &lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator<= (const LinearTerm &lhs, Variable rhs)
 
BoundedLinearExpression operator>= (const LinearTerm &lhs, Variable rhs)
 
BoundedLinearExpression operator<= (Variable lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator>= (Variable lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator<= (Variable lhs, Variable rhs)
 
BoundedLinearExpression operator>= (Variable lhs, Variable rhs)
 
BoundedLinearExpression operator== (LinearExpression lhs, const LinearExpression &rhs)
 
BoundedLinearExpression operator== (LinearExpression lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator== (const LinearTerm &lhs, LinearExpression rhs)
 
BoundedLinearExpression operator== (LinearExpression lhs, Variable rhs)
 
BoundedLinearExpression operator== (Variable lhs, LinearExpression rhs)
 
BoundedLinearExpression operator== (LinearExpression lhs, double rhs)
 
BoundedLinearExpression operator== (double lhs, LinearExpression rhs)
 
BoundedLinearExpression operator== (const LinearTerm &lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator== (const LinearTerm &lhs, Variable rhs)
 
BoundedLinearExpression operator== (Variable lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator== (const LinearTerm &lhs, double rhs)
 
BoundedLinearExpression operator== (double lhs, const LinearTerm &rhs)
 
BoundedLinearExpression operator== (Variable lhs, double rhs)
 
BoundedLinearExpression operator== (double lhs, Variable rhs)
 
template<typename H >
AbslHashValue (H h, const Variable &variable)
 
IndexedSolutions IndexedSolutionsFromProto (const SolveResultProto &solve_result)
 
 DEFINE_INT_TYPE (VariableId, int64_t)
 
 DEFINE_INT_TYPE (LinearConstraintId, int64_t)
 
void RemoveSparseDoubleVectorZeros (SparseDoubleVectorProto &sparse_vector)
 
absl::flat_hash_set< CallbackEventProto > EventSet (const CallbackRegistrationProto &callback_registration)
 
int NumVariables (const VariablesProto &variables)
 
int NumConstraints (const LinearConstraintsProto &linear_constraints)
 
int NumMatrixNonzeros (const SparseDoubleMatrixProto &matrix)
 
absl::StatusOr<::operations_research::math_opt::ModelProto > MPModelProtoToMathOptModel (const ::operations_research::MPModelProto &model)
 
absl::StatusOr<::operations_research::MPModelProto > MathOptModelToMPModelProto (const ::operations_research::math_opt::ModelProto &model)
 
 MATH_OPT_REGISTER_SOLVER (SOLVER_TYPE_CP_SAT, CpSatSolver::New)
 
template<typename IndexType >
void UpdateIdIndexMap (glop::StrictITIVector< IndexType, bool > indices_to_delete, IndexType num_indices, absl::flat_hash_map< int64_t, IndexType > &id_index_map)
 
template<typename IndexType >
SparseDoubleVectorProto FillSparseDoubleVector (const std::vector< int64_t > &ids_in_order, const absl::flat_hash_map< int64_t, IndexType > &id_map, const glop::StrictITIVector< IndexType, glop::Fractional > &values, const SparseVectorFilterProto &filter)
 
template<typename T >
std::vector< int64_t > GetSortedIs (const absl::flat_hash_map< int64_t, T > &id_map)
 
GScipParameters::MetaParamValue ConvertMathOptEmphasis (Emphasis emphasis)
 
std::vector< bool > EventToGurobiWhere (const absl::flat_hash_set< CallbackEventProto > &events)
 
absl::Status GurobiCallbackImpl (GRBmodel *grb_model, void *cbdata, int where, const GurobiCallbackInput &callback_input, MessageCallbackData &message_callback_data)
 
absl::Status GurobiCallbackImplFlush (const GurobiCallbackInput &callback_input, MessageCallbackData &message_callback_data)
 
template<typename Collection , typename T = typename Collection::value_type>
SparseVectorView< T > MakeView (absl::Span< const int64_t > ids, const Collection &values)
 
template<typename T >
SparseVectorView< const T * > MakeView (const google::protobuf::RepeatedField< int64_t > &ids, const google::protobuf::RepeatedPtrField< T > &values)
 
template<typename SparseVectorProto , typename T = sparse_value_type<SparseVectorProto>>
SparseVectorView< T > MakeView (const SparseVectorProto &sparse_vector)
 
absl::Status ValidateCallbackRegistration (const CallbackRegistrationProto &callback_registration, const ModelSummary &model_summary)
 
absl::Status ValidateCallbackDataProto (const CallbackDataProto &cb_data, const CallbackRegistrationProto &callback_registration, const ModelSummary &model_summary)
 
absl::Status ValidateCallbackResultProto (const CallbackResultProto &callback_result, const CallbackEventProto callback_event, const CallbackRegistrationProto &callback_registration, const ModelSummary &model_summary)
 
absl::Status CheckIdsNonnegativeAndStrictlyIncreasing (absl::Span< const int64_t > ids)
 
absl::Status CheckSortedIdsSubset (const absl::Span< const int64_t > ids, const absl::Span< const int64_t > universe)
 
absl::Status CheckUnsortedIdsSubset (const absl::Span< const int64_t > ids, const absl::Span< const int64_t > universe)
 
absl::Status CheckIdsSubset (absl::Span< const int64_t > ids, const IdNameBiMap &universe, absl::string_view ids_description, absl::string_view universe_description)
 
absl::Status CheckIdsIdentical (absl::Span< const int64_t > first_ids, const IdNameBiMap &second_ids, absl::string_view first_description, absl::string_view second_description)
 
absl::Status ValidateSparseVectorFilter (const SparseVectorFilterProto &v, const IdNameBiMap &valid_ids)
 
absl::Status ValidateModelSolveParameters (const ModelSolveParametersProto &parameters, const ModelSummary &model_summary)
 
absl::Status ValidateModel (const ModelProto &model, const bool check_names)
 
absl::Status ValidateModelUpdate (const ModelUpdateProto &model_update, const bool check_names)
 
absl::Status ValidateModelUpdateAndSummary (const ModelUpdateProto &model_update, const ModelSummary &model_summary, const bool check_names)
 
absl::Status CheckNameVector (const SparseVectorView< const std::string * > &name_vector, const bool check_unique)
 
absl::Status CheckNewNames (const IdNameBiMap &old_names, const SparseVectorView< const std::string * > &new_names)
 
absl::Status CheckScalarNoNanNoInf (const double d)
 
absl::Status CheckScalar (const double value, const DoubleOptions &options)
 
absl::Status ValidateResult (const SolveResultProto &result, const ModelSolveParametersProto &parameters, const ModelSummary &model_summary)
 
absl::Status ValidatePrimalSolution (const PrimalSolutionProto &primal_solution, const SparseVectorFilterProto &filter, const ModelSummary &model_summary)
 
absl::Status ValidatePrimalRay (const PrimalRayProto &primal_ray, const SparseVectorFilterProto &filter, const ModelSummary &model_summary)
 
absl::Status ValidateDualSolution (const DualSolutionProto &dual_solution, const ModelSolveParametersProto &parameters, const ModelSummary &model_summary)
 
absl::Status ValidateDualRay (const DualRayProto &dual_ray, const ModelSolveParametersProto &parameters, const ModelSummary &model_summary)
 
absl::Status SparseBasisStatusVectorIsValid (const SparseVectorView< int > &status_vector_view)
 
absl::Status ValidateBasis (const BasisProto &basis, const ModelSummary &model_summary)
 
absl::Status ValidateSolverParameters (const SolveParametersProto &parameters)
 
template<typename T >
absl::Status CheckIdsAndValuesSize (const SparseVectorView< T > &vector_view, absl::string_view value_name="values")
 
template<typename T , typename = std::enable_if<!std::is_floating_point<T>::value>>
absl::Status CheckValues (const SparseVectorView< T > &vector_view, absl::string_view value_name="values")
 
template<typename T , typename = std::enable_if<!std::is_floating_point<T>::value>>
absl::Status CheckIdsAndValues (const SparseVectorView< T > &vector_view, absl::string_view value_name="values")
 
template<typename T , typename = std::enable_if<std::is_floating_point<T>::value>>
absl::Status CheckValues (const SparseVectorView< T > &vector_view, const DoubleOptions &options, absl::string_view value_name="values")
 
template<typename T , typename = std::enable_if<std::is_floating_point<T>::value>>
absl::Status CheckIdsAndValues (const SparseVectorView< T > &vector_view, const DoubleOptions &options, absl::string_view value_name="values")
 

Variables

constexpr double kInf = std::numeric_limits<double>::infinity()
 

Typedef Documentation

◆ LinearConstraintMap

◆ sparse_value_type

using sparse_value_type = typename std::remove_reference< decltype(SparseVector().values())>::type::value_type

Definition at line 68 of file sparse_vector_view.h.

◆ VariableMap

using VariableMap = IdMap<Variable, V>

Definition at line 141 of file variable_and_expressions.h.

Function Documentation

◆ AbslHashValue() [1/2]

H operations_research::math_opt::AbslHashValue ( h,
const LinearConstraint linear_constraint 
)

Definition at line 140 of file math_opt/cpp/linear_constraint.h.

◆ AbslHashValue() [2/2]

H operations_research::math_opt::AbslHashValue ( h,
const Variable variable 
)

Definition at line 625 of file variable_and_expressions.h.

◆ CheckIdsAndValues() [1/2]

absl::Status operations_research::math_opt::CheckIdsAndValues ( const SparseVectorView< T > &  vector_view,
absl::string_view  value_name = "values" 
)

Definition at line 50 of file sparse_vector_validator.h.

◆ CheckIdsAndValues() [2/2]

absl::Status operations_research::math_opt::CheckIdsAndValues ( const SparseVectorView< T > &  vector_view,
const DoubleOptions options,
absl::string_view  value_name = "values" 
)

Definition at line 73 of file sparse_vector_validator.h.

◆ CheckIdsAndValuesSize()

absl::Status operations_research::math_opt::CheckIdsAndValuesSize ( const SparseVectorView< T > &  vector_view,
absl::string_view  value_name = "values" 
)

Definition at line 30 of file sparse_vector_validator.h.

◆ CheckIdsIdentical()

absl::Status CheckIdsIdentical ( absl::Span< const int64_t >  first_ids,
const IdNameBiMap second_ids,
absl::string_view  first_description,
absl::string_view  second_description 
)

Definition at line 253 of file ids_validator.cc.

◆ CheckIdsNonnegativeAndStrictlyIncreasing()

absl::Status CheckIdsNonnegativeAndStrictlyIncreasing ( absl::Span< const int64_t >  ids)

Definition at line 117 of file ids_validator.cc.

◆ CheckIdsSubset()

absl::Status CheckIdsSubset ( absl::Span< const int64_t >  ids,
const IdNameBiMap universe,
absl::string_view  ids_description,
absl::string_view  universe_description 
)

Definition at line 238 of file ids_validator.cc.

◆ CheckNameVector()

absl::Status CheckNameVector ( const SparseVectorView< const std::string * > &  name_vector,
const bool  check_unique 
)

Definition at line 34 of file name_validator.cc.

◆ CheckNewNames()

absl::Status CheckNewNames ( const IdNameBiMap old_names,
const SparseVectorView< const std::string * > &  new_names 
)

Definition at line 58 of file name_validator.cc.

◆ CheckScalar()

absl::Status CheckScalar ( const double  value,
const DoubleOptions options 
)

Definition at line 37 of file scalar_validator.cc.

◆ CheckScalarNoNanNoInf()

absl::Status CheckScalarNoNanNoInf ( const double  d)

Definition at line 29 of file scalar_validator.cc.

◆ CheckSortedIdsSubset()

absl::Status CheckSortedIdsSubset ( const absl::Span< const int64_t >  ids,
const absl::Span< const int64_t >  universe 
)

Definition at line 139 of file ids_validator.cc.

◆ CheckUnsortedIdsSubset()

absl::Status CheckUnsortedIdsSubset ( const absl::Span< const int64_t >  ids,
const absl::Span< const int64_t >  universe 
)

Definition at line 145 of file ids_validator.cc.

◆ CheckValues() [1/2]

absl::Status operations_research::math_opt::CheckValues ( const SparseVectorView< T > &  vector_view,
absl::string_view  value_name = "values" 
)

Definition at line 42 of file sparse_vector_validator.h.

◆ CheckValues() [2/2]

absl::Status operations_research::math_opt::CheckValues ( const SparseVectorView< T > &  vector_view,
const DoubleOptions options,
absl::string_view  value_name = "values" 
)

Definition at line 59 of file sparse_vector_validator.h.

◆ ConvertMathOptEmphasis()

GScipParameters::MetaParamValue operations_research::math_opt::ConvertMathOptEmphasis ( Emphasis  emphasis)

Definition at line 375 of file gscip_solver.cc.

◆ DEFINE_INT_TYPE() [1/2]

operations_research::math_opt::DEFINE_INT_TYPE ( LinearConstraintId  ,
int64_t   
)

◆ DEFINE_INT_TYPE() [2/2]

operations_research::math_opt::DEFINE_INT_TYPE ( VariableId  ,
int64_t   
)

◆ EventSet()

absl::flat_hash_set< CallbackEventProto > EventSet ( const CallbackRegistrationProto &  callback_registration)

Definition at line 67 of file math_opt_proto_utils.cc.

◆ EventToGurobiWhere()

std::vector< bool > EventToGurobiWhere ( const absl::flat_hash_set< CallbackEventProto > &  events)

Definition at line 395 of file gurobi_callback.cc.

◆ FillSparseDoubleVector()

SparseDoubleVectorProto operations_research::math_opt::FillSparseDoubleVector ( const std::vector< int64_t > &  ids_in_order,
const absl::flat_hash_map< int64_t, IndexType > &  id_map,
const glop::StrictITIVector< IndexType, glop::Fractional > &  values,
const SparseVectorFilterProto &  filter 
)

Definition at line 322 of file glop_solver.cc.

◆ GetSortedIs()

std::vector<int64_t> operations_research::math_opt::GetSortedIs ( const absl::flat_hash_map< int64_t, T > &  id_map)

Definition at line 340 of file glop_solver.cc.

◆ GurobiCallbackImpl()

absl::Status GurobiCallbackImpl ( GRBmodel grb_model,
void *  cbdata,
int  where,
const GurobiCallbackInput callback_input,
MessageCallbackData message_callback_data 
)

Definition at line 404 of file gurobi_callback.cc.

◆ GurobiCallbackImplFlush()

absl::Status GurobiCallbackImplFlush ( const GurobiCallbackInput callback_input,
MessageCallbackData message_callback_data 
)

Definition at line 427 of file gurobi_callback.cc.

◆ IndexedSolutionsFromProto()

IndexedSolutions IndexedSolutionsFromProto ( const SolveResultProto &  solve_result)

Definition at line 429 of file indexed_model.cc.

◆ InnerProduct()

LinearExpression InnerProduct ( const LeftIterable &  left,
const RightIterable &  right 
)
inline

Definition at line 954 of file variable_and_expressions.h.

◆ MakeKeepKeysFilter() [1/2]

MapFilter<ValueType> operations_research::math_opt::MakeKeepKeysFilter ( const Collection &  keys)

Definition at line 133 of file map_filter.h.

◆ MakeKeepKeysFilter() [2/2]

MapFilter<KeyType> operations_research::math_opt::MakeKeepKeysFilter ( std::initializer_list< KeyType >  keys)

Definition at line 149 of file map_filter.h.

◆ MakeSkipAllFilter()

MapFilter<KeyType> operations_research::math_opt::MakeSkipAllFilter ( )

Definition at line 108 of file map_filter.h.

◆ MakeSkipZerosFilter()

MapFilter<KeyType> operations_research::math_opt::MakeSkipZerosFilter ( )

Definition at line 120 of file map_filter.h.

◆ MakeView() [1/3]

SparseVectorView<T> operations_research::math_opt::MakeView ( absl::Span< const int64_t >  ids,
const Collection &  values 
)

Definition at line 140 of file sparse_vector_view.h.

◆ MakeView() [2/3]

SparseVectorView<const T*> operations_research::math_opt::MakeView ( const google::protobuf::RepeatedField< int64_t > &  ids,
const google::protobuf::RepeatedPtrField< T > &  values 
)

Definition at line 149 of file sparse_vector_view.h.

◆ MakeView() [3/3]

SparseVectorView<T> operations_research::math_opt::MakeView ( const SparseVectorProto &  sparse_vector)

Definition at line 160 of file sparse_vector_view.h.

◆ MATH_OPT_REGISTER_SOLVER()

operations_research::math_opt::MATH_OPT_REGISTER_SOLVER ( SOLVER_TYPE_CP_SAT  ,
CpSatSolver::New   
)

◆ MathOptModelToMPModelProto()

absl::StatusOr<::operations_research::MPModelProto > MathOptModelToMPModelProto ( const ::operations_research::math_opt::ModelProto &  model)

Definition at line 176 of file proto_converter.cc.

◆ MPModelProtoToMathOptModel()

absl::StatusOr<::operations_research::math_opt::ModelProto > MPModelProtoToMathOptModel ( const ::operations_research::MPModelProto &  model)

Definition at line 81 of file proto_converter.cc.

◆ NumConstraints()

int operations_research::math_opt::NumConstraints ( const LinearConstraintsProto &  linear_constraints)
inline

Definition at line 33 of file math_opt_proto_utils.h.

◆ NumMatrixNonzeros()

int operations_research::math_opt::NumMatrixNonzeros ( const SparseDoubleMatrixProto &  matrix)
inline

Definition at line 37 of file math_opt_proto_utils.h.

◆ NumVariables()

int operations_research::math_opt::NumVariables ( const VariablesProto &  variables)
inline

Definition at line 29 of file math_opt_proto_utils.h.

◆ operator!=() [1/2]

bool operations_research::math_opt::operator!= ( const LinearConstraint lhs,
const LinearConstraint rhs 
)

Definition at line 135 of file math_opt/cpp/linear_constraint.h.

◆ operator!=() [2/2]

bool operator!= ( const Variable lhs,
const Variable rhs 
)
inline

Definition at line 992 of file variable_and_expressions.h.

◆ operator*() [1/6]

LinearTerm operator* ( double  coefficient,
LinearTerm  term 
)
inline

Definition at line 657 of file variable_and_expressions.h.

◆ operator*() [2/6]

LinearTerm operator* ( double  coefficient,
Variable  variable 
)
inline

Definition at line 667 of file variable_and_expressions.h.

◆ operator*() [3/6]

LinearExpression operator* ( double  lhs,
LinearExpression  rhs 
)
inline

Definition at line 855 of file variable_and_expressions.h.

◆ operator*() [4/6]

LinearExpression operator* ( LinearExpression  lhs,
double  rhs 
)
inline

Definition at line 850 of file variable_and_expressions.h.

◆ operator*() [5/6]

LinearTerm operator* ( LinearTerm  term,
double  coefficient 
)
inline

Definition at line 662 of file variable_and_expressions.h.

◆ operator*() [6/6]

LinearTerm operator* ( Variable  variable,
double  coefficient 
)
inline

Definition at line 671 of file variable_and_expressions.h.

◆ operator+() [1/15]

LinearExpression operator+ ( const LinearTerm lhs,
const LinearTerm rhs 
)
inline

Definition at line 746 of file variable_and_expressions.h.

◆ operator+() [2/15]

LinearExpression operator+ ( const LinearTerm lhs,
double  rhs 
)
inline

Definition at line 730 of file variable_and_expressions.h.

◆ operator+() [3/15]

LinearExpression operator+ ( const LinearTerm lhs,
Variable  rhs 
)
inline

Definition at line 738 of file variable_and_expressions.h.

◆ operator+() [4/15]

LinearExpression operator+ ( double  lhs,
const LinearTerm rhs 
)
inline

Definition at line 734 of file variable_and_expressions.h.

◆ operator+() [5/15]

LinearExpression operator+ ( double  lhs,
LinearExpression  rhs 
)
inline

Definition at line 755 of file variable_and_expressions.h.

◆ operator+() [6/15]

LinearExpression operator+ ( double  lhs,
Variable  rhs 
)
inline

Definition at line 722 of file variable_and_expressions.h.

◆ operator+() [7/15]

LinearExpression operator+ ( LinearExpression  lhs,
const LinearExpression rhs 
)
inline

Definition at line 778 of file variable_and_expressions.h.

◆ operator+() [8/15]

LinearExpression operator+ ( LinearExpression  lhs,
const LinearTerm rhs 
)
inline

Definition at line 768 of file variable_and_expressions.h.

◆ operator+() [9/15]

LinearExpression operator+ ( LinearExpression  lhs,
double  rhs 
)
inline

Definition at line 750 of file variable_and_expressions.h.

◆ operator+() [10/15]

LinearExpression operator+ ( LinearExpression  lhs,
Variable  rhs 
)
inline

Definition at line 760 of file variable_and_expressions.h.

◆ operator+() [11/15]

LinearExpression operator+ ( LinearTerm  lhs,
LinearExpression  rhs 
)
inline

Definition at line 773 of file variable_and_expressions.h.

◆ operator+() [12/15]

LinearExpression operator+ ( Variable  lhs,
const LinearTerm rhs 
)
inline

Definition at line 742 of file variable_and_expressions.h.

◆ operator+() [13/15]

LinearExpression operator+ ( Variable  lhs,
double  rhs 
)
inline

Definition at line 718 of file variable_and_expressions.h.

◆ operator+() [14/15]

LinearExpression operator+ ( Variable  lhs,
LinearExpression  rhs 
)
inline

Definition at line 764 of file variable_and_expressions.h.

◆ operator+() [15/15]

LinearExpression operator+ ( Variable  lhs,
Variable  rhs 
)
inline

Definition at line 726 of file variable_and_expressions.h.

◆ operator-() [1/16]

LinearExpression operator- ( const LinearTerm lhs,
const LinearTerm rhs 
)
inline

Definition at line 811 of file variable_and_expressions.h.

◆ operator-() [2/16]

LinearExpression operator- ( const LinearTerm lhs,
double  rhs 
)
inline

Definition at line 795 of file variable_and_expressions.h.

◆ operator-() [3/16]

LinearExpression operator- ( const LinearTerm lhs,
Variable  rhs 
)
inline

Definition at line 803 of file variable_and_expressions.h.

◆ operator-() [4/16]

LinearExpression operator- ( double  lhs,
const LinearTerm rhs 
)
inline

Definition at line 799 of file variable_and_expressions.h.

◆ operator-() [5/16]

LinearExpression operator- ( double  lhs,
LinearExpression  rhs 
)
inline

Definition at line 820 of file variable_and_expressions.h.

◆ operator-() [6/16]

LinearExpression operator- ( double  lhs,
Variable  rhs 
)
inline

Definition at line 787 of file variable_and_expressions.h.

◆ operator-() [7/16]

LinearExpression operator- ( LinearExpression  expr)
inline

Definition at line 710 of file variable_and_expressions.h.

◆ operator-() [8/16]

LinearExpression operator- ( LinearExpression  lhs,
const LinearExpression rhs 
)
inline

Definition at line 845 of file variable_and_expressions.h.

◆ operator-() [9/16]

LinearExpression operator- ( LinearExpression  lhs,
const LinearTerm rhs 
)
inline

Definition at line 834 of file variable_and_expressions.h.

◆ operator-() [10/16]

LinearExpression operator- ( LinearExpression  lhs,
double  rhs 
)
inline

Definition at line 815 of file variable_and_expressions.h.

◆ operator-() [11/16]

LinearExpression operator- ( LinearExpression  lhs,
Variable  rhs 
)
inline

Definition at line 826 of file variable_and_expressions.h.

◆ operator-() [12/16]

LinearExpression operator- ( LinearTerm  lhs,
LinearExpression  rhs 
)
inline

Definition at line 839 of file variable_and_expressions.h.

◆ operator-() [13/16]

LinearExpression operator- ( Variable  lhs,
const LinearTerm rhs 
)
inline

Definition at line 807 of file variable_and_expressions.h.

◆ operator-() [14/16]

LinearExpression operator- ( Variable  lhs,
double  rhs 
)
inline

Definition at line 783 of file variable_and_expressions.h.

◆ operator-() [15/16]

LinearExpression operator- ( Variable  lhs,
LinearExpression  rhs 
)
inline

Definition at line 830 of file variable_and_expressions.h.

◆ operator-() [16/16]

LinearExpression operator- ( Variable  lhs,
Variable  rhs 
)
inline

Definition at line 791 of file variable_and_expressions.h.

◆ operator/() [1/3]

LinearExpression operator/ ( LinearExpression  lhs,
double  rhs 
)
inline

Definition at line 860 of file variable_and_expressions.h.

◆ operator/() [2/3]

LinearTerm operator/ ( LinearTerm  term,
double  coefficient 
)
inline

Definition at line 675 of file variable_and_expressions.h.

◆ operator/() [3/3]

LinearTerm operator/ ( Variable  variable,
double  coefficient 
)
inline

Definition at line 680 of file variable_and_expressions.h.

◆ operator<<() [1/4]

std::ostream & operator<< ( std::ostream &  ostr,
const BoundedLinearExpression bounded_expression 
)

Definition at line 126 of file variable_and_expressions.cc.

◆ operator<<() [2/4]

std::ostream & operator<< ( std::ostream &  ostr,
const LinearConstraint linear_constraint 
)
inline

Definition at line 145 of file math_opt/cpp/linear_constraint.h.

◆ operator<<() [3/4]

std::ostream & operator<< ( std::ostream &  ostr,
const LinearExpression expression 
)

Definition at line 93 of file variable_and_expressions.cc.

◆ operator<<() [4/4]

std::ostream & operator<< ( std::ostream &  ostr,
const Variable variable 
)
inline

Definition at line 629 of file variable_and_expressions.h.

◆ operator<=() [1/17]

BoundedLinearExpression operator<= ( const LinearTerm lhs,
const LinearTerm rhs 
)
inline

Definition at line 1195 of file variable_and_expressions.h.

◆ operator<=() [2/17]

BoundedLinearExpression operator<= ( const LinearTerm lhs,
LinearExpression  rhs 
)
inline

Definition at line 1163 of file variable_and_expressions.h.

◆ operator<=() [3/17]

BoundedLinearExpression operator<= ( const LinearTerm lhs,
Variable  rhs 
)
inline

Definition at line 1210 of file variable_and_expressions.h.

◆ operator<=() [4/17]

UpperBoundedLinearExpression operator<= ( const LinearTerm term,
double  constant 
)
inline

Definition at line 1083 of file variable_and_expressions.h.

◆ operator<=() [5/17]

LowerBoundedLinearExpression operator<= ( double  constant,
const LinearTerm term 
)
inline

Definition at line 1058 of file variable_and_expressions.h.

◆ operator<=() [6/17]

LowerBoundedLinearExpression operator<= ( double  constant,
LinearExpression  expression 
)
inline

Definition at line 1048 of file variable_and_expressions.h.

◆ operator<=() [7/17]

LowerBoundedLinearExpression operator<= ( double  constant,
Variable  variable 
)
inline

Definition at line 1068 of file variable_and_expressions.h.

◆ operator<=() [8/17]

BoundedLinearExpression operator<= ( double  lhs,
UpperBoundedLinearExpression  rhs 
)
inline

Definition at line 1124 of file variable_and_expressions.h.

◆ operator<=() [9/17]

UpperBoundedLinearExpression operator<= ( LinearExpression  expression,
double  constant 
)
inline

Definition at line 1073 of file variable_and_expressions.h.

◆ operator<=() [10/17]

BoundedLinearExpression operator<= ( LinearExpression  lhs,
const LinearExpression rhs 
)
inline

Definition at line 1131 of file variable_and_expressions.h.

◆ operator<=() [11/17]

BoundedLinearExpression operator<= ( LinearExpression  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1147 of file variable_and_expressions.h.

◆ operator<=() [12/17]

BoundedLinearExpression operator<= ( LinearExpression  lhs,
Variable  rhs 
)
inline

Definition at line 1179 of file variable_and_expressions.h.

◆ operator<=() [13/17]

BoundedLinearExpression operator<= ( LowerBoundedLinearExpression  lhs,
double  rhs 
)
inline

Definition at line 1103 of file variable_and_expressions.h.

◆ operator<=() [14/17]

BoundedLinearExpression operator<= ( Variable  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1218 of file variable_and_expressions.h.

◆ operator<=() [15/17]

BoundedLinearExpression operator<= ( Variable  lhs,
LinearExpression  rhs 
)
inline

Definition at line 1187 of file variable_and_expressions.h.

◆ operator<=() [16/17]

BoundedLinearExpression operator<= ( Variable  lhs,
Variable  rhs 
)
inline

Definition at line 1226 of file variable_and_expressions.h.

◆ operator<=() [17/17]

UpperBoundedLinearExpression operator<= ( Variable  variable,
double  constant 
)
inline

Definition at line 1093 of file variable_and_expressions.h.

◆ operator==() [1/16]

bool operations_research::math_opt::operator== ( const LinearConstraint lhs,
const LinearConstraint rhs 
)

Definition at line 131 of file math_opt/cpp/linear_constraint.h.

◆ operator==() [2/16]

BoundedLinearExpression operator== ( const LinearTerm lhs,
const LinearTerm rhs 
)
inline

Definition at line 1275 of file variable_and_expressions.h.

◆ operator==() [3/16]

BoundedLinearExpression operator== ( const LinearTerm lhs,
double  rhs 
)
inline

Definition at line 1290 of file variable_and_expressions.h.

◆ operator==() [4/16]

BoundedLinearExpression operator== ( const LinearTerm lhs,
LinearExpression  rhs 
)
inline

Definition at line 1248 of file variable_and_expressions.h.

◆ operator==() [5/16]

BoundedLinearExpression operator== ( const LinearTerm lhs,
Variable  rhs 
)
inline

Definition at line 1282 of file variable_and_expressions.h.

◆ operator==() [6/16]

internal::VariablesEquality operator== ( const Variable lhs,
const Variable rhs 
)
inline

Definition at line 987 of file variable_and_expressions.h.

◆ operator==() [7/16]

BoundedLinearExpression operator== ( double  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1295 of file variable_and_expressions.h.

◆ operator==() [8/16]

BoundedLinearExpression operator== ( double  lhs,
LinearExpression  rhs 
)
inline

Definition at line 1269 of file variable_and_expressions.h.

◆ operator==() [9/16]

BoundedLinearExpression operator== ( double  lhs,
Variable  rhs 
)
inline

Definition at line 1304 of file variable_and_expressions.h.

◆ operator==() [10/16]

BoundedLinearExpression operator== ( LinearExpression  lhs,
const LinearExpression rhs 
)
inline

Definition at line 1234 of file variable_and_expressions.h.

◆ operator==() [11/16]

BoundedLinearExpression operator== ( LinearExpression  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1241 of file variable_and_expressions.h.

◆ operator==() [12/16]

BoundedLinearExpression operator== ( LinearExpression  lhs,
double  rhs 
)
inline

Definition at line 1263 of file variable_and_expressions.h.

◆ operator==() [13/16]

BoundedLinearExpression operator== ( LinearExpression  lhs,
Variable  rhs 
)
inline

Definition at line 1255 of file variable_and_expressions.h.

◆ operator==() [14/16]

BoundedLinearExpression operator== ( Variable  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1286 of file variable_and_expressions.h.

◆ operator==() [15/16]

BoundedLinearExpression operator== ( Variable  lhs,
double  rhs 
)
inline

Definition at line 1300 of file variable_and_expressions.h.

◆ operator==() [16/16]

BoundedLinearExpression operator== ( Variable  lhs,
LinearExpression  rhs 
)
inline

Definition at line 1259 of file variable_and_expressions.h.

◆ operator>=() [1/17]

BoundedLinearExpression operator>= ( const LinearTerm lhs,
const LinearTerm rhs 
)
inline

Definition at line 1203 of file variable_and_expressions.h.

◆ operator>=() [2/17]

BoundedLinearExpression operator>= ( const LinearTerm lhs,
LinearExpression  rhs 
)
inline

Definition at line 1171 of file variable_and_expressions.h.

◆ operator>=() [3/17]

BoundedLinearExpression operator>= ( const LinearTerm lhs,
Variable  rhs 
)
inline

Definition at line 1214 of file variable_and_expressions.h.

◆ operator>=() [4/17]

LowerBoundedLinearExpression operator>= ( const LinearTerm term,
double  constant 
)
inline

Definition at line 1053 of file variable_and_expressions.h.

◆ operator>=() [5/17]

UpperBoundedLinearExpression operator>= ( double  constant,
const LinearTerm term 
)
inline

Definition at line 1088 of file variable_and_expressions.h.

◆ operator>=() [6/17]

UpperBoundedLinearExpression operator>= ( double  constant,
LinearExpression  expression 
)
inline

Definition at line 1078 of file variable_and_expressions.h.

◆ operator>=() [7/17]

UpperBoundedLinearExpression operator>= ( double  constant,
Variable  variable 
)
inline

Definition at line 1098 of file variable_and_expressions.h.

◆ operator>=() [8/17]

BoundedLinearExpression operator>= ( double  lhs,
LowerBoundedLinearExpression  rhs 
)
inline

Definition at line 1110 of file variable_and_expressions.h.

◆ operator>=() [9/17]

LowerBoundedLinearExpression operator>= ( LinearExpression  expression,
double  constant 
)
inline

Definition at line 1043 of file variable_and_expressions.h.

◆ operator>=() [10/17]

BoundedLinearExpression operator>= ( LinearExpression  lhs,
const LinearExpression rhs 
)
inline

Definition at line 1139 of file variable_and_expressions.h.

◆ operator>=() [11/17]

BoundedLinearExpression operator>= ( LinearExpression  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1155 of file variable_and_expressions.h.

◆ operator>=() [12/17]

BoundedLinearExpression operator>= ( LinearExpression  lhs,
Variable  rhs 
)
inline

Definition at line 1183 of file variable_and_expressions.h.

◆ operator>=() [13/17]

BoundedLinearExpression operator>= ( UpperBoundedLinearExpression  lhs,
double  rhs 
)
inline

Definition at line 1117 of file variable_and_expressions.h.

◆ operator>=() [14/17]

BoundedLinearExpression operator>= ( Variable  lhs,
const LinearTerm rhs 
)
inline

Definition at line 1222 of file variable_and_expressions.h.

◆ operator>=() [15/17]

BoundedLinearExpression operator>= ( Variable  lhs,
LinearExpression  rhs 
)
inline

Definition at line 1191 of file variable_and_expressions.h.

◆ operator>=() [16/17]

BoundedLinearExpression operator>= ( Variable  lhs,
Variable  rhs 
)
inline

Definition at line 1230 of file variable_and_expressions.h.

◆ operator>=() [17/17]

LowerBoundedLinearExpression operator>= ( Variable  variable,
double  constant 
)
inline

Definition at line 1063 of file variable_and_expressions.h.

◆ RemoveSparseDoubleVectorZeros()

void RemoveSparseDoubleVectorZeros ( SparseDoubleVectorProto &  sparse_vector)

Definition at line 32 of file math_opt_proto_utils.cc.

◆ SparseBasisStatusVectorIsValid()

absl::Status operations_research::math_opt::SparseBasisStatusVectorIsValid ( const SparseVectorView< int > &  status_vector_view)

Definition at line 199 of file solution_validator.cc.

◆ Sum()

LinearExpression Sum ( const Iterable &  items)
inline

Definition at line 929 of file variable_and_expressions.h.

◆ swap() [1/2]

void operations_research::math_opt::swap ( IdMap< K, V > &  a,
IdMap< K, V > &  b 
)

Definition at line 263 of file id_map.h.

◆ swap() [2/2]

void operations_research::math_opt::swap ( IdSet< K > &  a,
IdSet< K > &  b 
)

Definition at line 172 of file id_set.h.

◆ UpdateIdIndexMap()

void operations_research::math_opt::UpdateIdIndexMap ( glop::StrictITIVector< IndexType, bool >  indices_to_delete,
IndexType  num_indices,
absl::flat_hash_map< int64_t, IndexType > &  id_index_map 
)

Definition at line 103 of file glop_solver.cc.

◆ ValidateBasis()

absl::Status ValidateBasis ( const BasisProto &  basis,
const ModelSummary model_summary 
)

Definition at line 215 of file solution_validator.cc.

◆ ValidateCallbackDataProto()

absl::Status ValidateCallbackDataProto ( const CallbackDataProto &  cb_data,
const CallbackRegistrationProto &  callback_registration,
const ModelSummary model_summary 
)

Definition at line 122 of file callback_validator.cc.

◆ ValidateCallbackRegistration()

absl::Status ValidateCallbackRegistration ( const CallbackRegistrationProto &  callback_registration,
const ModelSummary model_summary 
)

Definition at line 99 of file callback_validator.cc.

◆ ValidateCallbackResultProto()

absl::Status ValidateCallbackResultProto ( const CallbackResultProto &  callback_result,
const CallbackEventProto  callback_event,
const CallbackRegistrationProto &  callback_registration,
const ModelSummary model_summary 
)

Definition at line 251 of file callback_validator.cc.

◆ ValidateDualRay()

absl::Status ValidateDualRay ( const DualRayProto &  dual_ray,
const ModelSolveParametersProto &  parameters,
const ModelSummary model_summary 
)

Definition at line 181 of file solution_validator.cc.

◆ ValidateDualSolution()

absl::Status ValidateDualSolution ( const DualSolutionProto &  dual_solution,
const ModelSolveParametersProto &  parameters,
const ModelSummary model_summary 
)

Definition at line 165 of file solution_validator.cc.

◆ ValidateModel()

absl::Status ValidateModel ( const ModelProto &  model,
const bool  check_names 
)

Definition at line 251 of file math_opt/validators/model_validator.cc.

◆ ValidateModelSolveParameters()

absl::Status ValidateModelSolveParameters ( const ModelSolveParametersProto &  parameters,
const ModelSummary model_summary 
)

Definition at line 48 of file model_parameters_validator.cc.

◆ ValidateModelUpdate()

absl::Status ValidateModelUpdate ( const ModelUpdateProto &  model_update,
const bool  check_names 
)

Definition at line 272 of file math_opt/validators/model_validator.cc.

◆ ValidateModelUpdateAndSummary()

absl::Status ValidateModelUpdateAndSummary ( const ModelUpdateProto &  model_update,
const ModelSummary model_summary,
const bool  check_names 
)

Definition at line 298 of file math_opt/validators/model_validator.cc.

◆ ValidatePrimalRay()

absl::Status ValidatePrimalRay ( const PrimalRayProto &  primal_ray,
const SparseVectorFilterProto &  filter,
const ModelSummary model_summary 
)

Definition at line 156 of file solution_validator.cc.

◆ ValidatePrimalSolution()

absl::Status ValidatePrimalSolution ( const PrimalSolutionProto &  primal_solution,
const SparseVectorFilterProto &  filter,
const ModelSummary model_summary 
)

Definition at line 145 of file solution_validator.cc.

◆ ValidateResult()

absl::Status ValidateResult ( const SolveResultProto &  result,
const ModelSolveParametersProto &  parameters,
const ModelSummary model_summary 
)

Definition at line 43 of file solution_validator.cc.

◆ ValidateSolverParameters()

absl::Status ValidateSolverParameters ( const SolveParametersProto &  parameters)

Definition at line 29 of file solver_parameters_validator.cc.

◆ ValidateSparseVectorFilter()

absl::Status ValidateSparseVectorFilter ( const SparseVectorFilterProto &  v,
const IdNameBiMap valid_ids 
)

Definition at line 33 of file model_parameters_validator.cc.

Variable Documentation

◆ kInf

constexpr double kInf = std::numeric_limits<double>::infinity()
constexpr

Definition at line 35 of file ids_validator.cc.