]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGColumnVector3.h
Updates from JSBSim, including new turbine engine model from David Culp
[flightgear.git] / src / FDM / JSBSim / FGColumnVector3.h
index cae83b6f0f882faf04a916e56656e2a9a1db1267..35a5c8743a9770d3d6c9f4a2956c62a072a4c45e 100644 (file)
@@ -1,13 +1,11 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Header: FGMatrix33.h
+Header: FGColumnVector3.h
 Author: Originally by Tony Peden [formatted and adapted here by Jon Berndt]
 Date started: Unknown
 
 HISTORY
 --------------------------------------------------------------------------------
-??/??/??   TP   Created
-03/16/2000 JSB  Added exception throwing
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
@@ -28,13 +26,11 @@ 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__)
@@ -54,7 +50,6 @@ INCLUDES
    using std::string;
 #endif
 
-#include "FGMatrix33.h"
 #include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -67,17 +62,17 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGMatrix33;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DECLARATION: FGColumnVector3
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 class FGColumnVector3 : public FGJSBBase
 {
 public:
   FGColumnVector3(void);
-  FGColumnVector3(int m);
+  FGColumnVector3(double X, double Y, double Z);
   FGColumnVector3(const FGColumnVector3& b);
   ~FGColumnVector3(void);
   
@@ -95,28 +90,28 @@ public:
   void operator*=(const double scalar);
   void operator/=(const double scalar);
 
-  FGColumnVector3& operator<<(const float ff);
+  FGColumnVector3& operator<<(const double ff);
 
   inline void InitMatrix(void) { data[1]=0; data[2]=0; data[3]=0; }
-  inline void InitMatrix(float ff) { data[1]=ff; data[2]=ff; data[3]=ff; }
+  inline void InitMatrix(double ff) { data[1]=ff; data[2]=ff; data[3]=ff; }
 
-  float Magnitude(void);
+  double Magnitude(void);
   FGColumnVector3 Normalize(void);
 
   friend FGColumnVector3 operator*(const double scalar, const FGColumnVector3& A);
-  //friend FGColumnVector3 operator*(const FGMatrix33& M, FGColumnVector3& V);
 
   friend ostream& operator<<(ostream& os, const FGColumnVector3& col);
 
-  inline double& operator()(int m) const { return data[m]; }
+  inline double operator()(int m) const { return data[m]; }
+  inline double& operator()(int m) { return data[m]; }
 
   FGColumnVector3 multElementWise(const FGColumnVector3& V);
 
 private:
-  double *data;
+  double data[4];
   int rowCtr;
-  void Debug(void);
+  void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif