More matrix ops

dsp_module
dsp

#1

When can we expect fast matrix inverse, transpose and concatenation methods?
Or is there any caveat i’m not aware of to do those ops?


#2

Are you talking of the Matrix3D class? since it has fixed 4x4 dimensions, a concatenation cannot be available.
But adding inverse should be possible…
A translation would also be trivial, just multiply the dimensions of your vector with the mat[3], mat[7], mat[11]. Would make a good addition.

I once created a fully templated matrix class with the common operations, I guess that’s what you are after:

template<FloatType T, int x, int y>
class Matrix;

It is fun to do, don’t know why I dumped it…


#3

I was talking about the juce::dsp::Matrix class.
I’ve been trying to use it for a while, but I can’t due to the lack of the inverting methods.

Writing my own inverse matrix code doesn’t look like a good option.
It would take me a very long time to write a SIMD optimised code and it still would perform very poorly compared to legacy code (LAPACK, OpenBLAS, etc…).

My way out has been using the Armadillo and Eigen libs, since they wrap up those legacy libraries with nicely templated C++.
But having those dependencies is far from optimal, they have awkward build systems, specially for static linking on Windows.

It would be really awesome to have that readily available on JUCE and have real portable code.


#4

I used Eigen for some heavy matrix based dsp code in a recent project (and really like the Eigen API style by the way). As it is a header only library, adding Eigen to my project was as easy as including one header, no linking to any pre-built lib needed. Although this was on Linux / Mac OS only I‘m not aware of any more work needed for windows, so I‘m a bit suprised what makes it that difficult for you to have this dependency?


#5

I’m not saying it is difficult, I’m just looking into reducing the number of moving parts.
The dsp module has this beautiful matrix class, but I have to use a huge external library just for inverting matrices.

All good with Eigen, I’m just saying I’d rather leave those for heavy load and do smaller matrix stuff entirely inside JUCE. :slight_smile: