Public Member Functions | List of all members
ComplexData< N_rank > Class Template Reference

#include <complexdata.h>

Inheritance diagram for ComplexData< N_rank >:
Inheritance graph
[legend]

Public Member Functions

 ComplexData ()
 
 ComplexData (const TinyVector< int, N_rank > &dimvec)
 
 ComplexData (int extent1)
 
 ComplexData (const ComplexData< N_rank > &cd)
 
 ComplexData (const Data< STD_complex, N_rank > &a)
 
template<class T_expr >
 ComplexData (BZ_ETPARM(_bz_ArrayExpr< T_expr >) expr)
 
ComplexData< N_rank > & operator= (const ComplexData< N_rank > &d)
 
ComplexData< N_rank > & operator= (const Array< STD_complex, N_rank > &a)
 
ComplexData< N_rank > & operator= (const STD_complex &val)
 
template<class T_expr >
ComplexData< N_rank > & operator= (BZ_ETPARM(_bz_ArrayExpr< T_expr >) expr)
 
void fft (bool forward=true, bool cyclic_shift=true)
 
void partial_fft (const TinyVector< bool, N_rank > &do_fft, bool forward=true, bool cyclic_shift=true)
 
void modulate_offset (const TinyVector< float, N_rank > &rel_offset)
 
void shift_subpixel (const TinyVector< float, N_rank > &shiftvec)
 
Data< float, N_rank > phasemap () const
 
- Public Member Functions inherited from Data< STD_complex, N_rank >
 Data (const TinyVector< int, N_rank > &dimvec, const STD_complex &val=0)
 
 Data (const STD_string &filename, bool readonly, const TinyVector< int, N_rank > &shape, LONGEST_INT offset=0)
 
 Data (const Data< STD_complex, N_rank > &d)
 
 Data (const Array< STD_complex, N_rank > &a)
 
 Data (const tjarray< tjvector< STD_complex >, STD_complex > &a)
 
 Data (BZ_ETPARM(_bz_ArrayExpr< T_expr >) expr)
 
 ~Data ()
 
Data< STD_complex, N_rank > & operator= (const Data< STD_complex, N_rank > &d)
 
Data< STD_complex, N_rank > & operator= (const Array< STD_complex, N_rank > &a)
 
Data< STD_complex, N_rank > & operator= (const STD_complex &val)
 
Data< STD_complex, N_rank > & operator= (BZ_ETPARM(_bz_ArrayExpr< T_expr >) expr)
 
Data< STD_complex, N_rank > & operator= (const tjarray< tjvector< STD_complex >, STD_complex > &a)
 
int read (const STD_string &format, const STD_string &filename, LONGEST_INT offset=0)
 
int read (const STD_string &filename, LONGEST_INT offset=0)
 
int write (const STD_string &format, const STD_string &filename, bool autoscale=true) const
 
int write (const STD_string &filename, bool autoscale=true) const
 
int write (const STD_string &filename, fopenMode mode=overwriteMode) const
 
int write_asc_file (const STD_string &filename, const Array< STD_complex, N_rank > &pre=defaultArray, const Array< STD_complex, N_rank > &post=defaultArray) const
 
int read_asc_file (const STD_string &filename)
 
int autowrite (const STD_string &filename, const FileWriteOpts &opts=FileWriteOpts(), const Protocol *prot=0) const
 
int autoread (const STD_string &filename, const FileReadOpts &opts=FileReadOpts(), Protocol *prot=0, ProgressMeter *progmeter=0)
 
bool is_filemapped () const
 
 operator tjarray< tjvector< STD_complex >, STD_complex > () const
 
TinyVector< int, N_rank > create_index (unsigned long index) const
 
unsigned long create_linear_index (const TinyVector< int, N_rank > &indexvec) const
 
void shift (unsigned int shift_dim, int shift)
 
void congrid (const TinyVector< int, N_rank > &newshape, const TinyVector< float, N_rank > *subpixel_shift=0, bool left_to_right=false)
 
Data< T2, N_rank2 > & convert_to (Data< T2, N_rank2 > &dst, bool autoscale=true) const
 
STD_complex * c_array ()
 

Detailed Description

template<int N_rank>
class ComplexData< N_rank >

This template class holds multidimensional complex data, most suitable for NMR signal. In addition to functionality provided by the Data Array class, it offers advanced numerical routines (FFT) and block-wise processing of large data files.

Definition at line 43 of file complexdata.h.

Constructor & Destructor Documentation

§ ComplexData() [1/6]

