[eigen] cwise / array

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


Hi,

I'd like to harmonize a bit the API for coefficient-wise operations. Currently 
we have
* matrixbase.cwiseSomeMethod()
* MatrixBase::cwise(SomeFunctor)
* MatrixBase::create(SomeNullaryFunctor)
* matrixbase.array().someMethod()

I propose to do:
* rename cwise(functor) to fromUnary(functor) and fromBinary(functor)
* rename create(functor) to fromNullary(functor)
* rename array() to cwise()
* move all the cwiseSomeMethod() to cwise() so that instead of doing 
matrixbase.cwiseSomeMethod() one always does matrixbase.cwise().someMethod()
* move the Cwise (formerly Array) proxy class to the Core module, but leave 
most of the methods in Array module -- just like the MatrixBase class is in 
Core but has methods in other modules.
* it then becomes possible to use more operator notation e.g. 
matrixbase.cwiseProduct(other) becomes matrixbase.cwise() * other.

I also plan to add square() and cube() functors. square() is the same as abs2
() in the real case but has a nicer name when it's what's really meant (like 
in mandelbrot) and is different in the complex case. cube() is useful at 
least in the VDW example so it wouldn't be needed anymore to write a 12-th 
power functor, one could just do:
m.cwise().square()
 .cwise().square()
 .cwise().cube()

What do you think?

Benoit

Attachment: signature.asc
Description: This is a digitally signed message part.



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