Re: [eigen] pairwise multiply

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


It can be done with:

RESULT.array() = A.array() * B.array();

If you use it a lot, you could write something like:

template <class A,class B,class RES>
inline void dotProd(const A &a,const B& b, RES &res)
{
 res.array() = a.array() * b.array();
}

dotProd(A,B,RES);

JL

On Sat, Nov 20, 2010 at 7:47 PM, Andy Somogyi <andy.somogyi@xxxxxxxxx> wrote:
> Hello Eigen guys,
>
> Would it be possible to add a pairwise matrix matrix multiply i.e. the ".*" operator in matlab to the Eigen MatrixBase class. I use this operator a lot.
>
> thanks
>



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