Clipper
Public Member Functions | Protected Attributes
clipper::HKL_data< T > Class Template Reference

HKL_data<> More...

#include <hkl_data.h>

Inheritance diagram for clipper::HKL_data< T >:
clipper::HKL_data_base clipper::CHKL_data< T >

List of all members.

Public Member Functions

 HKL_data ()
 null constructor
 HKL_data (const HKL_info &hkl_info)
 constructor: from parent hkl_info
 HKL_data (const HKL_info &hkl_info, const Cell &cell)
 constructor: from parent hkl_info and cell
 HKL_data (const Spacegroup &spacegroup, const Cell &cell, const HKL_sampling &hkl_sampling)
 [CLIPPER2] constructor: from spacegroup, cell and hkl_sampling
 HKL_data (const HKL_data_base &hkl_data)
 [CLIPPER2] constructor: from another HKL_data object
void init (const HKL_info &hkl_info, const Cell &cell)
 initialiser: from parent hkl_info and cell
void init (const Spacegroup &spacegroup, const Cell &cell, const HKL_sampling &hkl_sampling)
 [CLIPPER2] initialiser: from spacegroup, cell, and HKL_sampling
void init (const HKL_data_base &hkl_data)
 [CLIPPER2] initialiser: from another HKL_data object
void update ()
 update: synchornize info with parent HKL_info
String type () const
 get data type (a list of names corresponding to the im/export values)
bool missing (const int &index) const
 check if a data entry in the list is marked as 'missing'
void set_null (const int &index)
 set data entry in the list to its null value
int data_size () const
 return number of data elements in this type
String data_names () const
 return names of data elements in this type
void data_export (const HKL &hkl, xtype array[]) const
 conversion to array (for I/O)
void data_import (const HKL &hkl, const xtype array[])
 conversion from array (for I/O)
void mask (const HKL_data_base &mask)
const T & operator[] (const HKL_info::HKL_reference_index &i) const
 get data by reflection HKL_reference_index
T & operator[] (const HKL_info::HKL_reference_index &i)
 set data by reflection HKL_reference_index
operator[] (const HKL_info::HKL_reference_coord &ih) const
 get data by HKL_reference_coord
bool get_data (const HKL_info::HKL_reference_coord &ih, T &data) const
 get data by HKL_reference_coord (returns false if no equivalent hkl)
bool set_data (const HKL_info::HKL_reference_coord &ih, const T &data)
 set data by HKL_reference_coord (returns false if no equivalent hkl)
const T & operator[] (const int &index) const
 get data by reflection index
T & operator[] (const int &index)
 set data by reflection index
operator[] (const HKL &hkl) const
 get data by hkl (returns missing if no equivalent hkl)
bool get_data (const HKL &hkl, T &data) const
 get data by hkl (returns false if no equivalent hkl)
bool set_data (const HKL &hkl, const T &data)
 set data by hkl (returns false if no equivalent hkl)
template<class C >
void compute (const C &op)
 Basic computation: fill this data list by function call.
template<class S , class C >
void compute (const HKL_data< S > &src, const C &op)
 Unary computation: fill this data list by computation from another.
template<class S1 , class S2 , class C >
void compute (const HKL_data< S1 > &src1, const HKL_data< S2 > &src2, const C &op)
 Binary computation: fill this data list by computation from another.
const HKL_infobase_hkl_info () const
 get the parent HKL_info object
const Cellbase_cell () const
 get the parent cell
const ftype invresolsq (const int &index) const
 get resolution by reflection index (based on true cell)
const Range< ftypeinvresolsq_range () const
 get resolution limits of the list (based on true cell and missing data)
const int num_obs () const
 get number of observations in this list (based on missing data)
HKL_reference_index first () const
 return HKL_reference_index pointing to first reflection
HKL_reference_index first_data () const
 return HKL_reference_index pointing to first non-missing data
HKL_reference_indexnext_data (HKL_reference_index &ih) const
 increment HKL_reference_index to next non-missing data
HKL_data< T > & operator= (const HKL_data< T > &other)
 assignment operator: copies the data from another list
HKL_data< T > & operator= (const T &value)
 assignment operator: assigns a single value to the whole list
void debug () const

Protected Attributes

std::vector< T > list

Detailed Description

template<class T>
class clipper::HKL_data< T >

HKL_data<>

An actual hkl_data object, containing actual data of type T. This implements the generic interface, and in addition provides type-specific access functions.

Note:
The following methods are inherited from HKL_data_base but are documented here for convenience: base_hkl_info(), base_cell(), invresolsq(), invresolsq_range(), num_obs(), first(), first_data(), next_data().

Constructor & Destructor Documentation

template<class T >
clipper::HKL_data< T >::HKL_data ( const HKL_info hkl_info) [explicit]

constructor: from parent hkl_info

Construct the object using a given reflection list and cell.

Parameters:
hkl_infoThe reflection list object.

References clipper::HKL_info::cell(), and clipper::HKL_info::init().

template<class T >
clipper::HKL_data< T >::HKL_data ( const HKL_info hkl_info,
const Cell cell 
)

constructor: from parent hkl_info and cell

Construct the object using a given reflection list and cell.

Parameters:
hkl_infoThe reflection list object.
cellThe unit cell for this datalist.

References clipper::HKL_info::init().

template<class T >
clipper::HKL_data< T >::HKL_data ( const Spacegroup spacegroup,
const Cell cell,
const HKL_sampling hkl_sampling 
)

[CLIPPER2] constructor: from spacegroup, cell and hkl_sampling

Construct the object using a given spacegroup, cell, and sampling.

Parameters:
spacegroupThe spacegroup for this datalist.
cellThe unit cell for this datalist.
hkl_samplingThe reflection list description.

References clipper::HKL_info::init().

template<class T >
clipper::HKL_data< T >::HKL_data ( const HKL_data_base hkl_data) [explicit]

[CLIPPER2] constructor: from another HKL_data object

Construct the object using a given HKL_data object. The properties of the object (spacegroup, cell, sampling) are the copied, but the actual data is not.

Parameters:
hkl_dataThe HKL_data object to provide the data.

References clipper::HKL_info::init().


Member Function Documentation

template<class T >
void clipper::HKL_data< T >::init ( const HKL_info hkl_info,
const Cell cell 
) [virtual]

initialiser: from parent hkl_info and cell

Initialise the object using a given reflection list and cell.

Parameters:
hkl_infoThe reflection list object.
cellThe unit cell for this datalist.

Reimplemented from clipper::HKL_data_base.

Reimplemented in clipper::CHKL_data< T >.

References clipper::HKL_info::init().

Referenced by clipper::data::Test_data::Test_data().

template<class T >
void clipper::HKL_data< T >::init ( const Spacegroup spacegroup,
const Cell cell,
const HKL_sampling hkl_sampling 
) [virtual]

[CLIPPER2] initialiser: from spacegroup, cell, and HKL_sampling

Initialise the object using a given spacegroup, cell, and sampling.

Parameters:
spacegroupThe spacegroup for this datalist.
cellThe unit cell for this datalist.
hkl_samplingThe reflection list description.

Reimplemented from clipper::HKL_data_base.

Reimplemented in clipper::CHKL_data< T >.

References clipper::HKL_info::init().

template<class T >
void clipper::HKL_data< T >::init ( const HKL_data_base hkl_data) [virtual]

[CLIPPER2] initialiser: from another HKL_data object

Initialise the object using a given HKL_data object. The properties of the object (spacegroup, cell, sampling) are the copied, but the actual data is not.

Parameters:
hkl_dataThe HKL_data object to provide the data.

Reimplemented from clipper::HKL_data_base.

References clipper::HKL_info::init().

template<class T >
void clipper::HKL_data< T >::update ( ) [virtual]

update: synchornize info with parent HKL_info

The datalist is resized if necessary to match the parent.

Implements clipper::HKL_data_base.

Reimplemented in clipper::CHKL_data< T >.

References clipper::HKL_data< T >::set_null().

Referenced by clipper::CHKL_data< T >::update().

template<class T >
void clipper::HKL_data< T >::mask ( const HKL_data_base mask) [virtual]

For each data element, if the corresponding element in mask is missing, then that element in this list is also set to missing.

Parameters:
maskThe list to provide the mask.

Implements clipper::HKL_data_base.

References clipper::HKL_data_base::missing(), and clipper::HKL_data< T >::set_null().

template<class T >
T clipper::HKL_data< T >::operator[] ( const HKL_info::HKL_reference_coord ih) const

get data by HKL_reference_coord

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and the data is returned, otherwise the value of 'missing' for the datatype is returned.

Parameters:
ihThe reference to the HKL.
Returns:
The data, or 'missing'.

References clipper::HKL_info::HKL_reference_coord::friedel(), clipper::HKL_info::HKL_reference_coord::hkl(), clipper::HKL_info::HKL_reference_coord::index(), clipper::HKL_data< T >::set_null(), clipper::HKL_info::HKL_reference_coord::sym(), and clipper::HKL::sym_phase_shift().

template<class T>
bool clipper::HKL_data< T >::get_data ( const HKL_info::HKL_reference_coord ih,
T &  data 
) const

get data by HKL_reference_coord (returns false if no equivalent hkl)

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and the data is returned, otherwise the value of 'missing' for the datatype is returned.

Parameters:
ihThe reference to the HKL.
dataReturned with the value of the data.
Returns:
true if the data was returned.

References clipper::HKL_info::HKL_reference_coord::friedel(), clipper::HKL_info::HKL_reference_coord::hkl(), clipper::HKL_info::HKL_reference_coord::index(), clipper::HKL_data< T >::set_null(), clipper::HKL_info::HKL_reference_coord::sym(), and clipper::HKL::sym_phase_shift().

Referenced by clipper::HKL_data< datatypes::ABCD< float > >::data_export().

template<class T>
bool clipper::HKL_data< T >::set_data ( const HKL_info::HKL_reference_coord ih,
const T &  data 
)

set data by HKL_reference_coord (returns false if no equivalent hkl)

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and data is set to the supplied values, otherwise the function returns false.

Parameters:
ihThe reference to the HKL.
dataValue of the data to set.
Returns:
true if the data was set.

References clipper::HKL_info::HKL_reference_coord::friedel(), clipper::HKL_info::HKL_reference_coord::hkl(), clipper::HKL_info::HKL_reference_coord::index(), clipper::HKL_info::HKL_reference_coord::sym(), and clipper::HKL::sym_phase_shift().

Referenced by clipper::HKL_data< datatypes::ABCD< float > >::data_import(), and clipper::data::Test_data::Test_data().

template<class T >
T clipper::HKL_data< T >::operator[] ( const HKL hkl) const

get data by hkl (returns missing if no equivalent hkl)

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and the data is returned, otherwise the value of 'missing' for the datatype is returned.

Parameters:
hklThe reflection HKL.
Returns:
The data, or 'missing'.

References clipper::HKL_info::find_sym(), clipper::HKL_data< T >::set_null(), and clipper::HKL::sym_phase_shift().

template<class T>
bool clipper::HKL_data< T >::get_data ( const HKL hkl,
T &  data 
) const

get data by hkl (returns false if no equivalent hkl)

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and the supplied datatype is set, otherwise the function returns false.

Parameters:
hklThe reflection HKL.
dataReturned with the value of the data.
Returns:
true if the data was returned.

References clipper::HKL_info::find_sym(), clipper::HKL_data< T >::set_null(), and clipper::HKL::sym_phase_shift().

template<class T>
bool clipper::HKL_data< T >::set_data ( const HKL hkl,
const T &  data_ 
)

set data by hkl (returns false if no equivalent hkl)

If a symmetry mate of the requested HKL exists in the list, then the correct symmetry transformations are applied and data is set to the supplied values, otherwise the function returns false.

Parameters:
hklThe reflection HKL.
dataValue of the data to set.
Returns:
true if the data was set.

References clipper::HKL_info::find_sym(), and clipper::HKL::sym_phase_shift().

template<class T>
const ftype clipper::HKL_data< T >::invresolsq ( const int &  index) const

get resolution by reflection index (based on true cell)

Return the resolution of a particular reflection. If the cell of this list closely matches (to within 0.5A) the cell of the parent list, this is a simple lookup, otherwise a metric calculation is required.

Reimplemented from clipper::HKL_data_base.

template<class T>
const Range<ftype> clipper::HKL_data< T >::invresolsq_range ( ) const

get resolution limits of the list (based on true cell and missing data)

Returns:
The high and low resolution limits of the non-missing data.

Reimplemented from clipper::HKL_data_base.

template<class T>
const int clipper::HKL_data< T >::num_obs ( ) const

get number of observations in this list (based on missing data)

Returns:
The number of non-missing data in the object.

Reimplemented from clipper::HKL_data_base.

template<class T>
HKL_reference_index clipper::HKL_data< T >::first ( ) const

return HKL_reference_index pointing to first reflection

Returns:
HKL reference to the first data in this object.

Reimplemented from clipper::HKL_data_base.

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

template<class T>
HKL_reference_index clipper::HKL_data< T >::first_data ( ) const

return HKL_reference_index pointing to first non-missing data

Returns:
HKL reference to the first non-missing data in this object.

Reimplemented from clipper::HKL_data_base.

template<class T>
HKL_reference_index& clipper::HKL_data< T >::next_data ( HKL_reference_index ih) const

increment HKL_reference_index to next non-missing data

Parameters:
ihThe HKL reference to increment.
Returns:
HKL reference to the next non-missing data in this object.

Reimplemented from clipper::HKL_data_base.

template<class T>
HKL_data< T > & clipper::HKL_data< T >::operator= ( const HKL_data< T > &  other)

assignment operator: copies the data from another list

The data list is copied from the assignment source to the target. If the target does not have a defined HKL_info, then that and the Cell are copied as well. If however the target does have a defined HKL_info the HKL_info objects are compared, and if they do not match an exception is thrown.

Parameters:
otherThe datalist to copy.
Returns:
This list.

Reimplemented in clipper::CHKL_data< T >.

References clipper::HKL_info::init(), and clipper::Message::message().

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

assignment operator: assigns a single value to the whole list

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

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

Reimplemented in clipper::CHKL_data< T >.


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