axiom-developer
[Top][All Lists]

## [Axiom-developer] Re: [fricas-devel] Re: [Axiom-mail] Setting elements i

 From: Martin Rubey Subject: [Axiom-developer] Re: [fricas-devel] Re: [Axiom-mail] Setting elements in a matrix Date: 29 Feb 2008 10:39:47 +0100 User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

```Ralf Hemmecke <address@hidden> writes:

> On 02/29/2008 09:27 AM, Martin Rubey wrote:
>  > make SQMATCAT inherit from MATCAT.
>
> I am sure you don't want that.

I'm not so sure...

> We have
>
> MatrixCategory(R,Row,Col): Category == Definition where
>    R   : Ring
>    Row : FiniteLinearAggregate R
>    Col : FiniteLinearAggregate R
>
>    Definition ==> TwoDimensionalArrayCategory(R,Row,Col) with
>       ...
>       coerce: Col -> %
>       transpose: Row -> %
>       horizConcat: (%,%) -> %
>       vertConcat: (%,%) -> %
>       ...
>
> There are even more functions that allow the result to be a non-square
> matrix.

I know that.  However, MatrixCategory also contains many functions that only
make sense for square matrices.

> The better way would be to factor out a subcategory that doesn't change the
> structure of the matrix and let SquareMatrix and MatrixCategory inherit from
> that.

This is probably a good possibility, I'll look into it.  The other one is to
throw errors when dimensions do not fit, which is the current approach.  One
problem is the "categorical" definition of multiplication of rectangular
matrices - what should it's signature be?  For me, it's fine to have
multiplication in MatrixCategory...  In Aldor it might be possible to do

(M: RectangularMatrix(n, m, R)) * (N: RectangularMatrix(m, k, R)) ->
RectangularMatrix(n, k, R)

To be honest, I doubt that this would be very useful.

Martin

```