EMS-TU-Ilmenau / fastmat

A library to build up lazily evaluated expressions of linear transforms for efficient scientific computing.
https://fastmat.readthedocs.io
Apache License 2.0
24 stars 8 forks source link

Multidimensional Transforms #7

Closed SebastianSemper closed 5 years ago

SebastianSemper commented 7 years ago

ChristophWWagner proposed:

As we now have multiple multi-level classes (Kron, MLCirculant) and soon have some more (MLToeplitz) we could also use some helpers for folding / unfolding multi-dimensional data structures. Architecture-wise we could introduce a Superclass for all multi-level classes which provides an additional multi-level interface to its ancestors (and only to them). I was thinking of a structure like:

class MultiLevel(Matrix):
    def __init__():
        raise RuntimeError("Direct Instantiation of MultiLevel class is not allowed.")

    def multiLevelForward(...):
        ...
    def multiLevelBackward(...):
        ...

# [another file]
class Kron(MultiLevel):
    ...

# [another file]
class MLCirculant(MultiLevel):
    ....

The interface could not only add multi-dimensional interfaces to forward / backward but also multidimensional element access, slicing, ...

Any comments on that?

ChristophWWagner commented 6 years ago

I think this is a good idea. However testing this can get very ugly, very quickly. Isn't it also a close step from there to an actual "Tensor-Interface"?

SebastianSemper commented 5 years ago

I think we have decided to take the other way around and integrate the single dimensional transforms as special cases of generally multidimensional ones. Closing