Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::IOFormat Class Reference

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

#include <src/eigen/Eigen/src/Core/IO.h>

+ Collaboration diagram for Eigen::IOFormat:

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 matPrefix
 
std::string matSuffix
 
std::string rowPrefix
 
std::string rowSuffix
 
std::string rowSeparator
 
std::string rowSpacer
 
std::string coeffSeparator
 
int precision
 
int flags
 

Detailed Description

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

List of available parameters:

  • precision number of digits for floating point values, or one of the special constants 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.
  • flags an OR-ed combination of flags, the default value is 0, the only currently available flag is DontAlignCols which allows to disable the alignment of columns, resulting in faster code.
  • coeffSeparator string printed between two coefficients of the same row
  • rowSeparator string printed between two rows
  • rowPrefix string printed at the beginning of each row
  • rowSuffix string printed at the end of each row
  • matPrefix string printed at the beginning of the matrix
  • matSuffix string printed at the end of the matrix

Example:

Output:

See also
DenseBase::format(), class WithFormat

Constructor & Destructor Documentation

◆ IOFormat()

Eigen::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 constructor, see class IOFormat for the meaning of the parameters

57 : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
58 rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
59 {
60 // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
61 // don't add rowSpacer if columns are not to be aligned
62 if((flags & DontAlignCols))
63 return;
64 int i = int(matSuffix.length())-1;
65 while (i>=0 && matSuffix[i]!='\n')
66 {
67 rowSpacer += ' ';
68 i--;
69 }
70 }
@ DontAlignCols
Definition IO.h:16
std::string rowPrefix
Definition IO.h:72
std::string rowSuffix
Definition IO.h:72
std::string coeffSeparator
Definition IO.h:73
std::string rowSpacer
Definition IO.h:72
std::string matPrefix
Definition IO.h:71
std::string rowSeparator
Definition IO.h:72
std::string matSuffix
Definition IO.h:71
int precision
Definition IO.h:74
int flags
Definition IO.h:75

References Eigen::DontAlignCols, flags, matSuffix, and rowSpacer.

Member Data Documentation

◆ coeffSeparator

std::string Eigen::IOFormat::coeffSeparator

◆ flags

int Eigen::IOFormat::flags

◆ matPrefix

std::string Eigen::IOFormat::matPrefix

◆ matSuffix

std::string Eigen::IOFormat::matSuffix

◆ precision

int Eigen::IOFormat::precision

◆ rowPrefix

std::string Eigen::IOFormat::rowPrefix

◆ rowSeparator

std::string Eigen::IOFormat::rowSeparator

◆ rowSpacer

std::string Eigen::IOFormat::rowSpacer

◆ rowSuffix

std::string Eigen::IOFormat::rowSuffix

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