Namespace smath

namespace smath

Functions

template<class T>
void auto_correlate_direct(std::vector<std::complex<T>> &data)
void auto_correlate_direct(fftw_complex *data, size_t N)

Replaces the data within the array with its auto-correlated value using FFT (scales with N)

void auto_correlate_fftw(std::vector<std::complex<double>> &data, size_t N, fftw_plan p1, fftw_plan p2, fftw_complex *fftw_planspace)
template<class T>
void auto_correlate_fftw(std::vector<std::complex<T>> &data, fftw_plan p1, fftw_plan p2)
void auto_correlate_fftw(fftw_complex *data, fftw_plan p1, fftw_plan p2, size_t NF)

Replaces the data within the array with its auto-correlated value using FFT (scales with N)

template<class T>
void square_elements(std::vector<std::complex<T>> &data)
void square_elements(fftw_complex *data, size_t N)

Element-wise squaring of an array

template<class T>
void multiply_elements(const T &factor, std::vector<std::complex<T>> &data)
void multiply_elements(const double factor, fftw_complex *data, size_t NF)

Element-wise multiplication of an array

template<class T>
void add_elements(std::vector<std::complex<T>> &target, const std::vector<std::complex<T>> &source)
void add_elements(fftw_complex *target, const fftw_complex *source, size_t NF)

Element-wise addition of two arrays

template<class T>
void add_elements(std::vector<std::complex<T>> &target, const fftw_complex *source, size_t N)
template<class T>
std::complex<T> reduce(const std::vector<std::complex<T>> &data)
template<class T>
std::complex<T> reduce(const fftw_complex *data, size_t N)

Computes the sum of an array

inline double sine(double &x)

Computes the sine within the first oscillation. Trades off speed vs. accuracy.

template<class T>
void multiply_elements(const T &factor, std::vector<std::complex<T>> &data)

Element-wise multiplication of an array

template<class T>
void square_elements(std::vector<std::complex<T>> &data)

Element-wise squaring of an array

template<class T>
void add_elements(std::vector<std::complex<T>> &target, const std::vector<std::complex<T>> &source)

Element-wise addition of two arrays

template<class T>
void auto_correlate_fftw(std::vector<std::complex<T>> &data, fftw_plan p1, fftw_plan p2)

Replaces the data within the array with its auto-correlated value using FFT (scales with N)

template<class T>
void auto_correlate_direct(std::vector<std::complex<T>> &data)

Replaces the data within the array with its auto-correlated value using the direct (scales with N*N)

template<class T>
std::complex<T> reduce(const std::vector<std::complex<T>> &data)

Computes the sum of an array

void auto_correlate_fftw(std::vector<std::complex<double>> &data, fftw_plan p1, fftw_plan p2, fftw_complex *fftw_planspace)

Replaces the data within the array with its auto-correlated value using FFT (scales with N)

template<class T>
void add_elements(std::vector<std::complex<T>> &target, const fftw_complex *source, size_t N)

Element-wise addition of two arrays