Diana Software
Namespaces | Enumerations | Functions
QVectorTools Namespace Reference

Namespaces

 Random
 Useful functions for random data.
 

Enumerations

enum  ConvolveReturn { kConvolveFull , kConvolveValid , kConvolveSame }
 Return modes from convolutions. More...
 

Functions

Diana::QVector Zeros (UInt_t size)
 Return a vector of zeros. More...
 
Diana::QVector Range (UInt_t size)
 Return an indexed range from zero to size. More...
 
Diana::QVector Range (UInt_t min, UInt_t max, UInt_t stride=1)
 Return an indexed range from [min,max) with stride. More...
 
Diana::QVector LinSpace (Double_t min, Double_t max, UInt_t size)
 Return a linear spaced values from min to max. More...
 
Diana::QVector LogSpace (Double_t min, Double_t max, UInt_t size)
 Return a log spaced values from 10**min to 10**max. More...
 
Diana::QVector Convolve (const Diana::QVector &vecA, const Diana::QVector &vecB, ConvolveReturn mode=kConvolveFull)
 Discrete convolution. More...
 
Diana::QVector CircularConvolve (const Diana::QVector &vecA, const Diana::QVector &vecB)
 Discrete circular convolution. More...
 
Diana::QVector ConvolveFFT (const Diana::QVector &vecA, const Diana::QVector &vecB, ConvolveReturn mode=kConvolveFull)
 Convolution using FFT. More...
 

Enumeration Type Documentation

◆ ConvolveReturn

Return modes from convolutions.

Enumerator
kConvolveFull 

Return the full convolution with boundary effects.

kConvolveValid 

Return only the valid samples where the two vectors fully overlap.

kConvolveSame 

Return a vector with size equal to the max of the two inputs.

Definition at line 45 of file QVectorTools.hh.

Function Documentation

◆ CircularConvolve()

Diana::QVector QVectorTools::CircularConvolve ( const Diana::QVector &  vecA,
const Diana::QVector &  vecB 
)

Discrete circular convolution.

Perform a discrete convolution: (f*g)[n] = sum_m f( [(n-m)+size(f)] % size(f) )g(m)

Returns the full convolution of size size(A)+size(B)-1. (With boundary effects).

◆ Convolve()

Diana::QVector QVectorTools::Convolve ( const Diana::QVector &  vecA,
const Diana::QVector &  vecB,
ConvolveReturn  mode = kConvolveFull 
)

Discrete convolution.

Perform a discrete convolution: (f*g)[n] = sum_m f(n-m)g(m)

Returns the full convolution of size size(A)+size(B)-1. (With boundary effects).

◆ ConvolveFFT()

Diana::QVector QVectorTools::ConvolveFFT ( const Diana::QVector &  vecA,
const Diana::QVector &  vecB,
ConvolveReturn  mode = kConvolveFull 
)

Convolution using FFT.

Calculate f*g using IFFT(FFT(F)*FFT(G))

Parameters
paddingpad each vector with size padding

Returns the full convolution of size size(A)+padding. (With boundary effects).

◆ LinSpace()

Diana::QVector QVectorTools::LinSpace ( Double_t  min,
Double_t  max,
UInt_t  size 
)

Return a linear spaced values from min to max.

◆ LogSpace()

Diana::QVector QVectorTools::LogSpace ( Double_t  min,
Double_t  max,
UInt_t  size 
)

Return a log spaced values from 10**min to 10**max.

◆ Range() [1/2]

Diana::QVector QVectorTools::Range ( UInt_t  min,
UInt_t  max,
UInt_t  stride = 1 
)

Return an indexed range from [min,max) with stride.

◆ Range() [2/2]

Diana::QVector QVectorTools::Range ( UInt_t  size)

Return an indexed range from zero to size.

◆ Zeros()

Diana::QVector QVectorTools::Zeros ( UInt_t  size)

Return a vector of zeros.