40#include <itpp/itexports.h>
46#if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB))
48template class ITPP_EXPORT
Array<std::string>;
119 Parser(
const std::string &filename);
122 Parser(
int argc,
char *argv[]);
125 Parser(
const std::string &filename,
int argc,
char *argv[]);
131 void init(
const std::string &filename);
134 void init(
int argc,
char *argv[]);
137 void init(
const std::string &filename,
int argc,
char *argv[]);
146 bool exist(
const std::string &name);
150 bool get(T &var,
const std::string &name,
int num = -1);
153 bool get_bool(
const std::string &name,
int num = -1);
156 int get_int(
const std::string &name,
int num = -1);
159 double get_double(
const std::string &name,
int num = -1);
162 std::string
get_string(
const std::string &name,
int num = -1);
165 vec
get_vec(
const std::string &name,
int num = -1);
168 ivec
get_ivec(
const std::string &name,
int num = -1);
171 svec
get_svec(
const std::string &name,
int num = -1);
174 bvec
get_bvec(
const std::string &name,
int num = -1);
177 mat
get_mat(
const std::string &name,
int num = -1);
180 imat
get_imat(
const std::string &name,
int num = -1);
183 smat
get_smat(
const std::string &name,
int num = -1);
193 std::string findname(
const std::string &name,
197 bool keep_brackets =
false);
199 void pre_parsing(
void);
211 bool error_flag, print_flag;
212 std::string str = findname(name, error_flag, print_flag, num,
true);
213 std::istringstream buffer(str);
216 std::cout << name <<
" = " << var <<
";" << std::endl;
222 std::cout << name <<
" = " << var << std::endl;
225 std::cout << name <<
" = " << var <<
";" << std::endl;
233ITPP_EXPORT
bool Parser::get(std::string &var,
const std::string &name,
int num);
236ITPP_EXPORT
bool Parser::get(
int &var,
const std::string &name,
int num);
239ITPP_EXPORT
bool Parser::get(
bool &var,
const std::string &name,
int num);
Definition of Array class (container)
double get_double(const std::string &name, int num=-1)
Interpret variable name as a double.
void set_silentmode(bool v=true)
Sets silent mode if true, or verbose mode if false.
svec get_svec(const std::string &name, int num=-1)
Interpret variable name as a svec.
mat get_mat(const std::string &name, int num=-1)
Interpret variable name as a mat.
int get_int(const std::string &name, int num=-1)
Interpret variable name as an integer.
ivec get_ivec(const std::string &name, int num=-1)
Interpret variable name as a ivec.
bvec get_bvec(const std::string &name, int num=-1)
Interpret variable name as a bvec.
imat get_imat(const std::string &name, int num=-1)
Interpret variable name as a imat.
bool get_bool(const std::string &name, int num=-1)
Interpret variable name as a bool.
void init(const std::string &filename)
Initialization function. Sets input file name.
Parser()
Default Constructor.
smat get_smat(const std::string &name, int num=-1)
Interpret variable name as a smat.
std::string get_string(const std::string &name, int num=-1)
Interpret variable name as a string.
bool get(T &var, const std::string &name, int num=-1)
Get variable value if name can be found (and return true), otherwise keep old value (and return false...
bool exist(const std::string &name)
Check is name exists in the file. Returns true if the name is found and false otherwise.
vec get_vec(const std::string &name, int num=-1)
Interpret variable name as a vec.
bmat get_bmat(const std::string &name, int num=-1)
Interpret variable name as a bmat.
Matrix Class Definitions.
Mat< bin > bmat
bin matrix
Templated Vector Class Definitions.