]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGMatrix33.h
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGMatrix33.h
index be38a1b2805858f2a4ac6feeba89910bc0495ea5..bbf168be138a73f0f9deb9ad6dc45e41192aa448 100644 (file)
@@ -28,23 +28,25 @@ INCLUDES
 #  include STL_FSTREAM
 #  include STL_IOSTREAM
    SG_USING_STD(string);
-#  if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-     SG_USING_STD(ostream);
-     SG_USING_STD(istream);
-     SG_USING_STD(cerr);
-     SG_USING_STD(cout);
-     SG_USING_STD(endl);
-#  endif
+   SG_USING_STD(ostream);
+   SG_USING_STD(istream);
+   SG_USING_STD(cerr);
+   SG_USING_STD(cout);
+   SG_USING_STD(endl);
 #else
 #  include <string>
-#  if defined(sgi) && !defined(__GNUC__)
-#    include <fstream.h>
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
+     include <fstream.h>
+     include <iostream.h>
 #    include <math.h>
-#    include <iostream.h>
 #  else
 #    include <fstream>
-#    include <cmath>
 #    include <iostream>
+#    if defined(sgi) && !defined(__GNUC__)
+#      include <math.h>
+#    else
+#      include <cmath>
+#    endif
      using std::ostream;
      using std::istream;
      using std::cerr;
@@ -67,8 +69,17 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGColumnVector3;
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Exception convenience class.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: MatrixException
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -79,6 +90,13 @@ public:
   string Message;
 };
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Handles matrix math operations.
+  */
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: FGMatrix33
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -92,7 +110,8 @@ public:
   ~FGMatrix33(void);
 
   FGMatrix33& operator=(const FGMatrix33& A);
-  inline double& operator()(unsigned int row, unsigned int col) const {return data[row][col];}
+  inline double operator()(unsigned int row, unsigned int col) const {return data[row][col];}
+  inline double& operator()(unsigned int row, unsigned int col) {return data[row][col];}
 
   FGColumnVector3 operator*(const FGColumnVector3& Col);
 
@@ -110,7 +129,7 @@ public:
   FGMatrix33 operator*(const FGMatrix33& B);
   FGMatrix33 operator*(const double scalar);
   FGMatrix33 operator/(const double scalar);
-  FGMatrix33& operator<<(const float ff);
+  FGMatrix33& operator<<(const double ff);
 
   friend ostream& operator<<(ostream& os, const FGMatrix33& M);
   friend istream& operator>>(istream& is, FGMatrix33& M);
@@ -121,18 +140,13 @@ public:
   void operator*=(const double scalar);
   void operator/=(const double scalar);
 
-
-  void SetOParams(char delim,int width,int prec, int origin=0);
-
 protected:
-  double **data;
+  double data[4][4];
 
 private:
-  char delim;
-  int width,prec,origin;
   void TransposeSquare(void);
   unsigned int rowCtr, colCtr;
-  void Debug(void);
+  void Debug(int from);
 };
-
+}
 #endif