Clipper
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
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_base clipper::FFTmap

Public Member Functions

 FFTmap_p1 ()
 Null constructor. More...
 
 FFTmap_p1 (const FFTmap_p1 &other)
 Copy constructor.
 
 FFTmap_p1 (const Grid_sampling &grid_sam, const FFTtype type=Default)
 Constructor: takes grid. More...
 
const FFTmap_p1operator= (const FFTmap_p1 &other)
 Assignment operator.
 
void init (const Grid_sampling &grid_sam, const FFTtype type=Default)
 initialiser: takes grid More...
 
void reset ()
 Reset. More...
 
const Grid_samplinggrid_real () const
 Return real space grid. More...
 
const Gridgrid_reci () const
 Return reciprocal space grid (i.e. half real grid + 1 section). More...
 
bool uniq_reci (const Coord_grid &c) const
 Test whether a coordinate is in the valid part of the recip. grid. More...
 
void fft_h_to_x (const ftype &scale)
 Transform to real space. More...
 
void fft_x_to_h (const ftype &scale)
 Transform to reciprocal space. More...
 
std::complex< ffttype > get_hkl (const HKL &hkl) const
 get reciprocal space data: slow form with hemisphere check More...
 
void set_hkl (const HKL &hkl, const std::complex< ffttype > &f)
 set reciprocal space data: slow form with hemisphere check More...
 
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
 
- Static Protected Attributes inherited from clipper::FFTmap_base
static Mutex mutex = Mutex()
 Thread safety.
 

Additional Inherited Members

- Public Types inherited from clipper::FFTmap_base
enum  FFTtype { Default, Measure, Estimate }
 

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_samThe grid sampling of the unit cell.
typeCan 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_samThe grid sampling of the unit cell.
typeCan 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.

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
cThe 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
Scalefactor 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
Scalefactor 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
hklThe 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
hklThe HKL of the data.

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