Re: [eigen] default printing format

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


On Thu, 13 Aug 2009, Benoit Jacob wrote:

for the full precision idea, there are opinions on both sides, but i
didn't see an answer to what i think is the biggest objection: c++
stream do not show full precision by default, so there would be a
discrepancy if suddenly we made them use full precision when they're
used with matrices.

I agree with this argument. I think that, by default, matrices should be printed with the same precision as scalars.

For comparison, none of the other environments mentioned before default to full precision.

Numpy: defaults to 8 digits of precision [1]

Octave: "By default, Octave will try to print numbers with at least 5 significant figures within a field that is a maximum of 10 characters wide." [2]

Matlab: "For floating-point variables, for example, the default is format short (i.e., 5-digit scaled, fixed-point values)." [3]

[1] http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html
[2] http://www.gnu.org/software/octave/doc/interpreter/Terminal-Output.html#index-format-641
[3] http://www.mathworks.com/access/helpdesk/help/techdoc/ref/format.html


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)


Jitse



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