Public Member Functions | Public Attributes

IOFormat Class Reference

Stores a set of parameters controlling the way matrices are printed. More...

List of all members.

Public Member Functions

 IOFormat (int _precision=4, int _flags=Raw, 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

Detailed Description

Stores a set of parameters controlling the way matrices are printed.

List of available parameters:

Example:

std::string sep = "\n----------------------------------------\n";
Matrix3f m1;
m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9;

IOFormat CommaInitFmt(4, Raw, ", ", ", ", "", "", " << ", ";");
IOFormat CleanFmt(4, AlignCols, ", ", "\n", "[", "]");
IOFormat OctaveFmt(4, AlignCols, ", ", ";\n", "", "", "[", "]");
IOFormat HeavyFmt(4, AlignCols, ", ", ";\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:

1.11    2 3.33
   4    5    6
   7 8.89    9
----------------------------------------
 << 1.111, 2, 3.333,  4, 5, 6,  7, 8.889, 9;
----------------------------------------
[1.111,     2, 3.333]
[    4,     5,     6]
[    7, 8.889,     9]
----------------------------------------
[1.111,     2, 3.333;
     4,     5,     6;
     7, 8.889,     9]
----------------------------------------
[[1.111,     2, 3.333];
 [    4,     5,     6];
 [    7, 8.889,     9]]
----------------------------------------
See also:
MatrixBase::format(), class WithFormat

Constructor & Destructor Documentation

IOFormat ( int  _precision = 4,
int  _flags = Raw,
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


The documentation for this class was generated from the following file: