compile_IOFormat.cpp
Go to the documentation of this file.
00001 #include <Eigen/Core>
00002 #include <Eigen/LU>
00003 #include <Eigen/QR>
00004 #include <Eigen/Cholesky>
00005 #include <Eigen/Geometry>
00006 #include <Eigen/Jacobi>
00007 #include <Eigen/Eigenvalues>
00008 #include <iostream>
00009 
00010 using namespace Eigen;
00011 using namespace std;
00012 
00013 int main(int, char**)
00014 {
00015   cout.precision(3);
00016   std::string sep = "\n----------------------------------------\n";
00017 Matrix3d m1;
00018 m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9;
00019 
00020 IOFormat CommaInitFmt(StreamPrecision, DontAlignCols, ", ", ", ", "", "", " << ", ";");
00021 IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]");
00022 IOFormat OctaveFmt(StreamPrecision, 0, ", ", ";\n", "", "", "[", "]");
00023 IOFormat HeavyFmt(FullPrecision, 0, ", ", ";\n", "[", "]", "[", "]");
00024 
00025 std::cout << m1 << sep;
00026 std::cout << m1.format(CommaInitFmt) << sep;
00027 std::cout << m1.format(CleanFmt) << sep;
00028 std::cout << m1.format(OctaveFmt) << sep;
00029 std::cout << m1.format(HeavyFmt) << sep;
00030 
00031   return 0;
00032 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:57