Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. Matrix Algebra with <QVector<QVector<>>
Forum Updated to NodeBB v4.3 + New Features

Matrix Algebra with <QVector<QVector<>>

Scheduled Pinned Locked Moved Qt in Education
13 Posts 8 Posters 16.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    susay
    wrote on last edited by
    #1

    Is there any easy way in the -QT- Qt libraries to calculate with matrix like the calculation of an inverse matrix or to create a determinant?

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Did you have a look at "the docs":http://doc.qt.nokia.com/4.7/qmatrix.html#determinant?

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • S Offline
        S Offline
        susay
        wrote on last edited by
        #3

        Yes but it says "This class is obsolete". I think I should not use it.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          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.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            susay
            wrote on last edited by
            #5

            No one 3x3 matrix is not enough. Ok then I'll look for a new approach.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              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).

              1 Reply Last reply
              0
              • S Offline
                S Offline
                susay
                wrote on last edited by
                #7

                That sounds interesting, I'll look at me even closer. I thank you for your help

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  john_god
                  wrote on last edited by
                  #8

                  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)

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    KA51O
                    wrote on last edited by
                    #9

                    Did noone else see "this":http://developer.qt.nokia.com/doc/qt-4.7/qmatrix4x4.html ?

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      Franzk
                      wrote on last edited by
                      #10

                      Who said a 4x4 matrix would be enough?

                      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        susay
                        wrote on last edited by
                        #11

                        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.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          darijany
                          wrote on last edited by
                          #12

                          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/

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            dridk
                            wrote on last edited by
                            #13

                            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;
                            }
                            

                            Nothing in Biology Makes Sense Except in the Light of Evolution

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved