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