17#ifndef OR_TOOLS_MATH_OPT_CPP_SPARSE_CONTAINERS_H_
18#define OR_TOOLS_MATH_OPT_CPP_SPARSE_CONTAINERS_H_
22#include "absl/container/flat_hash_map.h"
29#include "ortools/math_opt/solution.pb.h"
30#include "ortools/math_opt/sparse_containers.pb.h"
45 const ModelStorage*
model,
const SparseDoubleVectorProto& vars_proto);
55 const ModelStorage*
model,
const SparseInt32VectorProto& vars_proto);
68absl::StatusOr<absl::flat_hash_map<Objective, double>>
70 const ModelStorage*
model,
71 const google::protobuf::Map<int64_t, double>& aux_obj_proto);
78 const absl::flat_hash_map<Objective, double>& aux_obj_values);
91 const ModelStorage*
model,
const SparseDoubleVectorProto& lin_cons_proto);
108absl::StatusOr<absl::flat_hash_map<QuadraticConstraint, double>>
110 const ModelStorage*
model,
const SparseDoubleVectorProto& quad_cons_proto);
114 const absl::flat_hash_map<QuadraticConstraint, double>&
115 quadratic_constraint_values);
126 const ModelStorage*
model,
const SparseBasisStatusVector& basis_proto);
141 const ModelStorage*
model,
const SparseBasisStatusVector& basis_proto);
An object oriented wrapper for quadratic constraints in ModelStorage.
google::protobuf::Map< int64_t, double > AuxiliaryObjectiveValuesToProto(const absl::flat_hash_map< Objective, double > &aux_obj_values)
absl::StatusOr< absl::flat_hash_map< Objective, double > > AuxiliaryObjectiveValuesFromProto(const ModelStorage *const model, const google::protobuf::Map< int64_t, double > &aux_obj_proto)
absl::flat_hash_map< Variable, V > VariableMap
absl::flat_hash_map< LinearConstraint, V > LinearConstraintMap
SparseDoubleVectorProto LinearConstraintValuesToProto(const LinearConstraintMap< double > &linear_constraint_values)
Returns the proto equivalent of linear_constraint_values.
absl::StatusOr< LinearConstraintMap< BasisStatus > > LinearConstraintBasisFromProto(const ModelStorage *const model, const SparseBasisStatusVector &basis_proto)
absl::StatusOr< absl::flat_hash_map< QuadraticConstraint, double > > QuadraticConstraintValuesFromProto(const ModelStorage *const model, const SparseDoubleVectorProto &quad_cons_proto)
absl::StatusOr< LinearConstraintMap< double > > LinearConstraintValuesFromProto(const ModelStorage *const model, const SparseDoubleVectorProto &lin_cons_proto)
absl::StatusOr< VariableMap< double > > VariableValuesFromProto(const ModelStorage *const model, const SparseDoubleVectorProto &vars_proto)
SparseBasisStatusVector VariableBasisToProto(const VariableMap< BasisStatus > &basis_values)
Returns the proto equivalent of basis_values.
SparseBasisStatusVector LinearConstraintBasisToProto(const LinearConstraintMap< BasisStatus > &basis_values)
Returns the proto equivalent of basis_values.
SparseDoubleVectorProto VariableValuesToProto(const VariableMap< double > &variable_values)
Returns the proto equivalent of variable_values.
SparseDoubleVectorProto QuadraticConstraintValuesToProto(const absl::flat_hash_map< QuadraticConstraint, double > &quadratic_constraint_values)
Returns the proto equivalent of quadratic_constraint_values.
absl::StatusOr< VariableMap< BasisStatus > > VariableBasisFromProto(const ModelStorage *const model, const SparseBasisStatusVector &basis_proto)