1 /*
2  *_________________________________________________________________________*
3  *      POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE     *
4  *      DESCRIPTION: SEE READ-ME                                           *
5  *      FILE NAME: vect6.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 VECT6_H
19 #define VECT6_H
20 
21 #include "virtualcolmatrix.h"
22 
23 class Matrix;
24 class Mat6x6;
25 class ColMatrix;
26 class Vect3;
27 
28 class Vect6 : public VirtualColMatrix  {
29   double elements[6];
30 public:
31   Vect6();
32   ~Vect6();
33   Vect6(const Vect6& A);  // copy constructor
34   Vect6(const VirtualMatrix& A);  // copy constructor
35 
36   double& operator_1int (int i); // array access
37   double Get_1int(int i) const;
38   void Set_1int(int i, double value);
39   double BasicGet_1int(int i) const;
40   void BasicSet_1int(int i, double value);
41   void BasicIncrement_1int(int i, double value);
42 
43   void Const(double value);
44   MatrixType GetType() const;
45   std::ostream& WriteData(std::ostream& c) const;
46   std::istream& ReadData(std::istream& c);
47 
48   void AssignVM(const VirtualMatrix& A);
49   Vect6& operator=(const Vect6& A); // assignment operator
50   Vect6& operator=(const VirtualMatrix& A); // overloaded =
51   Vect6& operator*=(double b);
52 
53   friend Matrix T(const Vect6& A);  // a wasteful transpose
54 
55   friend void Set6DAngularVector(Vect6& v6, Vect3& v3);
56   friend void Set6DLinearVector(Vect6& v6, Vect3& v3);
57 
58   // fast matrix operations
59   friend void FastAdd(Vect6& A, Vect6& B, Vect6& C);
60   friend void FastSubt(Vect6& A, Vect6& B, Vect6& C);
61   friend void FastMult(Mat6x6& A, Vect6& B, Vect6& C);
62   friend void FastMult(Matrix& A, ColMatrix& B, Vect6& C);
63   friend void FastTMult(Mat6x6& A, Vect6& B, Vect6& C);
64   friend void FastTMult(Matrix& A, Vect6& B, ColMatrix& C);
65   friend void FastLDLTSubs(Mat6x6& LD, Vect6& B, Vect6& C);
66 
67   friend void OnPopulateSVect(Vect3& angular, Vect3& linear, Vect6& sV);
68 };
69 
70 #endif
71