1 /* 2 *_________________________________________________________________________* 3 * POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE * 4 * DESCRIPTION: SEE READ-ME * 5 * FILE NAME: matrixfun.h * 6 * AUTHORS: See Author List * 7 * GRANTS: See Grants List * 8 * COPYRIGHT: (C) 2005 by Authors as listed in Author's List * 9 * LICENSE: Please see License Agreement * 10 * DOWNLOAD: Free at www.rpi.edu/~anderk5 * 11 * ADMINISTRATOR: Prof. Kurt Anderson * 12 * Computational Dynamics Lab * 13 * Rensselaer Polytechnic Institute * 14 * 110 8th St. Troy NY 12180 * 15 * CONTACT: anderk5@rpi.edu * 16 *_________________________________________________________________________*/ 17 18 #ifndef MATRIXFUN_H 19 #define MATRIXFUN_H 20 21 #include "matrices.h" 22 23 // Create a Matrix 24 VirtualMatrix* NewMatrix(int type); 25 26 // Transpose 27 Matrix T(const VirtualMatrix& A); 28 Mat3x3 T(const Mat3x3& A); 29 Mat6x6 T(const Mat6x6& A); 30 Matrix T(const Vect3& A); 31 Matrix T(const Vect6& A); 32 RowMatrix T(const VirtualColMatrix& A); 33 ColMatrix T(const VirtualRowMatrix& A); 34 35 // Symmetric Inverse 36 37 Matrix SymInverse(Matrix& A); 38 Mat6x6 SymInverse(Mat6x6& A); 39 40 // Inverse 41 Matrix Inverse(Matrix& A); 42 Mat3x3 Inverse(Mat3x3& A); 43 Mat4x4 Inverse(Mat4x4& A); 44 Mat6x6 Inverse(Mat6x6& A); 45 46 // overloaded addition 47 Matrix operator+ (const VirtualMatrix &A, const VirtualMatrix &B); // addition 48 //Mat3x3 operator+ (const Mat3x3 &A, const Mat3x3 &B); // addition 49 //Matrix operator+ (const VirtualMatrix &A, const VirtualMatrix &B); // addition 50 51 // overloaded subtraction 52 Matrix operator- (const VirtualMatrix &A, const VirtualMatrix &B); // subtraction 53 54 // overloaded matrix multiplication 55 Matrix operator* (const VirtualMatrix &A, const VirtualMatrix &B); // multiplication 56 57 // overloaded scalar-matrix multiplication 58 Matrix operator* (const VirtualMatrix &A, double b); // overloaded * 59 Matrix operator* (double b, const VirtualMatrix &A); // overloaded * 60 61 // overloaded negative 62 Matrix operator- (const VirtualMatrix &A); // negative 63 64 Vect3 Cross(Vect3& a, Vect3& b); 65 Mat3x3 CrossMat(Vect3& a); 66 67 Matrix Stack(VirtualMatrix& A, VirtualMatrix& B); 68 Matrix HStack(VirtualMatrix& A, VirtualMatrix& B); 69 70 void Set6DAngularVector(Vect6& v6, Vect3& v3); 71 void Set6DLinearVector(Vect6& v6, Vect3& v3); 72 73 74 75 76 #endif 77