1#ifndef CGMRES__LOGGER_HPP_
2#define CGMRES__LOGGER_HPP_
23 explicit Logger(
const std::string& log_name)
24 : log_name_(log_name),
25 t_log_(log_name+
"_t.log"),
26 x_log_(log_name+
"_x.log"),
27 u_log_(log_name +
"_u.log"),
28 opterr_log_(log_name +
"_opterr.log") {
48 template <
typename StateVectorType,
typename ControlInputVectorType>
51 const double opterr) {
53 x_log_ << x.transpose() <<
'\n';
54 u_log_ << u.transpose() <<
'\n';
55 opterr_log_ << opterr <<
'\n';
63 std::ofstream timing_log(log_name_ +
"_timing_profile.log");
64 timing_log << timing_profile;
69 std::string log_name_;
70 std::ofstream t_log_, x_log_, u_log_, opterr_log_;
Logger for MPC.
Definition: logger.hpp:17
~Logger()
Destructor.
Definition: logger.hpp:34
void save(const TimingProfile &timing_profile) const
Save the timing profile.
Definition: logger.hpp:62
void save(const Scalar t, const MatrixBase< StateVectorType > &x, const MatrixBase< ControlInputVectorType > &u, const double opterr)
Save datas.
Definition: logger.hpp:49
Logger(const std::string &log_name)
Constructor.
Definition: logger.hpp:23
Definition: continuation_gmres.hpp:11
double Scalar
Alias of double.
Definition: types.hpp:11
Eigen::MatrixBase< MatrixType > MatrixBase
Alias of Eigen::MatrixBase.
Definition: types.hpp:29
A profile of the timing benchmark.
Definition: timer.hpp:16