Clipper
Public Member Functions
clipper::Xmap< T > Class Template Reference

Xmap<T>: actual crystallographic map class. More...

#include <xmap.h>

Inheritance diagram for clipper::Xmap< T >:
clipper::Xmap_base clipper::CXmap< T >

List of all members.

Public Member Functions

 Xmap ()
 Null constructor, for later initialisation.
 Xmap (const Spacegroup &spacegroup, const Cell &cell, const Grid_sampling &grid_sam)
 constructor: from spacegroup, cell, and grid
void init (const Spacegroup &spacegroup, const Cell &cell, const Grid_sampling &grid_sam)
 initialiser: from spacegroup, cell, and grid
const T & operator[] (const Xmap_base::Map_reference_index &ix) const
 get data by Map_reference_index
T & operator[] (const Xmap_base::Map_reference_index &ix)
 set data by Map_reference_index
const T & operator[] (const Xmap_base::Map_reference_coord &ix) const
 get data by Map_reference_coord
T & operator[] (const Xmap_base::Map_reference_coord &ix)
 set data by Map_reference_coord
const T & get_data (const Coord_grid &pos) const
 get a density value for an arbitrary position
void set_data (const Coord_grid &pos, const T &val)
 set a density value for an arbitrary position
const T & get_data (const int &index) const
 get data by index (not recommended)
bool set_data (const int &index, const T &val)
 set data by index (not recommended)
template<class I >
interp (const Coord_frac &pos) const
 get map value for fractional coord using supplied interpolator
template<class I >
void interp_grad (const Coord_frac &pos, T &val, Grad_frac< T > &grad) const
 get map value and grad for fractional coord using supplied interpolator
template<class I >
void interp_curv (const Coord_frac &pos, T &val, Grad_frac< T > &grad, Curv_frac< T > &curv) const
 get map value and curv for fractional coord using supplied interpolator
template<class I >
interp (const Coord_map &pos) const
 get map value for map coord using supplied interpolator
template<class I >
void interp_grad (const Coord_map &pos, T &val, Grad_map< T > &grad) const
 get map value and grad for map coord using supplied interpolator
template<class I >
void interp_curv (const Coord_map &pos, T &val, Grad_map< T > &grad, Curv_map< T > &curv) const
 get map value and curv for map coord using supplied interpolator
template<class H >
void fft_from (const H &fphidata, const FFTtype type=Default)
 FFT from reflection list to map.
template<class H >
void fft_to (H &fphidata, const FFTtype type=Default) const
 FFT from map to reflection list.
const Cellcell () const
 get the cell
const Spacegroupspacegroup () const
 get the spacegroup
const Grid_samplinggrid_sampling () const
 get the cell grid
const Grid_rangegrid_asu () const
 get the ASU grid
Coord_grid coord_of (const int &index) const
 map coordinate from index
int index_of (const Coord_grid &coord) const
 map index from coordinate
const int multiplicity (const Coord_grid &pos) const
 get multiplicity of a map grid point
const Coord_grid to_map_unit (const Coord_grid &pos) const
 function to pick right cell repeat for any grid coord
const Map_reference_index first () const
 return a Map_reference_index for this map
const Map_reference_coord first_coord () const
 return a Map_reference_coord for this map
const T & operator= (const T &value)
 assignment operator: assigns a single value to the whole map
const Xmap< T > & operator+= (const Xmap< T > &other)
 add another map to this one
const Xmap< T > & operator-= (const Xmap< T > &other)
 subtract another map from this one

Detailed Description

template<class T>
class clipper::Xmap< T >

Xmap<T>: actual crystallographic map class.

The crystallographic map class stores a map of arbitrary data type. Its main difference from a 3-d array is that the data extent appears to be infinite, and yet internally only a unique ASU is stored. Iterators provide efficient access to data.

This is derived from Xmap_base, and adds the templatised data itself and the methods which deal with it.

Note:
The following methods are inherited from Xmap_base but are documented here for convenience: cell(), spacegroup(), grid_sampling(), grid_asu(), in_asu(), multiplicity(), to_map_unit(), first(), first_coord().

Member Function Documentation

template<class T >
const T & clipper::Xmap< T >::get_data ( const Coord_grid pos) const

get a density value for an arbitrary position

Accessing the data by coordinate, rather than by Map_reference_index or Map_reference_coord, involves a symmetry lookup and is therefore slow. Avoid using these methods when you can.

template<class T >
void clipper::Xmap< T >::set_data ( const Coord_grid pos,
const T &  val 
)

set a density value for an arbitrary position

Accessing the data by coordinate, rather than by Map_reference_index or Map_reference_coord, involves a symmetry lookup and is therefore slow. Avoid using these methods when you can.

template<class T >
const T & clipper::Xmap< T >::get_data ( const int &  index) const [inline]

get data by index (not recommended)

Accessing the data by index, rather than by Map_reference_index or Map_reference_coord, is generally to be avoided since the indices do not start at zero and do not increase contiguously. These methods are only useful when a large number of references into a map must be stored, e.g. for sorting into density order.

template<class T >
bool clipper::Xmap< T >::set_data ( const int &  index,
const T &  val 
)

set data by index (not recommended)

Accessing the data by index, rather than by Map_reference_index or Map_reference_coord, is generally to be avoided since the indices do not start at zero and do not increase contiguously. These methods are only useful when a large number of references into a map must be stored, e.g. for sorting into density order.

Returns:
true if data was set, i.e. index is valid.
template<class T >
template<class I >
T clipper::Xmap< T >::interp ( const Coord_frac pos) const

get map value for fractional coord using supplied interpolator

The value of the map at the desired non-grid fractional coordinate are calculated using the supplied interpolator template.

    Coord_frac f( u, v, w );
    y = xmap.interp<Interp_cubic>( f );
