9template <
typename _Scalar>
struct ResultsBaseTpl {
31 std::vector<VectorXs>
xs;
33 std::vector<VectorXs>
us;
40 return this->gains_[i].col(0);
45 return this->gains_[i].col(0);
50 return this->gains_[i].rightCols(this->get_ndx1(i));
55 return this->gains_[i].rightCols(this->get_ndx1(i));
59 const std::size_t N =
us.size();
60 std::vector<MatrixXs> out;
61 for (std::size_t i = 0; i < N; i++) {
62 const Eigen::Index nu =
us[i].rows();
69 const std::size_t N =
us.size();
70 std::vector<VectorXs> out;
71 for (std::size_t i = 0; i < N; i++) {
72 const Eigen::Index nu =
us[i].rows();
82 Eigen::Index get_ndx1(std::size_t i)
const {
83 return this->gains_[i].cols() - 1;
87template <
typename Scalar>
89 oss << fmt::format(
"\n num_iters: {:d},", num_iters)
90 << fmt::format(
"\n converged: {},", conv)
91 << fmt::format(
"\n traj. cost: {:.3e},", traj_cost_)
92 << fmt::format(
"\n merit.value: {:.3e},", merit_value_)
93 << fmt::format(
"\n prim_infeas: {:.3e},", prim_infeas)
94 << fmt::format(
"\n dual_infeas: {:.3e},", dual_infeas);
97template <
typename Scalar>
108#ifdef ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION
109#include "./results-base.txx"
std::ostream & operator<<(std::ostream &oss, const ExplicitDynamicsDataTpl< S > &self)
std::vector< VectorXs > xs
States.
ALIGATOR_DYNAMIC_TYPEDEFS(Scalar)
virtual ~ResultsBaseTpl()=default
decltype(auto) getFeedback(std::size_t i)
Get expression of the primal-dual feedback gains.
decltype(auto) getFeedback(std::size_t i) const
Get expression of the primal-dual feedback gains.
std::vector< VectorXs > getCtrlFeedforwards() const
Scalar dual_infeas
Overall dual infeasibility measure.
decltype(auto) getFeedforward(std::size_t i)
Get column expression of the primal-dual feedforward gain.
Scalar prim_infeas
Overall primal infeasibility measure/constraint violation.
decltype(auto) getFeedforward(std::size_t i) const
Get column expression of the primal-dual feedforward gain.
std::vector< VectorXs > us
Controls.
bool isInitialized() const
std::vector< MatrixXs > gains_
Riccati gains.
void printBase(std::ostream &oss) const
std::vector< MatrixXs > getCtrlFeedbacks() const