Re: [eigen] pairwise multiply

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


to be more precise, you can:

1 - use Array from the beginning (in case you are not interested in
the linear algebra world):

a3 = a1 * a2;

2 - use the cwiseProduct() method:

m3 = m1.cwiseProduct(m2);

3 - use the .array() modifier:

m3 = m1.array() * m2.array();


gael

On Sat, Nov 20, 2010 at 8:36 PM, Jose Luis Blanco
<joseluisblancoc@xxxxxxxxx> wrote:
> 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/