Parameters:
posThe fractional coord at which the density is to be calcuated.
Returns:
The value of the density at that point.

References clipper::Coord_frac::coord_map().

template<class T >
template<class I >
void clipper::Xmap< T >::interp_grad ( const Coord_frac pos,
T &  val,
Grad_frac< T > &  grad 
) const

get map value and grad for fractional coord using supplied interpolator

The value of the map at the desired non-grid fractional coordinate and its gradient are calculated using the supplied interpolator template.

Parameters:
posThe fractional coord at which the density is to be calcuated.
valThe value of the density at that point.
gradThe interpolated gradient vector with respect to the fractional coordinates (see Cell::coord_orth).

References clipper::Coord_frac::coord_map(), and clipper::Grad_map< T >::grad_frac().

template<class T >
template<class I >
void clipper::Xmap< T >::interp_curv ( const Coord_frac pos,
T &  val,
Grad_frac< T > &  grad,
Curv_frac< T > &  curv 
) const

get map value and curv for fractional coord using supplied interpolator

The value of the map at the desired non-grid fractional coordinate and its gradient and curvature are calculated using the supplied interpolator template. e.g.

Parameters:
posThe fractional coord at which the density is to be calcuated.
valThe value of the density at that point.
gradThe interpolated gradient vector with respect to the fractional coordinates (see Cell::coord_orth).
curvThe interpolated curvature matrix with respect to the fractional coordinates (see Cell::coord_orth).

References clipper::Coord_frac::coord_map(), and clipper::Curv_map< T >::curv_frac().

template<class T >
template<class I >
T clipper::Xmap< T >::interp ( const Coord_map pos) const

get map value for map coord using supplied interpolator

The value of the map at the desired non-grid map coordinate are calculated using the supplied interpolator template.

    Coord_map m( u, v, w );
    y = xmap.interp<Interp_cubic>( m );
Parameters:
posThe map coord at which the density is to be calcuated.
Returns:
The value of the density at that point.
template<class T >
template<class I >
void clipper::Xmap< T >::interp_grad ( const Coord_map pos,
T &  val,
Grad_map< T > &  grad 
) const

get map value and grad for map coord using supplied interpolator

The value of the map at the desired non-grid map coordinate and its gradient are calculated using the supplied interpolator template.

Parameters:
posThe map coord at which the density is to be calcuated.
valThe value of the density at that point.
gradThe interpolated gradient vector with respect to the map coordinates (see Cell::coord_orth).
template<class T >
template<class I >
void clipper::Xmap< T >::interp_curv ( const Coord_map pos,
T &  val,
Grad_map< T > &  grad,
Curv_map< T > &  curv 
) const

get map value and curv for map coord using supplied interpolator

The value of the map at the desired non-grid map coordinate and its gradient and curvature are calculated using the supplied interpolator template. e.g.

Parameters:
posThe map coord at which the density is to be calcuated.
valThe value of the density at that point.
gradThe interpolated gradient vector with respect to the map coordinates (see Cell::coord_orth).
curvThe interpolated curvature matrix with respect to the map coordinates (see Cell::coord_orth).
template<class T >
template<class H >
void clipper::Xmap< T >::fft_from ( const H &  fphidata,
const FFTtype  type = Default 
)
template<class T >
template<class H >
void clipper::Xmap< T >::fft_to ( H &  fphidata,
const FFTtype  type = Default 
) const

FFT from map to reflection list.

The Fourier transform of this map is calculated and used to fill a reflection list of F_phi. The map is unchanged.

Arguably this should be part of hkl_data<F_phi<T>>. But that requires writing a specialisation of hkl_data for F_phi. This is simpler and imposes less demands on the compiler.

Parameters:
fphidataThe reflection data list to set.

References clipper::FFTmap_p1::fft_x_to_h(), clipper::FFTmap_sparse_p1_xh::fft_x_to_h(), clipper::FFTmap_p1::get_hkl(), clipper::FFTmap_sparse_p1_xh::get_hkl(), clipper::Xmap_base::Map_reference_index::last(), clipper::FFTmap_p1::real_data(), clipper::FFTmap_sparse_p1_xh::real_data(), and clipper::FFTmap_sparse_p1_xh::require_hkl().

Referenced by clipper::Test_core::operator()().

template<class T>
Coord_grid clipper::Xmap< T >::coord_of ( const int &  index) const [inline]

map coordinate from index

Parameters:
indexThe index.
Returns:
The corresponding grid coordinate.

Reimplemented from clipper::Xmap_base.

template<class T>
int clipper::Xmap< T >::index_of ( const Coord_grid coord) const [inline]

map index from coordinate

This does not check symmetry equivalents.

Parameters:
coordThe coordinate.
Returns:
The index, or -1 if it does not exist.

Reimplemented from clipper::Xmap_base.

template<class T>
const int clipper::Xmap< T >::multiplicity ( const Coord_grid pos) const

get multiplicity of a map grid point

The multiplicity is the number of times the spacegroup operators map a particular grid point onto itself. This is required in order to properly weight map statistics so as to get the same result from just an ASU as using the whole cell.

Parameters:
posThe coordinate of the grid point.
Returns:
The multiplicty of the point.

Reimplemented from clipper::Xmap_base.

template<class T >
const T & clipper::Xmap< T >::operator= ( const T &  value)

assignment operator: assigns a single value to the whole map

All values, including missing values, are overwritten by the value.

Parameters:
valueThe value to which the map is to be set.

References clipper::Xmap_base::Map_reference_index::last().

template<class T >
const Xmap< T > & clipper::Xmap< T >::operator+= ( const Xmap< T > &  other)
template<class T >
const Xmap< T > & clipper::Xmap< T >::operator-= ( const Xmap< T > &  other)

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