On Mon, Nov 11, 2019 at 4:53 PM Ralf Hemmecke <r...@hemmecke.org> wrote: > > On 11/4/19 11:24 PM, Prof. Dr. Johannes Grabmeier privat wrote: > > Hi all, > > I have enhanved TwoDimensionalArray to include arithmetic for block > > matrices and have an operation array2 (similar to matrix for Matrix) for > > easy creation of two-dimensional array and would suggest to include this > > into the next version: > > I guess the background of this is relatively clear. FriCAS currently > forbids the creation of Matrix(Matrix Integer). > > (15) -> A := matrix([[A11, A12],[A21, A22]])$Matrix(Matrix Integer) > > Matrix(Matrix(Integer)) is not a valid type. >
Yes. Currently MatrixCategory expects R:AbelianMonoid as a parameter. But a domain that exports MatrixCategory itself is not an AbelianMonoid because MatrixCategory does not provide 0 as the unique identity (there are many possible zero matrices of different dimensions). As far as I can see MatrixCategory requires 0 only for rather technical reasons involving the initialization of the ARRAY2 representation. So in principle it should be possible to change MatrixCategory to require only R:AbelianSemiGroup and then to also export AbelianSemiGroup. This would enable constructions such as the above. > You basically suggest to get around this problem, but extending > TwoDimensionalArray. > > What application do you have in mind? > > Why I would be against this extension is that TwoDimensionaArray is a > data structure domain, i.e., no algebraic operations. > +1 I am also against this for the same reason. > Your operations should live in an "algebraic" domain. But even then I > see problems, because + and * will be partial functions (much as in > Matrix(Matrix Integer) if it were possible). > > A good motivation for your extensions would help to consider them for > FriCAS. > I have done some preliminary experiments using AbelianSemiGroup but it seems a little more difficult than I thought since apparently a few other domains are affected by the change. If there is some interest in this I could try a little harder to get this to work. Bill. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/CAC6x94TROoOn77gLXE0A5AbmszZgL3AZt0U6VyEhCH1jCSP19Q%40mail.gmail.com.