Clipper
Classes | Public Types | Public Member Functions | Protected Member Functions
clipper::BasisFn_base Class Reference

abstract base class for resolution function basis functions More...

#include <resol_fn.h>

Inheritance diagram for clipper::BasisFn_base:
clipper::BasisFn_aniso_gaussian clipper::BasisFn_binner clipper::BasisFn_expcubic clipper::BasisFn_gaussian clipper::BasisFn_linear clipper::BasisFn_log_aniso_gaussian clipper::BasisFn_log_gaussian clipper::BasisFn_spline

List of all members.

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 > &params) const
 the value of the resolution function
virtual const Fderivfderiv (const HKL &hkl, const Cell &cell, const std::vector< ftype > &params) 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 non-zero diagonals in the upper triangle of the curvatures

Protected Member Functions

Fderivresult () const
 provide write access to result for subclasses
virtual ~BasisFn_base ()
 destructor

Detailed Description

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 N-diagonal 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.


Member Function Documentation

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.

Returns:
The function type enumeration.

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 non-zero 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 non-zero diagonals in the upper triangle of the matrix, i.e. 1 for a diagonal matrix, 2 for a tri-diagonal matrix etc.

Returns:
The number of non-zero upper diagonals, or zero for full-matrix.

Reimplemented in clipper::BasisFn_binner, clipper::BasisFn_linear, and clipper::BasisFn_spline.

Referenced by clipper::ResolutionFn::calc_derivs().


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