Public Types | Public Member Functions | Static Public Member Functions | List of all members
Real2dDftData< F > Class Template Referenceabstract

#include <Real2dDftData.h>

Inheritance diagram for Real2dDftData< F >:
FftwReal2dDftData< F >

Public Types

using Float = F
 
using Index = unsigned int
 
using IndexArray = std::array< Index, 2 >
 
using Norm = RealDftNormalization
 
using Complex = std::complex< Float >
 

Public Member Functions

virtual ~Real2dDftData ()=default
 
virtual void clear ()=0
 
virtual void reset (const IndexArray &nsams)=0
 
virtual Norm normalization () const =0
 
Index rank () const
 
virtual const IndexArraynSamples () const =0
 
virtual Index nSample (Index idim) const
 
Index size (Index idim) const
 
bool inRange (Index idim, Index ifrq) const
 
bool isZero (Index ifrq) const
 
bool isNyquist (Index idim, Index ifrq) const
 
virtual bool isValid () const
 
Complex badValue () const
 
virtual Complex value (const IndexArray &ifrqs) const =0
 
virtual F power (const IndexArray &ifrqs) const
 
virtual F amplitude (const IndexArray &ifrqs) const
 
virtual F phase (const IndexArray &ifrqs) const
 
virtual F real (const IndexArray &ifrqs) const
 
virtual F imag (const IndexArray &ifrqs) const
 
power () const
 

Static Public Member Functions

template<std::size_t N>
static Index dataSize (const std::array< Index, N > &nsams)
 

Detailed Description

template<typename F>
class Real2dDftData< F >

Definition at line 21 of file Real2dDftData.h.

Member Typedef Documentation

template<typename F>
using Real2dDftData< F >::Complex = std::complex<Float>

Definition at line 29 of file Real2dDftData.h.

template<typename F>
using Real2dDftData< F >::Float = F

Definition at line 25 of file Real2dDftData.h.

template<typename F>
using Real2dDftData< F >::Index = unsigned int

Definition at line 26 of file Real2dDftData.h.

template<typename F>
using Real2dDftData< F >::IndexArray = std::array<Index,2>

Definition at line 27 of file Real2dDftData.h.

template<typename F>
using Real2dDftData< F >::Norm = RealDftNormalization

Definition at line 28 of file Real2dDftData.h.

Constructor & Destructor Documentation

template<typename F>
virtual Real2dDftData< F >::~Real2dDftData ( )
virtualdefault

Member Function Documentation

template<typename F>
virtual F Real2dDftData< F >::amplitude ( const IndexArray ifrqs) const
inlinevirtual

Definition at line 92 of file Real2dDftData.h.

92 { return sqrt(power(ifrqs)); };
F power() const
Definition: Real2dDftData.h:98
template<typename F>
Complex Real2dDftData< F >::badValue ( ) const
inline

Definition at line 83 of file Real2dDftData.h.

83  {
84  double badDouble = std::numeric_limits<double>::quiet_NaN();
85  return Complex(badDouble, badDouble);
86  }
std::complex< Float > Complex
Definition: Real2dDftData.h:29
template<typename F>
virtual void Real2dDftData< F >::clear ( )
pure virtual

Implemented in FftwReal2dDftData< F >.

template<typename F>
template<std::size_t N>
static Index Real2dDftData< F >::dataSize ( const std::array< Index, N > &  nsams)
inlinestatic

Definition at line 34 of file Real2dDftData.h.

34  {
35  Index ndat = 1;
36  Index ndim = nsams.size();
37  for ( Index idim=0; idim<ndim; ++idim ) {
38  Index nsam = nsams[idim];
39  ndat *= nsam;
40  }
41  return ndat;
42  }
unsigned int Index
template<typename F>
virtual F Real2dDftData< F >::imag ( const IndexArray ifrqs) const
inlinevirtual

Definition at line 95 of file Real2dDftData.h.

95 { return std::imag(value(ifrqs)); };
virtual Complex value(const IndexArray &ifrqs) const =0
template<typename F>
bool Real2dDftData< F >::inRange ( Index  idim,
Index  ifrq 
) const
inline

Definition at line 71 of file Real2dDftData.h.

