37 std::cout << __FILE__ << " " << __LINE__ << ": " << msg << std::endl
45#define __METHOD_NAME__ details::methodName(__PRETTY_FUNCTION__)
58inline std::string
methodName(
const std::string &pretty_function)
60 size_t colons = pretty_function.find(
"::");
61 size_t begin = pretty_function.substr(0, colons).rfind(
" ") + 1;
62 size_t end = pretty_function.rfind(
"(") - begin;
64 return pretty_function.substr(begin, end) +
"()";
107bool mkpath(std::string path,
int mode = 0777);
130std::string
concatpath(
const std::string &left,
const std::string &right);
133void print_sp_matrix_structure(
const arma::sp_cx_mat &A);
136std::vector<std::string> split(
const std::string &s,
char delim);
139std::string <rim(std::string &s,
const char *t =
" \t\n\r\f\v");
142std::string &rtrim(std::string &s,
const char *t =
" \t\n\r\f\v");
145std::string &trim(std::string &s,
const char *t =
" \t\n\r\f\v");
149std::string ltrim_copy(std::string s,
const char *t =
" \t\n\r\f\v");
151std::string rtrim_copy(std::string s,
const char *t =
" \t\n\r\f\v");
153std::string trim_copy(std::string s,
const char *t =
" \t\n\r\f\v");
std::string methodName(const std::string &pretty_function)
Takes in the PRETTY_FUNCTION string and removes the return type.
bool mkpath(std::string path, int mode=0777)
Make path given.
std::string scientific_format(double d, int width=20, int prec=10)
Turns a double into a string written in scientific format.
std::string concatpath(const std::string &left, const std::string &right)
Take 2 strings and concatenate them and make sure there is a directory separator (/) between them.
std::string dirname(const std::string &path)
Get the directory name of the path.