Re: [eigen] default printing format

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2009/8/14 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> I agree the default should be the c++ default.

ok, the changes are done.

here's an example of how to use full precision as the default:

#define EIGEN_DEFAULT_IO_FORMAT IOFormat(FullPrecision)
#include<Eigen/Eigen>
int main() {
  std::cout << Eigen::Matrix4d::Random() << std::endl;
}

columns are aligned by default, pass DontAlignCols to IOFormat ctor to disable.

Benoit.


>
>>> Moreover, already in Eigen 2.0 one can set once and for all a default
>>> IOFormat different from the "default default":
>>>
>>> #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(16)
>>> before #including eigen.
>>
>> Would it be possible to add a function for those people who dislike macros?
>> E.g., something like
>>
>> static void IOFormat::setDefaultFormat(const IOFormat& fmt)
>
> Unfortunately as long as Eigen will stay as a pure template lib, this
> won't be possible.
>
> gael.
>
>>
>> Jitse
>>
>>
>>
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/