]> 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 91976f100244e5fafeb9dcb3f2d8319d2c423cae..5eccfdfce13576107bd707316b10c1c8bbc12393 100644 (file)
@@ -39,6 +39,12 @@ INCLUDES
 
 #include "FGMatrix33.h"
 #include "FGColumnVector3.h"
+#include <sstream>
+#include <iomanip>
+
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
@@ -61,6 +67,23 @@ FGMatrix33::FGMatrix33(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+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();
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 ostream& operator<<(ostream& os, const FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {