开发者

matrix multiplication in C++

开发者 https://www.devze.com 2022-12-21 09:17 出处:网络
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.

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 sni开发者_运维技巧ppet (for matrix multiplication and multiplying n matrices together) or pointer to some online code will be very useful


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:

  • Assert.c
  • Assert.h
  • intersect.cpp
  • intersect.h
  • line2.h
  • Line3.h
  • main.cpp
  • Math.dsp
  • Math.dsw
  • Matrix2.h
  • Matrix3.h
  • matrix4.h
  • MatrixN.h
  • plane.h
  • quaternion.h
  • random.h
  • Rect.h
  • Spline.cpp
  • Spline.h
  • Utility.h
  • vector2.h
  • vector3.h
  • vector4.h


This site has code for multiplying two 3x3 matrices together: http://www.euclideanspace.com/maths/algebra/matrix/resources/code/index.htm#mul3.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号