Clipper
Classes | Public Member Functions | Static Public Member Functions | List of all members
clipper::Util Class Reference

Utility class. More...

#include <clipper_util.h>

Public Member Functions

 Util ()
 null constructor
 

Static Public Member Functions

static const ftypenan ()
 fast Util::nan() value
 
static const float & nanf ()
 fast Util::nan() value
 
static const double & nand ()
 fast Util::nan() value
 
template<class T >
static void set_null (T &t)
 set null generic 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 ftypepi ()
 pi
 
static const ftypetwopi ()
 2 pi
 
static const ftypetwopi2 ()
 2 pi squared
 
static const ftypeeightpi2 ()
 8 pi squared
 
static ftype d2rad (const ftype &x)
 degree-to-radian conversion
 
static ftype rad2d (const ftype &x)
 degree-to-radian conversion
 

Detailed Description

Utility class.

This class holds a set of useful static functions and values. You should never need to instantiate this class: Refer to members using Util::

Member Function Documentation

◆ is_nan() [1/2]

static bool clipper::Util::is_nan ( const ftype32  f)
inlinestatic

fast Util::nan() test

Used for missing entries: THIS DOES NOT DISTINGUISH BETWEEN NAN & INF

◆ is_nan() [2/2]

static bool clipper::Util::is_nan ( const ftype64  f)
inlinestatic

fast Util::nan() test

Used for missing entries: THIS DOES NOT DISTINGUISH BETWEEN NAN & INF

◆ isnan() [1/2]

static bool clipper::Util::isnan ( const ftype32  f)
inlinestatic

slow general NaN test for compatibility

Works for all architectures with IEEE arithmetic only

◆ isnan() [2/2]

static bool clipper::Util::isnan ( const ftype64  f)
inlinestatic

slow general NaN test for compatibility

Works for all architectures with IEEE arithmetic only

◆ sim()

ftype clipper::Util::sim ( const ftype x)
static

Sim function: I1(X)/I0(X)

Parameters
xThe argument
Returns
I1(x)/I0(x)

◆ invsim()

ftype clipper::Util::invsim ( const ftype x)
static

Inverse Sim function: I1(X)/I0(X)

Parameters
xI1(y)/I0(y)
Returns
y

◆ d2rad()

ftype clipper::Util::d2rad ( const ftype x)
static

degree-to-radian conversion

Parameters
xAngle in degrees
Returns
Angle in radians

◆ rad2d()

ftype clipper::Util::rad2d ( const ftype x)
static

degree-to-radian conversion

Parameters
xAngle in radians
Returns
Angle in degrees

The documentation for this class was generated from the following files: