13#ifndef SANDALS_SOLUTION_HH
14#define SANDALS_SOLUTION_HH
58 template <
typename Real, Integer N, Integer M = 0>
61 using Vector = Eigen::Vector<Real, Eigen::Dynamic>;
62 using MatrixN = Eigen::Matrix<Real, N, Eigen::Dynamic>;
63 using MatrixM = Eigen::Matrix<Real, M, Eigen::Dynamic>;
87 this->x.resize(Eigen::NoChange,
size);
88 this->h.resize(Eigen::NoChange,
size);
96 this->t.conservativeResize(
size);
97 this->x.conservativeResize(Eigen::NoChange,
size);
98 this->h.conservativeResize(Eigen::NoChange,
size);
107 this->x.resize(Eigen::NoChange, 0);
108 this->h.resize(Eigen::NoChange, 0);
117 return this->t.size() == 0 && this->x.cols()== 0 && this->h.cols() == 0;
132 return std::vector<Real>(this->t.data(), this->t.data() + this->t.size());
148 Vector tmp(this->x.row(i));
149 return std::vector<Real>(tmp.data(), tmp.data() + tmp.size());
156 std::map<Integer, std::vector<Real>>
std_x()
const
158 std::map<Integer, std::vector<Real>> x_map;
159 for (
Integer i{0}; i < N; ++i) {x_map[i] = this->
std_x(i);}
167 std::map<Integer, Vector>
eig_x()
const
169 std::map<Integer, Vector> x_map;
170 for (
Integer i{0}; i < N; ++i) {x_map[i] = this->x.row(i);}
179 std::map<std::string, std::vector<Real>>
std_x(std::vector<std::string> names)
const
181 std::map<std::string, std::vector<Real>> x_map;
182 for (
Integer i{0}; i < N; ++i) {x_map[names[i]] = this->
std_x(i);}
191 std::map<std::string, Vector>
eig_x(std::vector<std::string> names)
const
193 std::map<std::string, Vector> x_map;
194 for (
Integer i{0}; i < N; ++i) {x_map[names[i]] = this->x.row(i);}
205 Vector tmp(this->h.row(i));
206 return std::vector<Real>(tmp.data(), tmp.data() + tmp.size());
213 std::map<Integer, std::vector<Real>>
std_h()
const
215 std::map<Integer, std::vector<Real>> h_map;
216 for (
Integer i{0}; i < M; ++i) {h_map[i] = this->
std_h(i);}
224 std::map<Integer, Vector>
eig_h()
const
226 std::map<Integer, Vector> h_map;
227 for (
Integer i{0}; i < M; ++i) {h_map[i] = this->h.row(i);}
236 std::map<std::string, std::vector<Real>>
std_h(std::vector<std::string> names)
const
238 std::map<std::string, std::vector<Real>> h_map;
239 for (
Integer i{0}; i < M; ++i) {h_map[names[i]] = this->
std_h(i);}
248 std::map<std::string, Vector>
eig_h(std::vector<std::string> names)
const
250 std::map<std::string, Vector> h_map;
251 for (
Integer i{0}; i < M; ++i) {h_map[names[i]] = this->h.row(i);}
The namespace for the Sandals library.
Definition Sandals.hh:89
SANDALS_DEFAULT_INTEGER_TYPE Integer
The Integer type as used for the API.
Definition Sandals.hh:97
MatrixN x
Definition Solution.hh:66
Solution()
Definition Solution.hh:72
Integer size() const
Definition Solution.hh:124
std::map< std::string, Vector > eig_h(std::vector< std::string > names) const
Definition Solution.hh:248
bool is_empty() const
Definition Solution.hh:115
Eigen::Matrix< Real, M, Eigen::Dynamic > MatrixM
Definition Solution.hh:63
std::vector< Real > std_t() const
Definition Solution.hh:130
Vector eig_t() const
Definition Solution.hh:139
std::map< Integer, std::vector< Real > > std_h() const
Definition Solution.hh:213
std::map< Integer, std::vector< Real > > std_x() const
Definition Solution.hh:156
std::map< std::string, Vector > eig_x(std::vector< std::string > names) const
Definition Solution.hh:191
Eigen::Matrix< Real, N, Eigen::Dynamic > MatrixN
Definition Solution.hh:62
Solution(Integer size)
Definition Solution.hh:78
void resize(Integer size)
Definition Solution.hh:85
Vector t
Definition Solution.hh:65
std::map< std::string, std::vector< Real > > std_x(std::vector< std::string > names) const
Definition Solution.hh:179
void clear()
Definition Solution.hh:104
std::vector< Real > std_h(Integer i) const
Definition Solution.hh:203
std::map< Integer, Vector > eig_x() const
Definition Solution.hh:167
void conservative_resize(Integer size)
Definition Solution.hh:95
MatrixM h
Definition Solution.hh:67
Eigen::Vector< Real, Eigen::Dynamic > Vector
Definition Solution.hh:61
std::map< Integer, Vector > eig_h() const
Definition Solution.hh:224
std::map< std::string, std::vector< Real > > std_h(std::vector< std::string > names) const
Definition Solution.hh:236
std::vector< Real > std_x(Integer i) const
Definition Solution.hh:146