Clipper

abstract base class for resolution function basis functions More...
#include <resol_fn.h>
Classes  
class  Fderiv 
object holding the basis function and its first two derivatives More...  
Public Types  
enum  FNtype { GENERAL, LINEAR } 
enumeration of function types: optionally used to improve convergence  
Public Member Functions  
BasisFn_base ()  
null constructor  
BasisFn_base (const int &np)  
constructor: takes number of parameters  
const int &  num_params () const 
the number of parameters of this basis function  
virtual ftype  f (const HKL &hkl, const Cell &cell, const std::vector< ftype > ¶ms) const 
the value of the resolution function  
virtual const Fderiv &  fderiv (const HKL &hkl, const Cell &cell, const std::vector< ftype > ¶ms) const =0 
the value of the resolution function and its first two derivatives  
virtual FNtype  type () const 
the type of the function: optionally used to improve convergence  
virtual int  num_diagonals () const 
number of nonzero diagonals in the upper triangle of the curvatures  
Protected Member Functions  
Fderiv &  result () const 
provide write access to result for subclasses  
virtual  ~BasisFn_base () 
destructor 
abstract base class for resolution function basis functions
A basis function must be able to return its value and derivatives for any given HKL.
Optionally, performance can be improved by returning a flag to indicate if the value of the basis function for a given reflection is linearly dependent on the values of the parameter, and a value indicating whether the curvature matrix takes an Ndiagonal form.
NOTE: for performance reasons the derivatives are returned as a reference to an internal object, so if you store a reference to the result (which is also good for performance, it will be overwritten on the next call. If this matters, store a copy rather than a reference.
BasisFn_base::FNtype clipper::BasisFn_base::type  (  )  const [virtual] 
the type of the function: optionally used to improve convergence
Defaults to GENERAL, which will always work. If the basis function is linearly dependent on the parameters, override this with a function returning LINEAR for improved performance. See the provided basis functions for examples.
Reimplemented in clipper::BasisFn_binner, clipper::BasisFn_linear, clipper::BasisFn_spline, clipper::BasisFn_log_gaussian, and clipper::BasisFn_log_aniso_gaussian.
Referenced by clipper::ResolutionFn::ResolutionFn().
int clipper::BasisFn_base::num_diagonals  (  )  const [virtual] 
number of nonzero diagonals in the upper triangle of the curvatures
Defaults to 0, which will always work. If the basis function has compact support among the parameters, i.e. the value for any HKL depends only on a few parameters, then set this to the number of nonzero diagonals in the upper triangle of the matrix, i.e. 1 for a diagonal matrix, 2 for a tridiagonal matrix etc.
Reimplemented in clipper::BasisFn_binner, clipper::BasisFn_linear, and clipper::BasisFn_spline.
Referenced by clipper::ResolutionFn::calc_derivs().