]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/math/FGMatrix33.cpp
Merge branch 'vivian/trainz'
[flightgear.git] / src / FDM / JSBSim / math / FGMatrix33.cpp
index 5b66bc8e144fe64b74821c978979c65380de8e42..5eccfdfce13576107bd707316b10c1c8bbc12393 100644 (file)
@@ -39,15 +39,18 @@ INCLUDES
 
 #include "FGMatrix33.h"
 #include "FGColumnVector3.h"
+#include <sstream>
+#include <iomanip>
+
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MATRIX33;
 
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -59,12 +62,29 @@ FGMatrix33::FGMatrix33(void)
   data[0] = data[1] = data[2] = data[3] = data[4] = data[5] =
     data[6] = data[7] = data[8] = 0.0;
 
-  Debug(0);
+  // Debug(0);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGMatrix33::Dump(const string& delimiter) const
+{
+  ostringstream buffer;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(1,3) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(2,3) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,1) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,2) << delimiter;
+  buffer << std::setw(18) << std::setprecision(16) << Entry(3,3);
+  return buffer.str();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
+ostream& operator<<(ostream& os, const FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {
     for (unsigned int j=1; j<=M.Cols(); j++) {
@@ -79,7 +99,7 @@ std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-std::istream& operator>>(std::istream& is, FGMatrix33& M)
+istream& operator>>(istream& is, FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {
     for (unsigned int j=1; j<=M.Cols(); j++) {