Important: Please read the Qt Code of Conduct -

[SOLVED] Matrix division

  • Hi,

    I'm trying to calculate the division between to matrix. I start usin Qgenericmatrix, but i found the trouble that is not possible to create a dynamic size matrix.

    So, Does anybody know any library or some suggestion to calculate matrix divisions with dynamic sizes???

    Thanks for help,

  • First, there is no such operation as matrix division. What you can do is multiply by the matrix's inverse, assuming it exists.

    Matrices with an existing inverse are squared and their determinant is non-zero (see general linear group). This leads to the fact that the inverse (when it exists) has the same dimension. Therefore I don't see why you want a dynamic size... What you can do is a partial specialisation of the QGenericMatrix class, with equal number of columns and rows, add a check for the determinant and an invert method.

  • Hi,

    Yes i know the theory, but i just ask if there's any library to do it (matrix inverse, product...) About the dynamic size, i have data from sensors and the matix size depend on the sensor. I have other solutions, but i searched and ask to find a good one.

    Thanks for reply!

  • Hi,

    I personally use boost to perform matrices operations. There are also plenty other libraries to do so, lapack is a well-known one, root may be another and overkilling one...

  • I just found now armadillo library, Any experience in comparison with the boost mentioned above?


  • I don't know this library.
    Apparently it relies on lapack which is existing for a long time, and thus quite reliable. They say the API is matlab like, which I personally am not found of, but may mean that it is more user-friendly that boost's.

    Boost heavily relies on templates, which cause the syntax to be kind of cumbersome and obscure at first glimpse.

  • I found also a performance test comparing diferent libraries and the armadillo looks like one of the bests, so i will try it.

    Ok thanks so much for help me!

Log in to reply