Reputation: 2409
I have a number of 3x3
matricess that I want to multiply together For example:
m1*m2*m3*m4*m5
Although MTL is a recommended way, I don't have this library and can't use it.
Can someone please suggest a conventional way to multiply these 3x3
matrices (all matrices m1 to m5). Code snippet (for matrix multiplication and multiplying n matrices together) or pointer to some online code will be very useful
Upvotes: 1
Views: 5917
Reputation: 17903
Here is a package of very useful math routines including 3x3 matrix multiplication. The C++ template classes are implemented as header files that can be simply dropped into a project. The overloaded operators make code using this package look very clean. You can preview the implementation of the 3D vector template class online.
Here is a list of all the files in the archive, with those specific for 3x3 matrix multiplication highlighted in bold:
Upvotes: 1
Reputation: 8036
This site has code for multiplying two 3x3 matrices together: http://www.euclideanspace.com/maths/algebra/matrix/resources/code/index.htm#mul3.
Upvotes: 0