[eigen] [Sparse] cwise op

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

(and thank you Gael for the nice placement new tip for InnerIterator assignment !)

I'd like to know if there is an efficient way to have Sparse coeffwise operator expressions where the result of the operator on the default value (0 or false) (for one and/or for both args on binary operators).

For example, if I'd like to have a boolean sparse matrix storing which elts from sparse A are < than the corresponding element
of sparse B, I don't think that
A.binaryExpr(B, std::less<Scalar>())
will be efficient because binaryExpr() has not been given the info that it is useless to perform the call when both operands have default value.

Maybe some traits would express that the coeffwise operation has default result if arg1, arg2, arg1 & arg2 have default value ?

What do you think ?

Best regards,

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