Hello.

> 
>     thanks in advance for your time and apologies if this has been raised 
> before (I searched and couldn't find it).
> 
>     I recently wrote something like
> 
> RealMatrix M = x.outerProduct(y);
> 
> and found it throwing an exception and failing one of my tests because x and 
> y were different sizes. Fair enough in one sense as this is the documented 
> behaviour but not what one expects mathematically (see e.g. 
> http://en.wikipedia.org/wiki/Outer_product).
> 
>     To deal with this I found myself writing the following (extremely ugly) 
> code:
> 
> RealMatrix M = (x.getDimension() == y.getDimension()) ?
> 
>     x.outerProduct(y) :
> 
>     (new Array2DRowRealMatrix(x.getData())).multiply(new 
> Array2DRowRealMatrix(y.getData()).transpose());
> 
>     So I have a few questions:
> 
>  *
> Can the restriction that the two vectors in RealVector.outerProduct have to 
> be the same size be removed? If so, should I enter a bug report or feature 
> request?

Yes, please.

> [...]

Thank you,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to