MIMPC++
A fast typesafe Mixed Integer MPC C++ library
System.hpp
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <eigen3/Eigen/Dense>
11 
12 namespace mimpc {
13 
31  template<int num_states, int num_cont_inputs, int num_bin_inputs>
32  class System {
33  public:
34  static constexpr auto NUM_STATES = num_states;
35  static constexpr auto NUM_CONT_INPUTS = num_cont_inputs;
36  static constexpr auto NUM_BIN_INPUTS = num_bin_inputs;
37  static constexpr auto NUM_INPUTS = num_bin_inputs + num_cont_inputs;
38 
39  using AMatrix = typename Eigen::Matrix<double, num_states, num_states>;
40  using BMatrix = typename Eigen::Matrix<double, num_states, num_cont_inputs + num_bin_inputs>;
41  using StateVec = typename Eigen::Vector<double, num_states>;
42  using InputVec = typename Eigen::Vector<double, num_cont_inputs + num_bin_inputs>;
43 
49  virtual AMatrix getA(const StateVec &state) const = 0;
50 
56  virtual BMatrix getB(const StateVec &state) const = 0;
57 
64  virtual void
65  updateA(const StateVec &state, std::function<void(unsigned int, unsigned int, double)> &changeAval) const = 0;
66 
73  virtual void
74  updateB(const StateVec &state, std::function<void(unsigned int, unsigned int, double)> &changeBval) const = 0;
75  };
76 }
Definition: System.hpp:32
virtual void updateB(const StateVec &state, std::function< void(unsigned int, unsigned int, double)> &changeBval) const =0
virtual AMatrix getA(const StateVec &state) const =0
virtual void updateA(const StateVec &state, std::function< void(unsigned int, unsigned int, double)> &changeAval) const =0
virtual BMatrix getB(const StateVec &state) const =0