70 rowvec def_vec = randu<rowvec>(10);
71 cx_vec def_vec_cx = randu<cx_vec>(10);
72 mat def_mat = randu<mat>(5, 5);
73 cx_mat def_matx = randu<cx_mat>(5, 5);
75 def_vec_int << 1 << 2 << 3 << 4;
78 parser testpar(
"test.par");
80 rowvec x = testpar.
getRow(
"x", def_vec);
81 cx_vec y = testpar.
getCxCol(
"y", def_vec_cx);
82 mat A = testpar.
getMat(
"A", def_mat);
83 cx_mat B = testpar.
getCxMat(
"B", def_matx);
84 std::string my_text = testpar.
getString(
"my_text",
"DEFAULT");
85 int N = testpar.
getParam<
int>(
"N", 125000);
86 double pi_val = testpar.
getParam<
double>(
"pi_val", 3.1);
87 Col<int> Z = testpar.
getCol(
"Z", def_vec_int);
89 std::cout <<
"my_text= " << my_text << std::endl;
90 std::cout <<
"N= " << N << std::endl;
91 std::cout <<
"pi_val= " << pi_val << std::endl;
92 std::cout <<
"x= \n" << x << std::endl;
93 std::cout <<
"y= \n" << y << std::endl;
94 std::cout <<
"A= \n" << A << std::endl;
95 std::cout <<
"B= \n" << B << std::endl;
96 std::cout <<
"Z= \n" << Z << std::endl;
T getParam(const std::string key, const T def_val)
Generic type get function.
arma::cx_mat getCxMat(const std::string key, const arma::cx_mat def_val)
cx_mat type get function.
std::string getString(const std::string key, const std::string def_val)
String type get function.
arma::cx_vec getCxCol(const std::string key, const arma::cx_vec def_val)
cx_vec type get function.
arma::Mat< T > getMat(const std::string key, const arma::Mat< T > def_val)
Mat type get function.
arma::Col< T > getCol(const std::string key, const arma::Col< T > def_val)
Col type get function.
arma::Row< T > getRow(const std::string key, const arma::Row< T > def_val)
Row type get function.