Matrix Algebra with <QVector<QVector<>>
-
QMatrix was only there for 3x3 matrices. If that's everything you need, you could try using QTransform. For any other matrix operations, I would look for a more math oriented library. Qt only does the math required for GUI stuff as far as I know.
I wouldn't be using QVector<QVector<double> >, but rather write a custom matrix class. Maintaining a QVector of synchronized QVectors is rather a pain in the butt. Also you won't be able to feed the entire data buffer into some third party function.
-
No one 3x3 matrix is not enough. Ok then I'll look for a new approach.
-
Take a look at the "Eigen":http://eigen.tuxfamily.org/index.php?title=Main_Page library. I think it contains what you are looking for (and much more).
-
That sounds interesting, I'll look at me even closer. I thank you for your help
-
I did a "Matrix library":http://gitorious.org/math-graphica/math-graphica/trees/master/math, that I use in my program Math Graphica. It has determinants, inverse, cofactor, transpose, adjugate, system of equations solving, line and colums swaping. Check the link, the files are matrix.cpp and matrix.h (matriz.cpp and matriz.h are deprecate)
-
Did noone else see "this":http://developer.qt.nokia.com/doc/qt-4.7/qmatrix4x4.html ?
-
Who said a 4x4 matrix would be enough?
-
I need an nxn matrix with up to 16 rows / columns. I like the matrix library of "Graphica Math". I think that can solve my problem.
Thank you for your answers.
-
You can use Armedillo:
Fast C++ matrix library with easy to use functions and syntax, deliberately similar to Matlab. Uses template meta-programming techniques.
You can download by follow link
arma.sourceforge.net/ -
For 2 dimensions, you can use 1 dimension vector . For exemple, a matrice 320x200
QVector<int> datas; int value(int x, int y) { // Check out of range Q_ASSERT(x*y < 320*200) return 320*y + x; }