hops
LinearProgram.hpp
Go to the documentation of this file.
1 #ifndef HOPS_LINEARPROGRAMMING_HPP
2 #define HOPS_LINEARPROGRAMMING_HPP
3 
4 #include <Eigen/Core>
6 #include <utility>
7 
8 namespace hops {
9  class LinearProgram {
10  public:
11  LinearProgram(Eigen::MatrixXd a, Eigen::VectorXd b) : A(std::move(a)), b(std::move(b)) {}
12 
13  virtual ~LinearProgram() = default;
14 
15  virtual LinearProgramSolution solve(const Eigen::VectorXd &objective) const = 0;
16 
23  virtual std::tuple<Eigen::MatrixXd, Eigen::VectorXd> removeRedundantConstraints(double tolerance) = 0;
24 
25  [[nodiscard]] virtual LinearProgramSolution computeChebyshevCenter() const = 0;
26 
32  [[nodiscard]] virtual std::vector<long> computeUnconstrainedDimensions() const = 0;
33 
41  virtual std::tuple<Eigen::MatrixXd, Eigen::VectorXd>
42  addBoxConstraintsToUnconstrainedDimensions(double lb, double ub) = 0;
43 
44  [[nodiscard]] const Eigen::MatrixXd &getA() const {
45  return A;
46  }
47 
48  [[nodiscard]] const Eigen::VectorXd &getB() const {
49  return b;
50  }
51 
52  protected:
53  Eigen::MatrixXd A;
54  Eigen::VectorXd b;
55  };
56 }
57 
58 #endif //HOPS_LINEARPROGRAMMING_HPP
hops::LinearProgram::addBoxConstraintsToUnconstrainedDimensions
virtual std::tuple< Eigen::MatrixXd, Eigen::VectorXd > addBoxConstraintsToUnconstrainedDimensions(double lb, double ub)=0
Adds box constraints to unconstrained dimensions and returns system matrices. Changes to the system m...
hops::LinearProgram::getB
const Eigen::VectorXd & getB() const
Definition: LinearProgram.hpp:48
hops::LinearProgram::computeChebyshevCenter
virtual LinearProgramSolution computeChebyshevCenter() const =0
hops::LinearProgram
Definition: LinearProgram.hpp:9
hops::LinearProgram::b
Eigen::VectorXd b
Definition: LinearProgram.hpp:54
hops::LinearProgram::~LinearProgram
virtual ~LinearProgram()=default
hops::LinearProgramSolution
Definition: LinearProgramSolution.hpp:9
hops::LinearProgram::A
Eigen::MatrixXd A
Definition: LinearProgram.hpp:53
hops
Definition: CsvReader.hpp:8
hops::LinearProgram::computeUnconstrainedDimensions
virtual std::vector< long > computeUnconstrainedDimensions() const =0
hops::LinearProgram::removeRedundantConstraints
virtual std::tuple< Eigen::MatrixXd, Eigen::VectorXd > removeRedundantConstraints(double tolerance)=0
Removes redundant constraints and returns system matrices. Changes to the system matrices are reflect...
hops::LinearProgram::solve
virtual LinearProgramSolution solve(const Eigen::VectorXd &objective) const =0
LinearProgramSolution.hpp
hops::LinearProgram::LinearProgram
LinearProgram(Eigen::MatrixXd a, Eigen::VectorXd b)
Definition: LinearProgram.hpp:11
hops::LinearProgram::getA
const Eigen::MatrixXd & getA() const
Definition: LinearProgram.hpp:44