I ported the
Numerix math and statistics library to use the
Matrex library. A couple of convenience functions have been added to
Matrex.from_list/1 which produces a “vector” (just 1 row matrex with function guards). These can then be properly dotted as vectors by using the
Matrex.inner_dot/2 function. This enables most “vector” based numerical algorithms to be encoded without getting transposes mixed up.
On the Numerix side the port contains almost all of the features of the original library. The test framework has been switched to plain exunit.
A new feature that’s been added is a 1d fast Fourier transform (
FFT) which produces results comparable to NumPy’s
fft module. It supports complex numbers by using a 2xN matrix size (e.g. real and imaginary components are stored in separate rows side by side). It’d be possible to generalize it to 2d (or more) for image FFT’s, if anyone’s interested.
One last note is that a polynomial fitting function has been added to
Matrex.Algorithms.fit_poly/3 which supports fitting polynomial coefficients for a given
y vector using gradient descent. Sometimes this produces better results than least squares.