Re: [eigen] Specializing max_coeff_visitor for some number types

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


On Mon, 7 Apr 2014, Marc Glisse wrote:

As you can see in LU, there is a subtlety I hadn't thought of: max(abs) was returning a RealScalar, not a Scalar. That's not a big problem when we only want to compare it with 0.

Note that we end up computing twice as many abs() as before, because we store the coefficient in the visitor and not the result of abs. Avoiding it would be possible, adding a new unary functor that defaults to scalar_abs_op, storing its result_type in the visitor, calling it before passing the result to better_coeff_op, and making better_coeff_op work on this new type. But that's starting to get a bit complicated for such a simple feature...

--
Marc Glisse



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