13#ifndef SANDALS_SOLUTION_HXX
14#define SANDALS_SOLUTION_HXX
55 template <Integer N, Integer M = 0>
58 using Vector = Eigen::Vector<Real, Eigen::Dynamic>;
59 using MatrixN = Eigen::Matrix<Real, N, Eigen::Dynamic>;
60 using MatrixM = Eigen::Matrix<Real, M, Eigen::Dynamic>;
84 this->x.resize(Eigen::NoChange,
size);
85 this->h.resize(Eigen::NoChange,
size);
93 this->t.conservativeResize(
size);
94 this->x.conservativeResize(Eigen::NoChange,
size);
95 this->h.conservativeResize(Eigen::NoChange,
size);
104 this->x.resize(Eigen::NoChange, 0);
105 this->h.resize(Eigen::NoChange, 0);
114 return this->t.size() == 0 && this->x.cols()== 0 && this->h.cols() == 0;
129 return std::vector<Real>(this->t.data(), this->t.data() + this->t.size());
145 Vector tmp(this->x.row(i));
146 return std::vector<Real>(tmp.data(), tmp.data() + tmp.size());
153 std::map<Integer, std::vector<Real>>
std_x()
const
155 std::map<Integer, std::vector<Real>> x_map;
156 for (
Integer i{0}; i < N; ++i) {x_map[i] = this->
std_x(i);}
164 std::map<Integer, Vector>
eig_x()
const
166 std::map<Integer, Vector> x_map;
167 for (
Integer i{0}; i < N; ++i) {x_map[i] = this->x.row(i);}
176 std::map<std::string, std::vector<Real>>
std_x(std::vector<std::string> names)
const
178 std::map<std::string, std::vector<Real>> x_map;
179 for (
Integer i{0}; i < N; ++i) {x_map[names[i]] = this->
std_x(i);}
188 std::map<std::string, Vector>
eig_x(std::vector<std::string> names)
const
190 std::map<std::string, Vector> x_map;
191 for (
Integer i{0}; i < N; ++i) {x_map[names[i]] = this->x.row(i);}
202 Vector tmp(this->h.row(i));
203 return std::vector<Real>(tmp.data(), tmp.data() + tmp.size());
210 std::map<Integer, std::vector<Real>>
std_h()
const
212 std::map<Integer, std::vector<Real>> h_map;
213 for (
Integer i{0}; i < M; ++i) {h_map[i] = this->
std_h(i);}
221 std::map<Integer, Vector>
eig_h()
const
223 std::map<Integer, Vector> h_map;
224 for (
Integer i{0}; i < M; ++i) {h_map[i] = this->h.row(i);}
233 std::map<std::string, std::vector<Real>>
std_h(std::vector<std::string> names)
const
235 std::map<std::string, std::vector<Real>> h_map;
236 for (
Integer i{0}; i < M; ++i) {h_map[names[i]] = this->
std_h(i);}
245 std::map<std::string, Vector>
eig_h(std::vector<std::string> names)
const
247 std::map<std::string, Vector> h_map;
248 for (
Integer i{0}; i < M; ++i) {h_map[names[i]] = this->h.row(i);}
The namespace for the Sandals library.
Definition Sandals.hh:73
int Integer
Definition Sandals.hh:85
std::vector< Real > std_t() const
Definition Solution.hxx:127
Vector eig_t() const
Definition Solution.hxx:136
void clear()
Definition Solution.hxx:101
Vector t
Definition Solution.hxx:62
std::map< std::string, Vector > eig_h(std::vector< std::string > names) const
Definition Solution.hxx:245
std::map< std::string, Vector > eig_x(std::vector< std::string > names) const
Definition Solution.hxx:188
std::map< Integer, std::vector< Real > > std_h() const
Definition Solution.hxx:210
std::map< Integer, Vector > eig_x() const
Definition Solution.hxx:164
Eigen::Matrix< Real, M, Eigen::Dynamic > MatrixM
Definition Solution.hxx:60
std::vector< Real > std_x(Integer i) const
Definition Solution.hxx:143
Eigen::Matrix< Real, N, Eigen::Dynamic > MatrixN
Definition Solution.hxx:59
std::map< std::string, std::vector< Real > > std_x(std::vector< std::string > names) const
Definition Solution.hxx:176
Eigen::Vector< Real, Eigen::Dynamic > Vector
Definition Solution.hxx:58
void resize(Integer size)
Definition Solution.hxx:82
void conservative_resize(Integer size)
Definition Solution.hxx:92
bool is_empty() const
Definition Solution.hxx:112
std::map< std::string, std::vector< Real > > std_h(std::vector< std::string > names) const
Definition Solution.hxx:233
MatrixN x
Definition Solution.hxx:63
Integer size() const
Definition Solution.hxx:121
Solution(Integer size)
Definition Solution.hxx:75
std::vector< Real > std_h(Integer i) const
Definition Solution.hxx:200
Solution()
Definition Solution.hxx:69
MatrixM h
Definition Solution.hxx:64
std::map< Integer, Vector > eig_h() const
Definition Solution.hxx:221
std::map< Integer, std::vector< Real > > std_x() const
Definition Solution.hxx:153