11#ifndef MARVIN_MIXMATRIX_H
12#define MARVIN_MIXMATRIX_H
28 template <FloatType SampleType,
int size>
31 static constexpr SampleType multiplier{ -2.0 / size };
40 for (
int i = 0; i < size; ++i) {
58 template <FloatType SampleType,
int size>
67 if constexpr (size <= 1)
70 constexpr int hSize = size / 2;
75 for (
int i = 0; i < hSize; ++i) {
76 SampleType a = data[i];
77 SampleType b = data[i + hSize];
79 data[i + hSize] = (a - b);
87 static inline void inPlace(SampleType* data) {
89 auto scalingFactor =
static_cast<SampleType
>(std::sqrt(1.0 / size));
A helper class to apply an NxN Hadamard matrix to a given input array-like.
Definition marvin_MixMatrix.h:60
static void recursiveUnscaled(SampleType *data)
Definition marvin_MixMatrix.h:66
static void inPlace(SampleType *data)
Definition marvin_MixMatrix.h:87
A helper class to apply an NxN Householder matrix to a given input array-like.
Definition marvin_MixMatrix.h:30
static void inPlace(SampleType *arr)
Definition marvin_MixMatrix.h:38
void multiply(T *lhs, const T *rhs, size_t size) noexcept
void add(T *lhs, const T *rhs, size_t size) noexcept
Math helper functions and classes.
Definition marvin_Math.h:22
constexpr bool isPowerOfTwo()
Definition marvin_Concepts.h:92