mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-06 05:05:12 +08:00
Don't add rowSpacer if columns are not to be aligned
This commit is contained in:
parent
3390db099a
commit
4d7dfafbe7
@ -49,7 +49,7 @@ std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat&
|
|||||||
*/
|
*/
|
||||||
struct IOFormat
|
struct IOFormat
|
||||||
{
|
{
|
||||||
/** Default contructor, see class IOFormat for the meaning of the parameters */
|
/** Default constructor, see class IOFormat for the meaning of the parameters */
|
||||||
IOFormat(int _precision = StreamPrecision, int _flags = 0,
|
IOFormat(int _precision = StreamPrecision, int _flags = 0,
|
||||||
const std::string& _coeffSeparator = " ",
|
const std::string& _coeffSeparator = " ",
|
||||||
const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="",
|
const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="",
|
||||||
@ -57,6 +57,10 @@ struct IOFormat
|
|||||||
: matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
|
: matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
|
||||||
rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
|
rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
|
||||||
{
|
{
|
||||||
|
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
|
||||||
|
// don't add rowSpacer if columns are not to be aligned
|
||||||
|
if((fmt.flags & DontAlignCols))
|
||||||
|
return;
|
||||||
int i = int(matSuffix.length())-1;
|
int i = int(matSuffix.length())-1;
|
||||||
while (i>=0 && matSuffix[i]!='\n')
|
while (i>=0 && matSuffix[i]!='\n')
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user