Clipper
|
Utility class. More...
#include <clipper_util.h>
Classes | |
union | U32 |
union | U64 |
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 |
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::
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
Referenced by clipper::datatypes::Phi_fom< dtype >::friedel(), clipper::datatypes::F_phi< dtype >::friedel(), clipper::AtomShapeFn::init(), clipper::Rotation::is_null(), clipper::Mat33sym<>::is_null(), clipper::Mat33< ftype >::is_null(), clipper::Vec3< ftype >::is_null(), clipper::Map_stats::Map_stats(), mean(), clipper::datatypes::D_sigD< dtype >::missing(), clipper::datatypes::ABCD< dtype >::missing(), clipper::datatypes::Phi_fom< dtype >::missing(), clipper::datatypes::F_phi< dtype >::missing(), clipper::datatypes::E_sigE_ano< dtype >::missing(), clipper::datatypes::E_sigE< dtype >::missing(), clipper::datatypes::F_sigF_ano< dtype >::missing(), clipper::datatypes::F_sigF< dtype >::missing(), clipper::datatypes::I_sigI_ano< dtype >::missing(), clipper::datatypes::I_sigI< dtype >::missing(), clipper::Test_core::operator()(), clipper::datatypes::Compute_diff_fsigf_from_fsigfano< dtype >::operator()(), clipper::datatypes::Compute_mean_fsigf_from_fsigfano< dtype >::operator()(), clipper::ResolutionFn_nonlinear::ResolutionFn_nonlinear(), clipper::datatypes::Phi_fom< dtype >::shift_phase(), clipper::datatypes::F_phi< dtype >::shift_phase(), and sig_mean().
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
Sim function: I1(X)/I0(X)
x | The argument |
Referenced by clipper::Test_core::operator()(), clipper::TargetFn_sigmaa< T >::rderiv(), clipper::TargetFn_sigmaa_omegaa< T >::rderiv(), and sim_deriv_recur().
Inverse Sim function: I1(X)/I0(X)
x | I1(y)/I0(y) |
Referenced by clipper::Test_core::operator()(), clipper::datatypes::Compute_abcd_from_phifom< dtype >::operator()(), and clipper::LogPhaseProb< N >::set_phi_fom().
degree-to-radian conversion
x | Angle in degrees |
Referenced by clipper::Cell_descr::Cell_descr().
degree-to-radian conversion
x | Angle in radians |
Referenced by clipper::Cell_descr::alpha_deg(), clipper::Cell_descr::beta_deg(), clipper::Polar_ccp4::format(), clipper::Euler_ccp4::format(), clipper::Euler< T >::format(), clipper::Cell_descr::gamma_deg(), and clipper::datatypes::Compute_phifom_from_abcd< dtype >::operator()().