CGEM BOSS 6.6.5.i
BESIII Offline Software System
|
basically, convolve with fft. convolves 1-d. if size of 2 inputs are fixed, it may yield optimal speed. currently not thread safe. More...
#include <ConvolveWithConst.h>
Classes | |
struct | convParams |
struct | fft2 |
Public Types | |
enum | TransformOptimOpt { opt_ES , opt_M , opt_P , opt_EX } |
enum | TransformLengthOpt { opt_AsShortAsPsb , opt_Nearst2Pow } |
typedef std::complex< double > | Complex |
Public Member Functions | |
ConvolveWithConst () | |
void | init (const double *ConstArray, const int ConstArrayLength, const int Blength, TransformOptimOpt opt=opt_EX, TransformLengthOpt optL=opt_AsShortAsPsb) |
ConvolveWithConst (const double *ConstArray, const int ConstArrayLength, const int Blength, TransformOptimOpt opt=opt_EX, TransformLengthOpt optL=opt_AsShortAsPsb) | |
~ConvolveWithConst () | |
void | convolve (double *output, const double *B, const int leftIndex, const int sizeofOut, double factor=1) const |
do a convolve of stored const A and B, and put results to output. | |
int | getLength () const |
void | MultiplyAndAdd (Complex *outHalfPlus1, const Complex *inHalfPlus1, double factor=1) const |
multiply with ffted saved results and add them to output with factor; out += in* SavedConst*factor/L | |
void | FFT (Complex *outHalfPlus1, const double *inNormalLength, int LengthOutAsDouble, int LengthIn) const |
Do fft with respect of getLength();. | |
void | IFFT (double *outNormalLength, const Complex *inHalfPlus1, int lengthOut, int lengthInAsDouble) const |
Do ifft with respect of getLength();. | |
basically, convolve with fft. convolves 1-d. if size of 2 inputs are fixed, it may yield optimal speed. currently not thread safe.
Definition at line 18 of file ConvolveWithConst.h.
std::complex<double> ConvolveWithConst::Complex |
Definition at line 22 of file ConvolveWithConst.h.
ConvolveWithConst::ConvolveWithConst | ( | ) |
Definition at line 127 of file ConvolveWithConst.cxx.
ConvolveWithConst::ConvolveWithConst | ( | const double * | ConstArray, |
const int | ConstArrayLength, | ||
const int | Blength, | ||
TransformOptimOpt | opt = opt_EX, | ||
TransformLengthOpt | optL = opt_AsShortAsPsb ) |
Definition at line 49 of file ConvolveWithConst.cxx.
ConvolveWithConst::~ConvolveWithConst | ( | ) |
Definition at line 134 of file ConvolveWithConst.cxx.
void ConvolveWithConst::convolve | ( | double * | output, |
const double * | B, | ||
const int | leftIndex, | ||
const int | sizeofOut, | ||
double | factor = 1 ) const |
do a convolve of stored const A and B, and put results to output.
output | address of output, array of double needed since memcpy |
B | array of input B |
leftindex | output is copied from resuts[leftindex] |
sizeofOut | to results[leftindex+sizeofOut], assuming results has indefinite trailing 0 |
factor | each value is multiplicated with factor, making output[:]*=factor |
Definition at line 166 of file ConvolveWithConst.cxx.
Referenced by CEF2::Convolution_Ebranch_fft(), CEF::Convolution_Ebranch_fft(), CTF2::Convolution_Tbranch_fft(), and CTF::Convolution_Tbranch_fft().
void ConvolveWithConst::FFT | ( | ConvolveWithConst::Complex * | outHalfPlus1, |
const double * | inNormalLength, | ||
int | LengthOutAsDouble, | ||
int | LengthIn ) const |
Do fft with respect of getLength();.
outHalfPlus1 | |
inNormalLength | |
LengthOutAsDouble | |
LengthIn |
Definition at line 251 of file ConvolveWithConst.cxx.
|
inline |
Definition at line 55 of file ConvolveWithConst.h.
void ConvolveWithConst::IFFT | ( | double * | outNormalLength, |
const Complex * | inHalfPlus1, | ||
int | lengthOut, | ||
int | lengthInAsDouble ) const |
Do ifft with respect of getLength();.
outHalfPlus1 | |
inNormalLength | |
LengthOutAsDouble | |
LengthIn |
Definition at line 271 of file ConvolveWithConst.cxx.
void ConvolveWithConst::init | ( | const double * | ConstArray, |
const int | ConstArrayLength, | ||
const int | Blength, | ||
TransformOptimOpt | opt = opt_EX, | ||
TransformLengthOpt | optL = opt_AsShortAsPsb ) |
Definition at line 60 of file ConvolveWithConst.cxx.
Referenced by ConvolveWithConst(), InductionGar2::init(), and InductionGar::init().
void ConvolveWithConst::MultiplyAndAdd | ( | ConvolveWithConst::Complex * | outHalfPlus1, |
const Complex * | inHalfPlus1, | ||
double | factor = 1 ) const |
multiply with ffted saved results and add them to output with factor; out += in* SavedConst*factor/L
out | |
in | |
factor |
Definition at line 228 of file ConvolveWithConst.cxx.