1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 Author: Originally by Tony Peden [formatted and adapted here by Jon Berndt]
8 --------------------------------------------------------------------------------
10 03/16/2000 JSB Added exception throwing
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
19 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
26 # include <simgear/compiler.h>
29 # include STL_IOSTREAM
31 # if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
32 SG_USING_STD(ostream);
33 SG_USING_STD(istream);
40 # if defined(sgi) && !defined(__GNUC__)
43 # include <iostream.h>
57 #include "FGColumnVector3.h"
58 #include "FGJSBBase.h"
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
64 #define ID_MATRIX33 "$Id$"
66 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
70 class FGColumnVector3;
72 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 DECLARATION: MatrixException
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
76 class MatrixException : public FGJSBBase
82 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
83 DECLARATION: FGMatrix33
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
86 class FGMatrix33 : public FGJSBBase
90 FGMatrix33(int r, int c);
91 FGMatrix33(const FGMatrix33& A);
94 FGMatrix33& operator=(const FGMatrix33& A);
95 inline double operator()(unsigned int row, unsigned int col) const {return data[row][col];}
96 inline double& operator()(unsigned int row, unsigned int col) {return data[row][col];}
98 FGColumnVector3 operator*(const FGColumnVector3& Col);
100 inline unsigned int Rows(void) const { return 3; }
101 inline unsigned int Cols(void) const { return 3; }
104 void InitMatrix(void);
105 void InitMatrix(double value);
107 //friend FGMatrix33 operator*(double scalar,FGMatrix33& A);
109 FGMatrix33 operator-(const FGMatrix33& B);
110 FGMatrix33 operator+(const FGMatrix33& B);
111 FGMatrix33 operator*(const FGMatrix33& B);
112 FGMatrix33 operator*(const double scalar);
113 FGMatrix33 operator/(const double scalar);
114 FGMatrix33& operator<<(const double ff);
116 friend ostream& operator<<(ostream& os, const FGMatrix33& M);
117 friend istream& operator>>(istream& is, FGMatrix33& M);
119 void operator-=(const FGMatrix33 &B);
120 void operator+=(const FGMatrix33 &B);
121 void operator*=(const FGMatrix33 &B);
122 void operator*=(const double scalar);
123 void operator/=(const double scalar);
129 void TransposeSquare(void);
130 unsigned int rowCtr, colCtr;
131 void Debug(int from);