Formatter for Eigen matrix type. More...
#include <formatters.hpp>
Public Member Functions | |
FloatMatrixFormatter (const unsigned int &p=2, const int &w=-1) | |
Default constructor. | |
FloatMatrixFormatter< Derived > & | operator() (const Derived &matrix) |
Format a matrix with permanently stored precision/width. | |
FloatMatrixFormatter< Derived > & | operator() (const Derived &matrix, const unsigned int &p, const int &w) |
Format a matrix with temporarily specified precision/width. | |
FloatMatrixFormatter< Derived > & | precision (const unsigned int &p) |
Sets the precision format parameter. | |
unsigned int | precision () |
Returns the current precision setting. | |
FloatMatrixFormatter< Derived > & | width (const int &w) |
Sets the width format parameter. | |
int | width () |
Returns the current width setting. | |
virtual | ~FloatMatrixFormatter () |
Private Attributes | |
const Derived * | _matrix |
ecl::Format< typename Derived::Scalar > | format |
Stream the formatter. | |
bool | ready_to_format |
bool | tmp_formatting |
unsigned int | tmp_precision |
int | tmp_width |
Formatter for Eigen matrix type.
I want make it formatting any types of eigen
Derived | : MatrixBase's type which specify the matrix as vector, matrix with any storage type |
Definition at line 61 of file formatters.hpp.
Eigen::FloatMatrixFormatter< Derived >::FloatMatrixFormatter | ( | const unsigned int & | p = 2 , |
const int & | w = -1 |
||
) | [inline] |
Default constructor.
Initialises the format tags for width, and precision.
w | : width (default - no width constraints) |
p | : the number of decimal places of precision (default - 4) |
Definition at line 73 of file formatters.hpp.
virtual Eigen::FloatMatrixFormatter< Derived >::~FloatMatrixFormatter | ( | ) | [inline, virtual] |
Definition at line 81 of file formatters.hpp.
FloatMatrixFormatter< Derived >& Eigen::FloatMatrixFormatter< Derived >::operator() | ( | const Derived & | matrix | ) | [inline] |
Format a matrix with permanently stored precision/width.
This function directly formats the specified input value with the stored settings.
matrix | : the matrix to be formatted (gets temporarily stored as a pointer). |
Definition at line 140 of file formatters.hpp.
FloatMatrixFormatter< Derived >& Eigen::FloatMatrixFormatter< Derived >::operator() | ( | const Derived & | matrix, |
const unsigned int & | p, | ||
const int & | w | ||
) | [inline] |
Format a matrix with temporarily specified precision/width.
This function directly formats the specified input value and temporary settings.
Vector2d v; v << 1.0, 2.0; Format<Vector2d> format; cout << format(v,3,-1) << endl; // precision of 3 and no width constraint
matrix | : the matrix to be formatted (gets temporarily stored as a pointer). |
p | : the number of decimal places of precision. |
w | : the width to use for inserted floats (-1 is no width constraint). |
Definition at line 162 of file formatters.hpp.
FloatMatrixFormatter<Derived>& Eigen::FloatMatrixFormatter< Derived >::precision | ( | const unsigned int & | p | ) | [inline] |
Sets the precision format parameter.
Sets the precision format parameter.
p | : the number of decimal places of precision. |
Definition at line 94 of file formatters.hpp.
unsigned int Eigen::FloatMatrixFormatter< Derived >::precision | ( | ) | [inline] |
Returns the current precision setting.
Definition at line 116 of file formatters.hpp.
FloatMatrixFormatter<Derived>& Eigen::FloatMatrixFormatter< Derived >::width | ( | const int & | w | ) | [inline] |
Sets the width format parameter.
Sets the width format parameter.
w | : the width to use for inserted floats (-1 is no width constraint). |
Definition at line 107 of file formatters.hpp.
int Eigen::FloatMatrixFormatter< Derived >::width | ( | ) | [inline] |
Returns the current width setting.
Definition at line 122 of file formatters.hpp.
const Derived* Eigen::FloatMatrixFormatter< Derived >::_matrix [private] |
Definition at line 193 of file formatters.hpp.
ecl::Format<typename Derived::Scalar> Eigen::FloatMatrixFormatter< Derived >::format [private] |
Stream the formatter.
Insertion operator for sending the formatter to an output stream.
ostream | : the output stream. |
formatter | : the formatter to be inserted. |
OutputStream | : the type of the output stream to be inserted into. |
Derived | : matrix type. |
StandardException | : throws if the formatter has un-specified _matrix [debug mode only] |
Definition at line 185 of file formatters.hpp.
bool Eigen::FloatMatrixFormatter< Derived >::ready_to_format [private] |
Definition at line 192 of file formatters.hpp.
bool Eigen::FloatMatrixFormatter< Derived >::tmp_formatting [private] |
Definition at line 191 of file formatters.hpp.
unsigned int Eigen::FloatMatrixFormatter< Derived >::tmp_precision [private] |
Definition at line 190 of file formatters.hpp.
int Eigen::FloatMatrixFormatter< Derived >::tmp_width [private] |
Definition at line 189 of file formatters.hpp.