Miscellaneous functions. More...
#include <cstdlib>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <cmath>
#include <map>
#include <initializer_list>
#include <o2scl/err_hnd.h>
Go to the source code of this file.
Classes | |
class | o2scl::gen_test_number< tot > |
Generate number sequence for testing. More... | |
class | o2scl::vec_index |
A class to assign string labels to array indices. More... | |
Namespaces | |
o2scl | |
The main O2scl namespace. | |
Functions | |
int | o2scl_python_test (int x) |
New abs() function | |
float | o2scl::o2abs (const float x) |
Absolute value for single precision numbers. | |
double | o2scl::o2abs (const double x) |
Absolute value for double precision numbers. | |
long double | o2scl::o2abs (const long double x) |
Absolute value for long double. | |
boost::multiprecision::cpp_dec_float_50 | o2scl::o2abs (const boost::multiprecision::cpp_dec_float_50 x) |
Absolute value for cpp_dec_float_50. | |
bool | o2scl::o2isfinite (const double x) |
Compatbility function for isfinite() More... | |
bool | o2scl::o2isfinite (const boost::multiprecision::cpp_dec_float_50 x) |
Compatbility function for isfinite() | |
Functions from src/base/misc.h | |
double | o2scl::fermi_function (double E, double mu, double T, double limit=40.0) |
Calculate a Fermi-Dirac distribution function safely. More... | |
double | o2scl::bose_function (double E, double mu, double T, double limit=40.0) |
Calculate a Bose-Einstein distribution function safely. More... | |
int | o2scl::pipe_cmd_string (std::string cmd, std::string &result, bool err_on_fail=true, int nmax=80) |
Store the first line from the output of the shell command cmd up to nmax characters in result . More... | |
std::string | o2scl::pipe_cmd_string (std::string cmd, int nmax=80) |
Return the first line from the output of the shell command cmd up to nmax characters. More... | |
bool | o2scl::file_exists (std::string fname) |
Return true if file named fname exists. | |
template<class string_arr_t > | |
void | o2scl::screenify (size_t nin, const string_arr_t &in_cols, std::vector< std::string > &out_cols, size_t max_size=80) |
Reformat the columns for output of width size . More... | |
size_t | o2scl::count_words (std::string str) |
Count the number of words in the string str . More... | |
void | o2scl::remove_whitespace (std::string &s) |
Remove all whitespace from the string s . More... | |
std::string | o2scl::binary_to_hex (std::string s) |
Take a string of binary quads and compress them to hexadecimal digits. More... | |
void | o2scl::RGBtoHSV (double r, double g, double b, double &h, double &s, double &v) |
Convert RGB to HSV color. More... | |
void | o2scl::HSVtoRGB (double h, double s, double v, double &r, double &g, double &b) |
Convert RGB to HSV color. More... | |
Quadratic extrema functions in src/base/misc.h | |
template<class data_t > | |
data_t | o2scl::quadratic_extremum_x (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3) |
Return the x value of the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_y_full (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, const data_t &xmin, const data_t &ymin, const data_t &a, const data_t &b, const data_t &c, const data_t &den) |
Return values related to a quadratic defined by three ![]() | |
template<class data_t > | |
data_t | o2scl::quadratic_extremum_y (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3) |
Return the y value of the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_xy (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &x, data_t &y) |
Return the (x,y) for the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_coeffs (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &a, data_t &b, data_t &c) |
Return the (x,y) for the extremum of a quadratic defined by three ![]() | |
Filesystem wrapper functions in src/base/misc.h | |
int | o2scl::glob_wrapper (std::string pattern, std::vector< std::string > &matches) |
Wrapper for the glob() function which finds files which match a pattern. More... | |
int | o2scl::wordexp_wrapper (std::string word, std::vector< std::string > &matches) |
Wrapper for the wordexp() function. | |
void | o2scl::wordexp_single_file (std::string &fname) |
Use wordexp() to obtain a single file. | |
New abs() function | |
float | o2scl::o2abs (const float x) |
Absolute value for single precision numbers. | |
double | o2scl::o2abs (const double x) |
Absolute value for double precision numbers. | |
long double | o2scl::o2abs (const long double x) |
Absolute value for long double. | |
boost::multiprecision::cpp_dec_float_50 | o2scl::o2abs (const boost::multiprecision::cpp_dec_float_50 x) |
Absolute value for cpp_dec_float_50. | |
bool | o2scl::o2isfinite (const double x) |
Compatbility function for isfinite() More... | |
bool | o2scl::o2isfinite (const boost::multiprecision::cpp_dec_float_50 x) |
Compatbility function for isfinite() | |
Functions from src/base/misc.h | |
double | o2scl::fermi_function (double E, double mu, double T, double limit=40.0) |
Calculate a Fermi-Dirac distribution function safely. More... | |
double | o2scl::bose_function (double E, double mu, double T, double limit=40.0) |
Calculate a Bose-Einstein distribution function safely. More... | |
int | o2scl::pipe_cmd_string (std::string cmd, std::string &result, bool err_on_fail=true, int nmax=80) |
Store the first line from the output of the shell command cmd up to nmax characters in result . More... | |
std::string | o2scl::pipe_cmd_string (std::string cmd, int nmax=80) |
Return the first line from the output of the shell command cmd up to nmax characters. More... | |
bool | o2scl::file_exists (std::string fname) |
Return true if file named fname exists. | |
template<class string_arr_t > | |
void | o2scl::screenify (size_t nin, const string_arr_t &in_cols, std::vector< std::string > &out_cols, size_t max_size=80) |
Reformat the columns for output of width size . More... | |
size_t | o2scl::count_words (std::string str) |
Count the number of words in the string str . More... | |
void | o2scl::remove_whitespace (std::string &s) |
Remove all whitespace from the string s . More... | |
std::string | o2scl::binary_to_hex (std::string s) |
Take a string of binary quads and compress them to hexadecimal digits. More... | |
void | o2scl::RGBtoHSV (double r, double g, double b, double &h, double &s, double &v) |
Convert RGB to HSV color. More... | |
void | o2scl::HSVtoRGB (double h, double s, double v, double &r, double &g, double &b) |
Convert RGB to HSV color. More... | |
Quadratic extrema functions in src/base/misc.h | |
template<class data_t > | |
data_t | o2scl::quadratic_extremum_x (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3) |
Return the x value of the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_y_full (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, const data_t &xmin, const data_t &ymin, const data_t &a, const data_t &b, const data_t &c, const data_t &den) |
Return values related to a quadratic defined by three ![]() | |
template<class data_t > | |
data_t | o2scl::quadratic_extremum_y (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3) |
Return the y value of the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_xy (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &x, data_t &y) |
Return the (x,y) for the extremum of a quadratic defined by three ![]() | |
template<class data_t > | |
void | o2scl::quadratic_extremum_coeffs (const data_t x1, const data_t x2, const data_t x3, const data_t y1, const data_t y2, const data_t y3, data_t &a, data_t &b, data_t &c) |
Return the (x,y) for the extremum of a quadratic defined by three ![]() | |
Filesystem wrapper functions in src/base/misc.h | |
int | o2scl::glob_wrapper (std::string pattern, std::vector< std::string > &matches) |
Wrapper for the glob() function which finds files which match a pattern. More... | |
int | o2scl::wordexp_wrapper (std::string word, std::vector< std::string > &matches) |
Wrapper for the wordexp() function. | |
void | o2scl::wordexp_single_file (std::string &fname) |
Use wordexp() to obtain a single file. | |
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).