]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGColumnVector4.h
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGColumnVector4.h
index 1a47539d15f2f595154dc43223c275cd27477552..347efb372041e67cdcb0f0c3532bf6cd3ddf5983 100644 (file)
@@ -1,13 +1,11 @@
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Header: FGMatrix33.h
+Header: FGColumnVector4.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,22 +26,24 @@ 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__)
+#  if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <fstream.h>
-#    include <math.h>
 #    include <iostream.h>
+#    include <math.h>
 #  else
 #    include <fstream>
+#  if defined (sgi) && !defined(__GNUC__)
+#    include <math.h>
+#  else
 #    include <cmath>
+#  endif
 #    include <iostream>
      using std::ostream;
      using std::istream;
@@ -66,29 +66,38 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+namespace JSBSim {
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DECLARATION: FGColumnVector4
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** This class implements a 4 dimensional vector.
+    @author Jon S. Berndt, Tony Peden, et. al.
+    @version $Id$
+*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGColumnVector4 : public FGJSBBase
 {
 public:
   FGColumnVector4(void);
-  FGColumnVector4(int m);
+  FGColumnVector4(double A, double B, double C, double D);
   FGColumnVector4(const FGColumnVector4& b);
   ~FGColumnVector4(void);
   
   FGColumnVector4 operator=(const FGColumnVector4& b);
   
   FGColumnVector4 operator*(const double scalar);
-  //FGColumnVector4 operator*(const FGColumnVector4& V);   // Cross product operator
   FGColumnVector4 operator/(const double scalar);
   FGColumnVector4 operator+(const FGColumnVector4& B); // must not return reference
   FGColumnVector4 operator-(const FGColumnVector4& B);
   
   void operator-=(const FGColumnVector4 &B);
   void operator+=(const FGColumnVector4 &B);
-  //void operator*=(const FGColumnVector4 &B);
   void operator*=(const double scalar);
   void operator/=(const double scalar);
   
@@ -97,8 +106,8 @@ public:
   
   FGColumnVector4& operator<<(const double ff);
 
-  inline void InitMatrix(void) { data[1]=0; data[2]=0; data[3]=0; }
-  inline void InitMatrix(double ff) { data[1]=ff; data[2]=ff; data[3]=ff; }
+  inline void InitMatrix(void) { data[1]=0; data[2]=0; data[3]=0; data[4]=0; }
+  inline void InitMatrix(double ff) { data[1]=ff; data[2]=ff; data[3]=ff; data[4]=ff;}
 
   double Magnitude(void);
   FGColumnVector4 Normalize(void);
@@ -113,8 +122,9 @@ public:
 private:
   double data[5];
   int rowCtr;
-  void Debug(void);
+  void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+