1 #ifndef HOPS_LINEARPROGRAMFACTORY_HPP
2 #define HOPS_LINEARPROGRAMFACTORY_HPP
16 #if defined(HOPS_CLP_FOUND) && defined(HOPS_GUROBI_FOUND)
18 class LinearProgramFactory {
20 template<
typename Derived1,
typename Derived2>
22 const Eigen::MatrixBase<Derived1> &A,
23 const Eigen::MatrixBase<Derived2> &b,
27 return std::make_unique<LinearProgramClpImpl>(A, b);
30 return std::make_unique<LinearProgramGurobiImpl>(A, b);
36 #elif defined(HOPS_CLP_FOUND)
38 class LinearProgramFactory {
40 template<
typename Derived1,
typename Derived2>
42 const Eigen::MatrixBase<Derived1> &A,
43 const Eigen::MatrixBase<Derived2> &b,
47 return std::make_unique<LinearProgramClpImpl>(A, b);
50 throw std::runtime_error(
"Linear program solver was not found.");
56 #elif defined(HOPS_GUROBI_FOUND)
58 class LinearProgramFactory {
60 template<
typename Derived1,
typename Derived2>
62 const Eigen::MatrixBase<Derived1> &A,
63 const Eigen::MatrixBase<Derived2> &b,
67 return std::make_unique<LinearProgramGurobiImpl>(A, b);
70 throw std::runtime_error(
"Linear program solver was not found.");
80 template<
typename Derived1,
typename Derived2>
82 const Eigen::MatrixBase<Derived1> &A,
83 const Eigen::MatrixBase<Derived2> &b,
88 throw std::runtime_error(
"No linear program solver was found.");
92 #endif //HOPS_CLP_FOUND && HOPS_GUROBI_FOUND
96 #endif //HOPS_LINEARPROGRAMFACTORY_HPP