Multiplying transposed matrices in mir

p.shkadzko p.shkadzko at gmail.com
Mon Apr 20 19:25:26 UTC 2020


On Monday, 20 April 2020 at 02:50:29 UTC, 9il wrote:
> On Monday, 20 April 2020 at 02:42:33 UTC, 9il wrote:
>> On Sunday, 19 April 2020 at 20:29:54 UTC, p.shkadzko wrote:
>>> On Sunday, 19 April 2020 at 20:06:23 UTC, jmh530 wrote:
>>>> [...]
>>>
>>> Thanks. I somehow missed the whole point of "a * 
>>> a.transposed" not working because "a.transposed" is not 
>>> allocated.
>>
>> In the same time, the SliceKind isn't matter for assignment 
>> operations:
>>
>> auto b = a.slice; // copy a to b
>> b[] *= a.transposed; // works well
>
> BTW for the following operation
>
> auto b = a * a.transposed.slice;
>
> `b` isn't allocated as well because `*` is lazy.
>
>> auto b = a.slice; // copy a to b
>> b[] *= a.transposed; // works well
>
> So, the assignment operations are preferable anyway.

Interesting, thanks for the examples.


More information about the Digitalmars-d-learn mailing list