#include <clipper_util.h>
Public Member Functions | |
Util () | |
null constructor | |
Static Public Member Functions | |
static const ftype & | nan () |
fast Util::nan() value | |
static const float & | nanf () |
fast Util::nan() value | |
static const double & | nand () |
fast Util::nan() value | |
static void | set_null (ftype32 &f) |
set null floating value - a specific value of NaN used for missings | |
static void | set_null (ftype64 &f) |
set null floating value - a specific value of NaN used for missings | |
static bool | is_null (const ftype32 &f) |
fast test for null floating value - only works if set from Util::null() | |
static bool | is_null (const ftype64 &f) |
fast test for null floating value - only works if set from Util::null() | |
static bool | is_nan (const ftype32 f) |
fast Util::nan() test | |
static bool | is_nan (const ftype64 f) |
fast Util::nan() test | |
static bool | isnan (const ftype32 f) |
slow general NaN test for compatibility | |
static bool | isnan (const ftype64 f) |
slow general NaN test for compatibility | |
static ftype | sim (const ftype &x) |
Sim function: I1(X)/I0(X). | |
static ftype | invsim (const ftype &x) |
Inverse Sim function: I1(X)/I0(X). | |
static ftype | sim_integ (const ftype &x) |
Integral of Sim function: log(I0(X)). | |
static ftype | sim_deriv (const ftype &x) |
Derivative of Sim function: d/dx( I1(X)/I0(x) ). | |
static ftype | sim_deriv_recur (const ftype &x) |
Derivative of Sim function using recurrance: -sim(x)/x + (1 - sim(x)^2). | |
static ftype | atanh (const ftype &x) |
Arc hyperbolic tangent. | |
static ftype | bessel_i0 (const ftype &x) |
Modified Bessel function of the first kind. | |
static ftype | u2b (const ftype &x) |
Convert isotropic U-value to B-factor. | |
static ftype | b2u (const ftype &x) |
Convert isotropic B-factor to U-value. | |
template<class T > | |
static T | mean (const T &pl, const T &mi) |
Convert F+/F- to mean F, with NaN checks. | |
template<class T > | |
static T | sig_mean (const T &pl, const T &mi, const T &cov) |
Convert sigF+/sigF-/cov to sig F, with NaN checks. | |
static int | intf (const ftype &a) |
Truncate-to-integer: int(floor(a)). | |
static int | intc (const ftype &a) |
Truncate-to-integer above: int(ceil(a)). | |
static int | intr (const ftype &a) |
Round-to-integer: int(round(a)). | |
static ftype | mod (const ftype &a, const ftype &b) |
Corrected mod. | |
static int | mod (const int &a, const int &b) |
Corrected mod. | |
template<class T > | |
static T | max (const T &a, const T &b) |
max | |
template<class T > | |
static T | min (const T &a, const T &b) |
min | |
template<class T > | |
static T | bound (const T &min, const T &val, const T &max) |
bound a value by limits | |
template<class T > | |
static void | swap (T &a, T &b) |
swap the contents of two objects | |
template<class T > | |
static void | swap (T &a, T &b, T &c) |
swap the contents of two objects, using third as store (for speed) | |
template<class T > | |
static T | sqr (const T &a) |
square | |
template<class T > | |
static T | isqrt (const T &n) |
Integer square root (returns floor of sqrt). | |
static const ftype & | pi () |
pi | |
static const ftype & | twopi () |
2 pi | |
static const ftype & | twopi2 () |
2 pi squared | |
static const ftype & | eightpi2 () |
8 pi squared | |
static ftype | d2rad (const ftype &x) |
degree-to-radian conversion | |
static ftype | rad2d (const ftype &x) |
degree-to-radian conversion |
This class holds a set of useful static functions and values. You should never need to instantiate this class: Refer to members using Util::
static bool clipper::Util::is_nan | ( | const ftype32 | f | ) | [inline, static] |
fast Util::nan() test
Used for missing entries: THIS DOES NOT DISTINGUISH BETWEEN NAN & INF
static bool clipper::Util::is_nan | ( | const ftype64 | f | ) | [inline, static] |
fast Util::nan() test
Used for missing entries: THIS DOES NOT DISTINGUISH BETWEEN NAN & INF
static bool clipper::Util::isnan | ( | const ftype32 | f | ) | [inline, static] |
slow general NaN test for compatibility
Works for all architectures with IEEE arithmetic only
static bool clipper::Util::isnan | ( | const ftype64 | f | ) | [inline, static] |
slow general NaN test for compatibility
Works for all architectures with IEEE arithmetic only
Sim function: I1(X)/I0(X).
x | The argument |
Inverse Sim function: I1(X)/I0(X).
x | I1(y)/I0(y) |
degree-to-radian conversion
x | Angle in degrees |
degree-to-radian conversion
x | Angle in radians |