Dear all,

Francois Maltey <[EMAIL PROTECTED]> writes:

> So this code must be after the test : 
>    if R has EuclidianDomain
> I don't understand why there are 
> 
> and MATLIN  MatrixLinearAlgebraFunctions package
> and IMATLIN InnerMatrixLinearAlgebraFunctions
> and MMATLIN InnerMatrixLinearAlgebraFunctions (with other parameters)

MMATLIN is a local macro.  Don't worry about it.

MATLIN is the top-level package that calls IMATLIN (field case) and IMATQF
(quotient field case) as needed.  And now, that you ask, I understand things a
lot better.  Below is a documentation patch.  If there is no protest, I'll
commit it.

We have three categories 

RectangularMatrix, SquareMatrix and Matrix are all represented the same, the
representation being defined in Matrix.  Eg,. in RectangularMatrix you find

  Implementation ==> Matrix R add

Thus, operations common to RectangularMatrix, SquareMatrix and Matrix only have
to be defined in Matrix.  For example, in Matrix we find:

    if R has EuclideanDomain then
 
        rowEchelon  x == rowEchelon(x)$MATLIN

Meanwhile, I provided the documentation patch, see below.  The essence is:  you
should put the signatures

rowSpace: M -> List Col
columnSpace: M -> List Col

into both MATCAT and RMATCAT and its definition only in MATCAT. (all in
matcat.spad.pamphlet.)

> Indeed... Is it because MATCAT is at a higher / more mathematical level ?
> But why isn't also rowEchelon in this file ?

because it depends on the representation of the matrix. MATCAT only contains
implementations that work for any representation.

> No problem I'll go to find examples.  We can't test the equality of 2 basis,
> must I'll play with rank.

I think it would be OK to test for equality. Please finish this bit, we can do
the other one afterwards.  To get started for the second one, I think we could
define

PartiallyOrderedSet: Category == BasicType with
        <: (%, %) -> Boolean

Lattice: Category == PartiallyOrderedSet with
        meet: (%, %) -> %
        join: (%, %) -> %

ModuleBasis(n: PositiveInteger, R: EuclideanDomain): Exports == Implementation 
where

    Exports == Join(SetCategory, Lattice) with

        intersection: (%, %) -> %
        sum:          (%, %) -> %  -- a better name would be good
        0:            constant -> %
        coerce:       % -> Vector R
        subspace?:    % -> Boolean

    Implementation == add
        Rep := List Vector R
        0: % == []$Rep
        intersection(x, y) == 
            ...

        join(x, y) == intersection(x, y)

        sum(x, y) ==
            ...

        meet(x, y) == sum(x, y)

        subspace?(x, y) ==
            ...

        x < y == subspace?(x, y)


Maybe you could fill in the definitions needed here, and provide some testcases
and some documentation?

Martin

diff -c /local/scratch/fricas/src/algebra/matcat.spad.pamphlet 
/users/rubey/lib/fricas/target/i686-pc-linux/src/algebra/matcat.spad.pamphlet
*** /local/scratch/fricas/src/algebra/matcat.spad.pamphlet      2007-12-14 
15:43:08.000000000 +0100
--- 
/users/rubey/lib/fricas/target/i686-pc-linux/src/algebra/matcat.spad.pamphlet   
    2008-01-22 20:37:53.000007000 +0100
***************
*** 9,14 ****
--- 9,59 ----
  \eject
  \tableofcontents
  \eject
+ \section{Overview over constructors related to matrices}
+ 
+ We define three categories for matrices:
+ \begin{itemize}
+ \item[\spadtype{MatrixCategory}] is the category of all matrices, and
+ \item[\spadtype{RectangularMatrixCategory}] is the category of all matrices of
+   given dimension.
+ \item[\spadtype{SquareMatrixCategory}] inherits from the latter.
+ \end{itemize}
+ Implementations that are independent of a particular representation of a 
matrix
+ should be put into \spadtype{MatrixCategory}.  As we explain below, domains
+ in the other categories will automatically see this implementation.
+ 
+ Note that a domain in \spadtype{RectangularMatrixCategory} is not 
automatically
+ a domain in \spadtype{MatrixCategory}.  The precise reasons are still unclear,
+ but we note that domains in \spadtype{DirectProductCategory(n,R)}, expected as
+ parameters of \spadtype{RectangularMatrixCategory} do not satisfy
+ \spadtype{FiniteLinearAggregate R}.  Another reason is that
+ \spadtype{RectangularMatrixCategory} does not export \spadfun{*}, but I doubt
+ that it is good.  If it were, at least \spadtype{SquareMatrixCategory} should
+ inherit from \spadtype{MatrixCategory}.
+ 
+ There are essentially three domains corresponding to these categories, namely
+ \begin{itemize}
+ \item[\spadtype{Matrix}] for all matrices,
+ \item[\spadtype{RectangularMatrix}] for matrices of fixed dimension, and
+ \item[\spadtype{SquareMatrix}] for square matrices of fixed dimension.
+ \end{itemize}
+ The domain \spadtype{IMATRIX} is unused.
+ 
+ Note that all three domains share the same representation, inherited from
+ \spadtype{Matrix}.  Thus, most algorithms are only implemented for
+ \spadtype{Matrix}.  However, they are mostly defined not directly there, but
+ rather in separate packages:
+ \begin{itemize}
+ \item[\spadtype{MatrixLinearAlgebraFunctions}] is the top-level package, that
+   calls the packages below as appropriate.
+ \item[\spadtype{InnerMatrixLinearAlgebraFunctions}] contains implementations
+   that work over a \spadtype{Field}, and
+ \item[\spadtype{InnerMatrixQuotientFieldFunctions}] contains implementations
+   that work over a quotient field.
+ \end{itemize}
+ Therefore, implementation that rely on the representation of matrices used in
+ \spadtype{Matrix} should be put into these packages.  The various definitions
+ of \spadfun{determinant} are a good example to look at.
+ 
  \section{category MATCAT MatrixCategory}
  <<category MATCAT MatrixCategory>>=
  )abbrev category MATCAT MatrixCategory

Diff finished at Tue Jan 22 20:38:32


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to