template<int N_rank>
ComplexData< N_rank >::ComplexData ( )
inline

Default constructor

Definition at line 50 of file complexdata.h.

§ ComplexData() [2/6]

template<int N_rank>
ComplexData< N_rank >::ComplexData ( const TinyVector< int, N_rank > &  dimvec)
inline

Constructs a complex array with the given dimensionality

Definition at line 56 of file complexdata.h.

§ ComplexData() [3/6]

template<int N_rank>
ComplexData< N_rank >::ComplexData ( int  extent1)
inline

Constructor with a variable list of arguments to specify the extend in each dimension, the number of args must match N_rank

Definition at line 64 of file complexdata.h.

§ ComplexData() [4/6]

template<int N_rank>
ComplexData< N_rank >::ComplexData ( const ComplexData< N_rank > &  cd)
inline

Copy constructor

Definition at line 78 of file complexdata.h.

§ ComplexData() [5/6]

template<int N_rank>
ComplexData< N_rank >::ComplexData ( const Data< STD_complex, N_rank > &  a)
inline

Copy constructor from Data

Definition at line 84 of file complexdata.h.

§ ComplexData() [6/6]

template<int N_rank>
template<class T_expr >
ComplexData< N_rank >::ComplexData ( BZ_ETPARM(_bz_ArrayExpr< T_expr >)  expr)
inline

Constructor from expression template

Definition at line 91 of file complexdata.h.

Member Function Documentation

§ fft()

template<int N_rank>
void ComplexData< N_rank >::fft ( bool  forward = true,
bool  cyclic_shift = true 
)

Performs an in-place FFT with the following properties:

  • forward: Whether to do a forward (true) or backward (false) FFT
  • cyclic_shift: Whether to shift data cyclically so that zero frequency is in the middle of the array after FFT

Definition at line 177 of file complexdata.h.

§ modulate_offset()

template<int N_rank>
void ComplexData< N_rank >::modulate_offset ( const TinyVector< float, N_rank > &  rel_offset)

Modulate a phase gradient onto the array so that after FFT, the data will be shifted in each dimension by 'rel_offset' which is given as a fraction relative to the full size, i.e. a value of 0.5 shifts the array by half its size.

Definition at line 275 of file complexdata.h.

§ operator=() [1/4]

template<int N_rank>
ComplexData<N_rank>& ComplexData< N_rank >::operator= ( const ComplexData< N_rank > &  d)
inline

Assignment operator

Definition at line 97 of file complexdata.h.

§ operator=() [2/4]

template<int N_rank>
ComplexData<N_rank>& ComplexData< N_rank >::operator= ( const Array< STD_complex, N_rank > &  a)
inline

Assignment operator from Blitz::Array

Definition at line 103 of file complexdata.h.

§ operator=() [3/4]

template<int N_rank>
ComplexData<N_rank>& ComplexData< N_rank >::operator= ( const STD_complex &  val)
inline

Fills all elements with 'val'

Definition at line 109 of file complexdata.h.

§ operator=() [4/4]

template<int N_rank>
template<class T_expr >
ComplexData<N_rank>& ComplexData< N_rank >::operator= ( BZ_ETPARM(_bz_ArrayExpr< T_expr >)  expr)
inline

Assignment operator for expression templates

Definition at line 116 of file complexdata.h.

§ partial_fft()

template<int N_rank>
void ComplexData< N_rank >::partial_fft ( const TinyVector< bool, N_rank > &  do_fft,
bool  forward = true,
bool  cyclic_shift = true 
)

Performs an in-place FFT over a partial number of dimensions with the following properties:

  • do_fft: A vector where the index should be set to 'true' if the FFT should be performed for the corresponding dimension
  • forward: Whether to do a forward (true) or backward (false) FFT
  • cyclic_shift: Whether to shift data cyclically so that zero frequency is in the middle of the array after FFT

Definition at line 204 of file complexdata.h.

§ phasemap()

template<int N_rank>
Data< float, N_rank > ComplexData< N_rank >::phasemap ( ) const

Returns the phase of the complex array, whereby the phase is unwrapped in the last dimension

Definition at line 314 of file complexdata.h.

§ shift_subpixel()

template<int N_rank>
void ComplexData< N_rank >::shift_subpixel ( const TinyVector< float, N_rank > &  shiftvec)

Shift the data by the number of pixels given in 'shiftvec' for each dimension using the FFT, i.e. this is possible even with fractions.

Definition at line 288 of file complexdata.h.


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