Stores a set of parameters controlling the way matrices are printed. More...
#include <IO.h>
Public Member Functions | |
IOFormat (int _precision=StreamPrecision, int _flags=0, const std::string &_coeffSeparator=" ", const std::string &_rowSeparator="\n", const std::string &_rowPrefix="", const std::string &_rowSuffix="", const std::string &_matPrefix="", const std::string &_matSuffix="") | |
Public Attributes | |
std::string | coeffSeparator |
int | flags |
std::string | matPrefix |
std::string | matSuffix |
int | precision |
std::string | rowPrefix |
std::string | rowSeparator |
std::string | rowSpacer |
std::string | rowSuffix |
Stores a set of parameters controlling the way matrices are printed.
List of available parameters:
StreamPrecision
and FullPrecision
. The default is the special value StreamPrecision
which means to use the stream's own precision setting, as set for instance using cout.precision(3)
. The other special value FullPrecision
means that the number of digits will be computed to match the full precision of each floating-point type.DontAlignCols
which allows to disable the alignment of columns, resulting in faster code.Example:
std::string sep = "\n----------------------------------------\n"; Matrix3d m1; m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9; IOFormat CommaInitFmt(StreamPrecision, DontAlignCols, ", ", ", ", "", "", " << ", ";"); IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]"); IOFormat OctaveFmt(StreamPrecision, 0, ", ", ";\n", "", "", "[", "]"); IOFormat HeavyFmt(FullPrecision, 0, ", ", ";\n", "[", "]", "[", "]"); std::cout << m1 << sep; std::cout << m1.format(CommaInitFmt) << sep; std::cout << m1.format(CleanFmt) << sep; std::cout << m1.format(OctaveFmt) << sep; std::cout << m1.format(HeavyFmt) << sep;
Output:
Definition at line 63 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
IOFormat::IOFormat | ( | int | _precision = StreamPrecision , |
int | _flags = 0 , |
||
const std::string & | _coeffSeparator = " " , |
||
const std::string & | _rowSeparator = "\n" , |
||
const std::string & | _rowPrefix = "" , |
||
const std::string & | _rowSuffix = "" , |
||
const std::string & | _matPrefix = "" , |
||
const std::string & | _matSuffix = "" |
||
) | [inline] |
Default contructor, see class IOFormat for the meaning of the parameters
Definition at line 66 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::coeffSeparator |
Definition at line 83 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
int IOFormat::flags |
Definition at line 85 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::matPrefix |
Definition at line 81 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::matSuffix |
Definition at line 81 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
Definition at line 84 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::rowPrefix |
Definition at line 82 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::rowSeparator |
Definition at line 82 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::rowSpacer |
Definition at line 82 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.
std::string IOFormat::rowSuffix |
Definition at line 82 of file src/g2o/EXTERNAL/eigen3/Eigen/src/Core/IO.h.