|
Manticore
Version 1.5.3
Physics of Molecular Clouds
|
MathUtils package. More...
Classes | |
| class | CommandLine |
| Command line options and arguments. More... | |
| class | Exception |
| MathUtils exception (base) class. More... | |
| struct | integ_data_t |
| struct | Log |
| Logging facility. More... | |
Functions | |
| const char * | Cform (const std::string &s) |
| Converts input to well-defined type for stdio. More... | |
| template<typename T > | |
| T * | Cform (T *p) |
| Converts input to well-defined type for stdio. More... | |
| double | Cform (double i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned long long i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned long i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (long long i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (long i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (int i) |
| Converts input to well-defined type for stdio. More... | |
| int | Cform (unsigned char i) |
| Converts input to well-defined type for stdio. More... | |
| int | Cform (char i) |
| Converts input to well-defined type for stdio. More... | |
| int | cxxfclose (FILE *fp) |
| Standardized fclose(). More... | |
| FILE * | cxxfopen (const std::string &file, const char *mode) |
| Standardized fopen(). More... | |
| template<typename... Args> | |
| int | cxxfprintf (FILE *f, Args &&... args) |
| C fprintf() with type conversion (not safety). More... | |
| template<typename... Args> | |
| int | cxxprintf (Args &&... args) |
| C printf() with type conversion (not safety). More... | |
| template<typename... Args> | |
| int | cxxsnprintf (char *buf, size_t len, Args &&... args) |
| C snprintf() with type conversion (not safety). More... | |
| void | exitException (std::exception &ex, int status=EXIT_FAILURE) |
| Exits program with exception message. Exits the program (with status) after displaying the exception ex. More... | |
| static double | hifn (double x) |
| static double | hifn_r (double x, void *vdata) |
| double | kgauss (double(*f)(double x), double a, double b, double err) |
| double | kgauss2 (double(*f)(double x), double a, double b, double err) |
| double | kgauss2_r (double(*f_r)(double x, void *), void *fdata, double a, double b, double err) |
| double | kgauss_r (double(*f_r)(double x, void *), void *fdata, double a, double b, double err) |
| double | kgauss_sub (double(*f)(double), double(*f_r)(double, void *), void *fdata, double a, double b, double c, double *err, int sqroot, int lev, double I0, int maxrecur, int paranoid) |
| double | kgauss_sub (double(*f)(double x), double(*f_r)(double x, void *), void *fdata, double a, double b, double c, double *acc, int root, int lev, double I0, int maxrecur, int paranoid) |
| double | ksqrtgauss (double(*f)(double), double a, double b, double c, double err) |
| double | ksqrtgauss (double(*f)(double x), double a, double b, double c, double err) |
| double | ksqrtgauss_r (double(*f_r)(double, void *), void *fdata, double a, double b, double c, double err) |
| double | ksqrtgauss_r (double(*f_r)(double x, void *), void *fdata, double a, double b, double c, double err) |
| static double | lofn (double x) |
| static double | lofn_r (double x, void *vdata) |
| void | printException (std::exception &ex) |
| Prints exception message. More... | |
| template<typename R > | |
| R | sqr (R x) |
Variables | |
| static double | c_gl |
| static double(* | func_gl )(double x) |
| std::string::size_type | npos = std::string::npos |
| const std::string | nullStr (1, 0) |
| const std::string | siPrefixes ("YZEPTGMkhDdcmunpfazy") |
| const std::map< char, const char * > | siScaleMap |
MathUtils package.
|
inline |
Converts input to well-defined type for stdio.
Definition at line 222 of file Log.h.
References std::string::c_str().
Referenced by cxxfprintf(), cxxprintf(), and cxxsnprintf().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Standardized fclose().
Equivalent to <cstdio> fclose(), except that the call is ignored if fp is stdin, stdout or stderr.
| [in] | fp | File stream pointer. |
Definition at line 325 of file Log.h.
Referenced by mutils::Log::setStream().
|
inline |
Standardized fopen().
Equivalent to <cstdio> fopen(), except:
"-" and "!" are interpreted as stdin/stdout and stderr, respectively.| [in] | file | File name. |
| [in] | mode | File mode. |
Definition at line 311 of file Log.h.
References std::string::c_str().
Referenced by mutils::Log::setStream().
|
inline |
C fprintf() with type conversion (not safety).
| [in] | f | Open output file stream. |
| [in] | args | Input arguments (beginning with format string). |
Definition at line 284 of file Log.h.
References Cform().
Referenced by mutils::Log::message().
|
inline |
C printf() with type conversion (not safety).
Wraps each argument in a Cform() call and passes them to printf(). This converts all signed integers to type long and all unsigned integers to type unsigned long, so that the format conversion applied to them must be %ld or %lu, respectively. Characters are converted to type int and hence should use either %c or %d. Both C-strings and C++ std::string can be given as arguments using the %s conversion. All the usual format qualifiers may also be used.
| [in] | args | Input arguments (beginning with format string). |
Definition at line 273 of file Log.h.
References Cform().
|
inline |
C snprintf() with type conversion (not safety).
| [in] | buf | Output buffer. |
| [in] | len | Buffer length. |
| [in] | args | Input arguments (beginning with format string). |
Definition at line 297 of file Log.h.
References Cform().
|
inline |
Exits program with exception message. Exits the program (with status) after displaying the exception ex.
| [in] | ex | Input exception. |
| [in] | status | Exit status. |
Definition at line 208 of file Exception.h.
References mutils::Log::file, and printException().
|
static |
|
static |
Definition at line 48 of file kgauss.cc.
Referenced by kgauss_sub().
| double mutils::kgauss | ( | double(*)(double x) | f, |
| double | a, | ||
| double | b, | ||
| double | err | ||
| ) |
Definition at line 382 of file kgauss.cc.
References kgauss_sub().
| double mutils::kgauss2 | ( | double(*)(double x) | f, |
| double | a, | ||
| double | b, | ||
| double | err | ||
| ) |
Definition at line 387 of file kgauss.cc.
References kgauss_sub().
| double mutils::kgauss2_r | ( | double(*)(double x, void *) | f_r, |
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | err | ||
| ) |
Definition at line 416 of file kgauss.cc.
References kgauss_sub().
| double mutils::kgauss_r | ( | double(*)(double x, void *) | f_r, |
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | err | ||
| ) |
Definition at line 410 of file kgauss.cc.
References kgauss_sub().
Referenced by manticore::Detector::calcWidth(), manticore::Graybody::Itot(), and manticore::Graybody::Itot2().
| double mutils::kgauss_sub | ( | double(*)(double) | f, |
| double(*)(double, void *) | f_r, | ||
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double * | err, | ||
| int | sqroot, | ||
| int | lev, | ||
| double | I0, | ||
| int | maxrecur, | ||
| int | paranoid | ||
| ) |
| double mutils::kgauss_sub | ( | double(*)(double x) | f, |
| double(*)(double x, void *) | f_r, | ||
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double * | acc, | ||
| int | root, | ||
| int | lev, | ||
| double | I0, | ||
| int | maxrecur, | ||
| int | paranoid | ||
| ) |
Definition at line 65 of file kgauss.cc.
References hifn(), hifn_r(), lofn(), lofn_r(), std::max(), MAXIT, and sqr().
Referenced by kgauss(), kgauss2(), kgauss2_r(), kgauss_r(), ksqrtgauss(), and ksqrtgauss_r().
| double mutils::ksqrtgauss | ( | double(*)(double) | f, |
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | err | ||
| ) |
| double mutils::ksqrtgauss | ( | double(*)(double x) | f, |
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | err | ||
| ) |
Definition at line 392 of file kgauss.cc.
References c_gl, func_gl, and kgauss_sub().
| double mutils::ksqrtgauss_r | ( | double(*)(double, void *) | f_r, |
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | err | ||
| ) |
| double mutils::ksqrtgauss_r | ( | double(*)(double x, void *) | f_r, |
| void * | fdata, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | err | ||
| ) |
Definition at line 422 of file kgauss.cc.
References kgauss_sub().
|
static |
|
static |
Definition at line 56 of file kgauss.cc.
Referenced by kgauss_sub().
|
inline |
Prints exception message.
If ex is an mutils::Exception, calls mutils::Exception::print(); otherwise, prints ex.what() (to stderr).
| [in] | ex | Input exception. |
Definition at line 194 of file Exception.h.
References std::exception::what().
Referenced by exitException().
| R mutils::sqr | ( | R | x | ) |
Computes square of a number.
| R | Floating-point type. |
| [in] | x | Argument. |
Definition at line 24 of file kgauss.cc.
Referenced by kgauss_sub().
|
static |
Definition at line 29 of file kgauss.cc.
Referenced by hifn(), ksqrtgauss(), and lofn().
|
static |
Definition at line 29 of file kgauss.cc.
Referenced by hifn(), ksqrtgauss(), and lofn().
| std::string::size_type mutils::npos = std::string::npos |
Definition at line 24 of file statics.cc.
Referenced by mutils::CommandLine::Option::keyword(), manticore::solve(), and mutils::CommandLine::usage().
| const std::string mutils::nullStr(1, 0) |
| const std::string mutils::siPrefixes("YZEPTGMkhDdcmunpfazy") |
| Prefix | Name | Value | Prefix | Name | Value | |
|---|---|---|---|---|---|---|
| Y | yotta | 1024 | y | yocto | 10-24 | |
| Z | zetta | 1021 | z | zepto | 10-21 | |
| E | exa | 1018 | a | atto | 10-18 | |
| P | peta | 1015 | f | femto | 10-15 | |
| T | tera | 1012 | p | pico | 10-12 | |
| G | giga | 109 | n | nano | 10-9 | |
| M | mega | 106 | u | micro | 10-6 | |
| k | kilo | 103 | m | milli | 10-3 | |
| h | hetco | 102 | c | centi | 10-2 | |
| D | deka | 101 | d | deci | 10-1 |
| const std::map<char, const char *> mutils::siScaleMap |
Definition at line 45 of file statics.cc.
1.8.15