npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::ConvolutionEngineND Class Reference

#include <ConvolutionEngineND.hh>

Public Member Functions

 ConvolutionEngineND (const unsigned *shape, unsigned rank, unsigned optimization=FFTW_ESTIMATE)
 
template<typename Real >
void setFilter (const Real *data, const unsigned *dataShape, unsigned dataRank)
 
template<typename Real1 , typename Real2 >
void convolveWithFilter (const Real1 *in, Real2 *out, const unsigned *dataShape, unsigned dataRank)
 
template<typename Real >
void depositFilter (unsigned long id, const Real *data, const unsigned *dataShape, unsigned dataRank)
 
template<typename Real1 , typename Real2 >
void convolveWithDeposit (unsigned long id, const Real1 *in, Real2 *out, const unsigned *dataShape, unsigned dataRank)
 
template<typename Real2 >
void convolveFilterAndDeposit (unsigned long id, Real2 *out, const unsigned *dataShape, unsigned dataRank)
 
template<typename Real2 >
void deconvolveFilterAndDeposit (unsigned long id, Real2 *out, const unsigned *dataShape, unsigned dataRank)
 
bool discardFilter (unsigned long id)
 
void clearFilterBank ()
 
bool isShapeCompatible (const unsigned *shape, unsigned rank) const
 
unsigned rank () const
 
const std::vector< unsigned > & shape () const
 
unsigned long dataLength () const
 
bool isFilterSet () const
 
unsigned filterBankSize () const
 

Detailed Description

Class for performing multivariate convolutions by FFT (using FFTW library). Internally, transforms are calculated in double precision.

Constructor & Destructor Documentation

◆ ConvolutionEngineND()

npstat::ConvolutionEngineND::ConvolutionEngineND ( const unsigned *  shape,
unsigned  rank,
unsigned  optimization = FFTW_ESTIMATE 
)

Constructor takes the shape of the data and FFTW optimization flag as parameters. Make sure the data dimensions are sufficient to avoid the convolution wrap-around.

Member Function Documentation

◆ clearFilterBank()

void npstat::ConvolutionEngineND::clearFilterBank ( )

Discard all filters deposited by depositFilter method

◆ convolveFilterAndDeposit()

template<typename Real2 >
void npstat::ConvolutionEngineND::convolveFilterAndDeposit ( unsigned long  id,
Real2 *  out,
const unsigned *  dataShape,
unsigned  dataRank 
)

Convolve the filter established by the "setFilter" method with a previously deposited filter

◆ convolveWithDeposit()

template<typename Real1 , typename Real2 >
void npstat::ConvolutionEngineND::convolveWithDeposit ( unsigned long  id,
const Real1 *  in,
Real2 *  out,
const unsigned *  dataShape,
unsigned  dataRank 
)

Convolve provided data with one of the filters previously established by the depositFilter method. The "id" argument is used to identify a particular filter.

◆ convolveWithFilter()

template<typename Real1 , typename Real2 >
void npstat::ConvolutionEngineND::convolveWithFilter ( const Real1 *  in,
Real2 *  out,
const unsigned *  dataShape,
unsigned  dataRank 
)

Convolve provided data with the filter previously established by setFilter

◆ dataLength()

unsigned long npstat::ConvolutionEngineND::dataLength ( ) const
inline

Expected data length

◆ deconvolveFilterAndDeposit()

template<typename Real2 >
void npstat::ConvolutionEngineND::deconvolveFilterAndDeposit ( unsigned long  id,
Real2 *  out,
const unsigned *  dataShape,
unsigned  dataRank 
)

Deconvolve the filter established by the "setFilter" method with a previously deposited filter

◆ depositFilter()

template<typename Real >
void npstat::ConvolutionEngineND::depositFilter ( unsigned long  id,
const Real *  data,
const unsigned *  dataShape,
unsigned  dataRank 
)

Provide a filter for subsequent convolutions.

"id" is the user id for the filter which can be later reused with the method "convolveWithDeposit".

◆ discardFilter()

bool npstat::ConvolutionEngineND::discardFilter ( unsigned long  id)

Discard a filter previously deposited by depositFilter method. This method returns "true" if the filter with the given id was indeed discarded and "false" if such a filter was not found.

◆ isShapeCompatible()

bool npstat::ConvolutionEngineND::isShapeCompatible ( const unsigned *  shape,
unsigned  rank 
) const

Check if an array shape is compatible with this filter

◆ rank()

unsigned npstat::ConvolutionEngineND::rank ( ) const
inline

Expected data dimensionality

◆ setFilter()

template<typename Real >
void npstat::ConvolutionEngineND::setFilter ( const Real *  data,
const unsigned *  dataShape,
unsigned  dataRank 
)

Provide the filter for subsequent convolutions

◆ shape()

const std::vector<unsigned>& npstat::ConvolutionEngineND::shape ( ) const
inline

Expected shape of the data


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