www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Einstein summation library

reply Zenw <zero.error.no.warning gmail.com> writes:
https://code.dlang.org/packages/gged/~main

I have been working on extending the functionality of 
multidimensional arrays using mir.ndslice, and now einstein 
summation is available.

It may not be practical, but it can be described nicely, like 
below, so I will introduce this.

```D
     auto A  = iota(9.).array.gged!double(3,3);
     auto x  = iota(3.).gged!double(3);
     auto Ax = Einsum | A.ij*x.j; // [5, 14, 23]
```
Jan 16 2023
parent reply klknn <klknn.gh gmail.com> writes:
On Monday, 16 January 2023 at 10:00:53 UTC, Zenw wrote:
 https://code.dlang.org/packages/gged/~main

 I have been working on extending the functionality of 
 multidimensional arrays using mir.ndslice, and now einstein 
 summation is available.

 It may not be practical, but it can be described nicely, like 
 below, so I will introduce this.

 ```D
     auto A  = iota(9.).array.gged!double(3,3);
     auto x  = iota(3.).gged!double(3);
     auto Ax = Einsum | A.ij*x.j; // [5, 14, 23]
 ```
Very nice. Do you plan to make it ` nogc nothrow` like mir-algorithm?
Jan 18 2023
parent Zenw <zero.error.no.warning gmail.com> writes:
On Wednesday, 18 January 2023 at 21:32:50 UTC, klknn wrote:
 On Monday, 16 January 2023 at 10:00:53 UTC, Zenw wrote:
 https://code.dlang.org/packages/gged/~main

 I have been working on extending the functionality of 
 multidimensional arrays using mir.ndslice, and now einstein 
 summation is available.

 It may not be practical, but it can be described nicely, like 
 below, so I will introduce this.

 ```D
     auto A  = iota(9.).array.gged!double(3,3);
     auto x  = iota(3.).gged!double(3);
     auto Ax = Einsum | A.ij*x.j; // [5, 14, 23]
 ```
Very nice. Do you plan to make it ` nogc nothrow` like mir-algorithm?
Thank you for your comment. I studied the code of the mir-algorithm and now managed to make it nogc nothrow. :)
Feb 08 2023