Clipper
Classes | Public Member Functions | Static Public Member Functions
clipper::Util Class Reference

Utility class. More...

#include <clipper_util.h>

List of all members.

Classes

union  U32
union  U64

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
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

static bool clipper::Util::is_nan ( const ftype32  f) [inline, static]
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

Referenced by clipper::Test_core::operator()().

static bool clipper::Util::isnan ( const ftype64  f) [inline, static]

slow general NaN test for compatibility

Works for all architectures with IEEE arithmetic only

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

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

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

Referenced by clipper::Test_core::operator()(), clipper::TargetFn_sigmaa< T >::rderiv(), clipper::TargetFn_sigmaa_omegaa< T >::rderiv(), and sim_deriv_recur().

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

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

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

Referenced by clipper::Test_core::operator()(), clipper::datatypes::Compute_abcd_from_phifom< dtype >::operator()(), and clipper::LogPhaseProb< N >::set_phi_fom().

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

degree-to-radian conversion

Parameters:
xAngle in degrees
Returns:
Angle in radians

Referenced by clipper::Cell_descr::Cell_descr().

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

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