5 #include <yaml-cpp/yaml.h> 8 #include "../wavepackets/hawp_paramset.hpp" 21 HaWpParamSet<D> params;
38 Eigen::Matrix<real_t,D,1> result(D,1);
40 if (config.size() != D)
41 throw std::runtime_error(
"encountered vector dimension != parameter set dimensionality");
43 for (
dim_t i = 0; i < D; i++) {
44 result(i,0) = config[i].as<
double>();
52 Eigen::Matrix<complex_t,D,D> result(D,D);
54 if (config.size() != D)
55 throw std::runtime_error(
"encountered matrix column dimension != parameter set dimensionality");
57 for (
dim_t i = 0; i < D; i++) {
58 YAML::Node
const& in_row = config[i];
60 if (in_row.size() != D)
61 throw std::runtime_error(
"encountered matrix row dimension != parameter set dimensionality");
63 for (
dim_t j = 0; j < D; j++) {
64 result(i,j) = in_row[j].as< std::complex<double> >();
Definition: coefficients_file_parser.cpp:10
Definition: hawp_paramset_decoder.hpp:16
HaWpParamSet< D > operator()(YAML::Node const &config)
Definition: hawp_paramset_decoder.hpp:19
Eigen::Matrix< complex_t, D, D > decode_cmatrix(YAML::Node const &config)
Definition: hawp_paramset_decoder.hpp:50
Eigen::Matrix< real_t, D, 1 > decode_rvector(YAML::Node const &config)
Definition: hawp_paramset_decoder.hpp:36
int dim_t
Definition: types.hpp:16