71 { return idim < rank() && ifrq < size(idim); }
Index rank() const
Definition: Real2dDftData.h:59
Index size(Index idim) const
Definition: Real2dDftData.h:68
template<typename F>
bool Real2dDftData< F >::isNyquist ( Index  idim,
Index  ifrq 
) const
inline

Definition at line 73 of file Real2dDftData.h.

73 { return idim < rank() && 2*ifrq == size(idim); }
Index rank() const
Definition: Real2dDftData.h:59
Index size(Index idim) const
Definition: Real2dDftData.h:68
template<typename F>
virtual bool Real2dDftData< F >::isValid ( ) const
inlinevirtual

Definition at line 77 of file Real2dDftData.h.

77  {
78  return normalization().isValid() && dataSize(nSamples()) > 0;
79  }
virtual const IndexArray & nSamples() const =0
virtual Norm normalization() const =0
static Index dataSize(const std::array< Index, N > &nsams)
Definition: Real2dDftData.h:34
template<typename F>
bool Real2dDftData< F >::isZero ( Index  ifrq) const
inline

Definition at line 72 of file Real2dDftData.h.

72 { return ifrq == 0; }
template<typename F>
virtual Norm Real2dDftData< F >::normalization ( ) const
pure virtual

Implemented in FftwReal2dDftData< F >.

template<typename F>
virtual Index Real2dDftData< F >::nSample ( Index  idim) const
inlinevirtual

Definition at line 64 of file Real2dDftData.h.

64  {
65  if ( idim > rank() ) return 0;
66  return nSamples()[idim];
67  }
virtual const IndexArray & nSamples() const =0
Index rank() const
Definition: Real2dDftData.h:59
template<typename F>
virtual const IndexArray& Real2dDftData< F >::nSamples ( ) const
pure virtual

Implemented in FftwReal2dDftData< F >.

template<typename F>
virtual F Real2dDftData< F >::phase ( const IndexArray ifrqs) const
inlinevirtual

Definition at line 93 of file Real2dDftData.h.

93 { return std::arg(value(ifrqs)); };
virtual Complex value(const IndexArray &ifrqs) const =0
template<typename F>
virtual F Real2dDftData< F >::power ( const IndexArray ifrqs) const
inlinevirtual

Definition at line 91 of file Real2dDftData.h.

91 { return std::norm(value(ifrqs)); };
virtual Complex value(const IndexArray &ifrqs) const =0
auto norm(Vector const &v)
Return norm of the specified vector.
template<typename F>
F Real2dDftData< F >::power ( ) const
inline

Definition at line 98 of file Real2dDftData.h.

98  {
99  F pwr = 0.0;
100  IndexArray ifrqs;
101  for ( ifrqs[0]=0; ifrqs[0]<size(0); ++ifrqs[0] ) {
102  for ( ifrqs[1]=0; ifrqs[1]<size(1); ++ifrqs[1] ) {
103  F amp = amplitude(ifrqs);
104  pwr += amp*amp;
105  }
106  }
107  return pwr;
108  }
DftData::IndexArray IndexArray
Index size(Index idim) const
Definition: Real2dDftData.h:68
virtual F amplitude(const IndexArray &ifrqs) const
Definition: Real2dDftData.h:92
template<typename F>
Index Real2dDftData< F >::rank ( ) const
inline

Definition at line 59 of file Real2dDftData.h.

59 { return 2; }
template<typename F>
virtual F Real2dDftData< F >::real ( const IndexArray ifrqs) const
inlinevirtual

Definition at line 94 of file Real2dDftData.h.

94 { return std::real(value(ifrqs)); };
virtual Complex value(const IndexArray &ifrqs) const =0
template<typename F>
virtual void Real2dDftData< F >::reset ( const IndexArray nsams)
pure virtual

Implemented in FftwReal2dDftData< F >.

template<typename F>
Index Real2dDftData< F >::size ( Index  idim) const
inline

Definition at line 68 of file Real2dDftData.h.

68 { return nSample(idim); }
virtual Index nSample(Index idim) const
Definition: Real2dDftData.h:64
template<typename F>
virtual Complex Real2dDftData< F >::value ( const IndexArray ifrqs) const
pure virtual

Implemented in FftwReal2dDftData< F >.


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