clipper::FFTmap_p1 Class Reference

FFTmap_p1: low level P1 map used for calculating FFTs. More...

#include <fftmap.h>

Inheritance diagram for clipper::FFTmap_p1:

clipper::FFTmap

List of all members.

Public Member Functions

 FFTmap_p1 ()
 Null constructor.
 FFTmap_p1 (const FFTmap_p1 &other)
 Copy constructor.
 FFTmap_p1 (const Grid_sampling &grid_sam, const FFTtype type=Default)
 Constructor: takes grid.
const FFTmap_p1operator= (const FFTmap_p1 &other)
 Assignment operator.
void init (const Grid_sampling &grid_sam, const FFTtype type=Default)
 initialiser: takes grid
void reset ()
 Reset.
const Grid_samplinggrid_real () const
 Return real space grid.
const Gridgrid_reci () const
 Return reciprocal space grid (i.e. half real grid + 1 section).
bool uniq_reci (const Coord_grid &c) const
 Test whether a coordinate is in the valid part of the recip. grid.
void fft_h_to_x (const ftype &scale)
 Transform to real space.
void fft_x_to_h (const ftype &scale)
 Transform to reciprocal space.
std::complex< ffttype > get_hkl (const HKL &hkl) const
 get reciprocal space data: slow form with hemisphere check
void set_hkl (const HKL &hkl, const std::complex< ffttype > &f)
 set reciprocal space data: slow form with hemisphere check
const std::complex< ffttype > & cplx_data (const Coord_grid &c) const
 get reciprocal space data
std::complex< ffttype > & cplx_data (const Coord_grid &c)
 set reciprocal space data
const ffttype & real_data (const Coord_grid &c) const
 get real space data
ffttype & real_data (const Coord_grid &c)
 set real space data
void debug () const

Static Public Member Functions

static FFTtype & default_type ()
 set/get default optimisation type

Protected Types

enum  FFTmode { NONE, RECI, REAL, OTHER }

Protected Member Functions

const FFTmap_p1copy (const FFTmap_p1 &other)
 copy function

Protected Attributes

FFTmode mode
 real or reciprocal space?
FFTtype type_
 optimisation options
Grid_sampling grid_sam_
 unit cell grid
Grid grid_reci_
 reciprocal space grid
Grid grid_real_
 real space grid
Grid grid_half_
 half grid (for marking unique)
Matrix< char > req_kl
Matrix< char > req_uv
 reci section lookup
std::vector< char > req_l
std::vector< char > req_u
 real section lookup
std::vector< ffttype > datavec
 vector for the data
ffttype * data_r
 pointer to real data
std::complex< ffttype > * data_c
 pointer to complex data

Static Protected Attributes

static FFTtype default_type_ = FFTmap_base::Estimate
 default optimisation options


Detailed Description

FFTmap_p1: low level P1 map used for calculating FFTs.

This is a pure real P1 map, with an extra section in reciprocal space to allow generation of the full set of resiprocal space magnitudes. Access is by Coord_grid in both spaces, and indices must be non-negative and in range. The first and last sections along the half-length direction only have half the elements stored, the contents of the other half is ignored.


Constructor & Destructor Documentation

clipper::FFTmap_p1::FFTmap_p1 (  ) 

Null constructor.

For later initialisation: see init()

clipper::FFTmap_p1::FFTmap_p1 ( const Grid_sampling grid_sam,
const FFTtype  type = Default 
)

Constructor: takes grid.

Construct an FFTmap_p1 for a given spacegroup, cell, and grid. The map values are initialised to zero.

The FFTmap_p1 is initially in neither real nor reciprocal spce, however as soon as one of the 'set' methods is called, it will be defined as in either real or reciprocal space until the next fft.

Parameters:
grid_sam The grid sampling of the unit cell.
type Can be FFTmap_p1::Measure, FFTmap_p1::Estimate. Measure performs slow precalculation (first time only) to get faster FFT.


Member Function Documentation

void clipper::FFTmap_p1::init ( const Grid_sampling grid_sam,
const FFTtype  type = Default 
)

initialiser: takes grid

Initialise an FFTmap_p1 for a given spacegroup, cell, and grid. The map values are initialised to zero.

The FFTmap_p1 is initially in neither real nor reciprocal spce, however as soon as one of the 'set' methods is called, it will be defined as in either real or reciprocal space until the next fft.

Parameters:
grid_sam The grid sampling of the unit cell.
type Can be FFTmap_p1::Measure, FFTmap_p1::Estimate. Measure performs slow precalculation (first time only) to get faster FFT.

void clipper::FFTmap_p1::reset (  ) 

Reset.

Reset the space and zero all the data, if necessary.

Reimplemented in clipper::FFTmap.

const Grid_sampling & clipper::FFTmap_p1::grid_real (  )  const [inline]

Return real space grid.

Returns:
The grid sampling of the real space grid.

const Grid & clipper::FFTmap_p1::grid_reci (  )  const [inline]

Return reciprocal space grid (i.e. half real grid + 1 section).

The reciprocal grid is half-length, plus one section, in the w direction. The remainder of the grid may be generated by Hermitian symmetry. When accessing data with reci_data, the coordinate should always be in this grid. Some points in this grid are redundent, see FFTmap_p1::uniq_reci().

Returns:
The reciprocal grid.

bool clipper::FFTmap_p1::uniq_reci ( const Coord_grid c  )  const [inline]

Test whether a coordinate is in the valid part of the recip. grid.

The w=0 and w=nw/2 sections contain some duplicated points related by a cetre of symmetry. On of these is considered to be significant, and the other redundent. This function returns 'true' for the significant point.

Note:
For some calculations it may be quicker to set the whole grid than call this function for every coordinate.
Parameters:
c The coordinate to test. Must be in grid_reci().
Returns:
true if the coordinate is for a significant point.

void clipper::FFTmap_p1::fft_h_to_x ( const ftype scale  ) 

Transform to real space.

The data is transformed from recirocal to real space. If the FFTmap_p1 is already in real space, no action is taken.

Parameters:
Scale factor to apply (normally 1/cell_volume).

void clipper::FFTmap_p1::fft_x_to_h ( const ftype scale  ) 

Transform to reciprocal space.

The data is transformed from real to recirocal space. If the FFTmap_p1 is already in reciproal space, no action is taken.

Parameters:
Scale factor to apply (in addition to 1/N_grid factor) (normally cell_volume).

std::complex< ffttype > clipper::FFTmap_p1::get_hkl ( const HKL hkl  )  const

get reciprocal space data: slow form with hemisphere check

This form returns the data for an HKL. The HKL is converted into a grid reference, and the data, or if necessary the conjugate of the opposite, is returned.

Parameters:
hkl The HKL of the data.

void clipper::FFTmap_p1::set_hkl ( const HKL hkl,
const std::complex< ffttype > &  f 
)

set reciprocal space data: slow form with hemisphere check

This form returns the data for an HKL. The HKL is converted into a grid reference, and the data, and if necessary the conjugate of the opposite, is set.

Parameters:
hkl The HKL of the data.


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

Generated on Fri Jun 12 18:03:40 2009 for Clipper by  doxygen 1.5.9