Closed timotheecour closed 6 years ago
Furthermore, we need new hight level wrapper with global context.
is operator overloading too magical?
a*b
as in matlab
downside: could be hard to search
alternative that's more searchable and extensible:
glas!"*"(a,b) // matrix multiplication
glas!".*"(a,b) //elementwise multiplication (or division, etc)
glas!"\"(a,b) // same as a\b in matlab (linear solver)
// for addition: "+" or ".+" ?
is operator overloading too magical?
Yep, because they should be a part of Slice
struct.
alternative that's more searchable:
glas!""(a,b) // matrix multiplication glas!"."(a,b) //elementwise multiplication (or division, etc)
Looks good
also: as in matlab, could automatically dispatch the best algorithm depending on arguments, except at compile time instead of runtime:
works with sparse/full a or b, (a or be matrix or vector of compatible dimensions), can exploit hermitian symmetry or other properties known at compile time (cf https://github.com/libmir/mir/issues/329 specifying symmetricFromUpper)
glas!"*"(a,b)
@9il I like glas!"*"
as a starting place, but I think operator overloading for the most common matrix operations is a positive. Many other packages (Armadillo) do this. It makes heavily numerical code much prettier. For instance, compare glas!"*"(glas!"*"(P, sigma), P.transposed)
with P*sigma*P'
. And it eases the transition for people coming from other languages.
@jmh530 I am not against it. But it should be build on top of ndslice and glas.
@9il Ah, okay then.
no plan to add the package into the main Mir repo Maybe related to the Lubeck package.