Multiplying transposed matrices in mir

p.shkadzko p.shkadzko at gmail.com
Mon Apr 20 19:06:53 UTC 2020


On Sunday, 19 April 2020 at 21:27:43 UTC, jmh530 wrote:
> On Sunday, 19 April 2020 at 20:29:54 UTC, p.shkadzko wrote:
>> [snip]
>>
>> Thanks. I somehow missed the whole point of "a * a.transposed" 
>> not working because "a.transposed" is not allocated.
>
> a.transposed is just a view of the original matrix. Even when I 
> tried to do a raw for loop I ran into issues because modifying 
> the original a in any way caused all the calculations to be 
> wrong.
>
> Honestly, it's kind of rare that I would do an element-wise 
> multiplication of a matrix and its transpose.

It is. I was trying to calculate the covariance matrix of some 
dataset X which would be XX^T.


More information about the Digitalmars-d-learn mailing list