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 SG_USING_STD(ostream);
32 SG_USING_STD(istream);
38 # if defined(sgi) && !defined(__GNUC__)
41 # include <iostream.h>
55 #include "FGColumnVector3.h"
56 #include "FGJSBBase.h"
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
62 #define ID_MATRIX33 "$Id$"
64 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
68 class FGColumnVector3;
70 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71 DECLARATION: MatrixException
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
74 class MatrixException : public FGJSBBase
80 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 DECLARATION: FGMatrix33
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
84 class FGMatrix33 : public FGJSBBase
88 FGMatrix33(int r, int c);
89 FGMatrix33(const FGMatrix33& A);
92 FGMatrix33& operator=(const FGMatrix33& A);
93 inline double operator()(unsigned int row, unsigned int col) const {return data[row][col];}
94 inline double& operator()(unsigned int row, unsigned int col) {return data[row][col];}
96 FGColumnVector3 operator*(const FGColumnVector3& Col);
98 inline unsigned int Rows(void) const { return 3; }
99 inline unsigned int Cols(void) const { return 3; }
102 void InitMatrix(void);
103 void InitMatrix(double value);
105 //friend FGMatrix33 operator*(double scalar,FGMatrix33& A);
107 FGMatrix33 operator-(const FGMatrix33& B);
108 FGMatrix33 operator+(const FGMatrix33& B);
109 FGMatrix33 operator*(const FGMatrix33& B);
110 FGMatrix33 operator*(const double scalar);
111 FGMatrix33 operator/(const double scalar);
112 FGMatrix33& operator<<(const double ff);
114 friend ostream& operator<<(ostream& os, const FGMatrix33& M);
115 friend istream& operator>>(istream& is, FGMatrix33& M);
117 void operator-=(const FGMatrix33 &B);
118 void operator+=(const FGMatrix33 &B);
119 void operator*=(const FGMatrix33 &B);
120 void operator*=(const double scalar);
121 void operator/=(const double scalar);
127 void TransposeSquare(void);
128 unsigned int rowCtr, colCtr;
129 void Debug(int from);