WaveBlocksND
hagedornparameters.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdexcept>
4 
5 #include <yaml-cpp/yaml.h>
6 
7 #include "../types.hpp"
8 #include "../wavepackets/hawp_paramset.hpp"
9 
10 
11 namespace YAML {
12  template<int D>
13  struct convert<waveblocks::wavepackets::HaWpParamSet<D>> {
14 
16  YAML::Node pinode;
17 
18  pinode["q"] = PI.q();
19  pinode["p"] = PI.p();
20  pinode["Q"] = PI.Q();
21  pinode["P"] = PI.P();
22  pinode["S"] = PI.S();
23 
24  return pinode;
25  }
26 
27  static bool decode(const Node& pinode, waveblocks::wavepackets::HaWpParamSet<D> & PI) {
28  if (pinode["q"]) {
29  PI.q(pinode["q"].as<waveblocks::RMatrix<D,1>>());
30  }
31  if (pinode["p"]) {
32  PI.p(pinode["p"].as<waveblocks::RMatrix<D,1>>());
33  }
34  if (pinode["Q"]) {
35  PI.Q(pinode["Q"].as<waveblocks::CMatrix<D,D>>());
36  }
37  if (pinode["P"]) {
38  PI.P(pinode["P"].as<waveblocks::CMatrix<D,D>>());
39  }
40  if (pinode["S"]) {
41  PI.S(pinode["S"].as<waveblocks::complex_t>());
42  }
43  return true;
44  }
45  };
46 }
static Node encode(const waveblocks::wavepackets::HaWpParamSet< D > &PI)
Definition: hagedornparameters.hpp:15
RMatrix< D, 1 > const & p() const
Get the parameter .
Definition: hawp_paramset.hpp:102
Definition: coefficients_file_parser.cpp:10
complex_t const & S() const
Get the parameter .
Definition: hawp_paramset.hpp:111
Eigen::Matrix< real_t, R, C > RMatrix
Definition: types.hpp:22
CMatrix< D, D > const & Q() const
Get the parameter .
Definition: hawp_paramset.hpp:105
static bool decode(const Node &pinode, waveblocks::wavepackets::HaWpParamSet< D > &PI)
Definition: hagedornparameters.hpp:27
This class represents the Hagedorn parameter set .
Definition: hawp_paramset.hpp:24
Definition: complex.hpp:10
CMatrix< D, D > const & P() const
Get the parameter .
Definition: hawp_paramset.hpp:108
RMatrix< D, 1 > const & q() const
Get the parameter .
Definition: hawp_paramset.hpp:99
Eigen::Matrix< complex_t, R, C > CMatrix
Definition: types.hpp:19