Dear all,

> I'd like to clean up the matrix world.  
> It's a great idea... I often use matrix !

I'm an axiom end-user and I take note theses awkward syntaxe.

// A // about coerce.

coerce are right between 
  List R          <-> Vector R 
  List List R     <-> Matrix R

mathematics often transforms a vector in a matrix 
    I can use matrix [vector [11,22]]          for a one line matrix
and           (vector [11,22])::Matrix Integer for a one column matrix
but I can't   [vector [11,22]]::Matrix Integer for a ome line matrix 

The coerce functions are the soul of axiom.
Is there a disadvantage to add 
coerce from/to List Vector R  and Matrix R  in matcat ? 

Is the interpreter able to find the coerce way ? 
  List Vector R -> List List R -> Matrix R 
for the command [vector [11,22]]::Matrix Integer 

So theses 4 others coerces will become usual :
Vector Vector R <-> Matrix R and Vector List R   <-> Matrix R

Then the listOfLists function form Matrix R to List List R may be take off.
This function is not often used in *.spad files.

There is a  transpose : Vector R -> Matrix R
but I can't use it. I get an error.

// B // about the matrix function.

If we don't use coerce, 
then matrix is the main function in order to create matrix.
It's also possible to create matrix with diagonalMatrix and scalarMatrix.

In order to minimize the number of functions it's easier to have only
one function with a a parameter.

matrix (n, c, "scalar")         might be scalarMatrix (c, n)
matrix ([11,22,33], "diagonal") might be diagonalMatrix ([11,22,33])
matrix ([M1,M2,M3], "diagonal") might be diagonalMatrix ([M1,M2,M3])

Mupad has also banded matrix 
matrix (n, [-1,2,1], "banded") might build this three lines square matrix.

)show Matrix Float displays the function  diagonalMatrix:Vector Integer -> %
but I can't see the code with this signature in matcat.spad.

// C // extract and modify matrix.

The multiple elt functions are nice. 
 elt : (Matrix R,Integer,Integer) -> R
 elt : (Matrix R,List Integer,List Integer) -> R
Why don't remplace the submatrix / setsubmatrix! functions by a elt command.

If expand from Segment Integer 12..33 to List Integer become a coerce
function submatrix (M, i1, i2, j1, j2) becomes M.(i1..i2, j1..j2).

The question is the same : is the interpreter able to convert
M.(5..8, [1,3,4]) to M.([5,6,7,8],[1,3,4]) ?

The use of elt may allow M.i to extract a row of M.
So M.i.j and M.(i,j) are equivalent.

The changes may be the same about setelt.

I hope that some of theses ideas may be useful.

Francois

-------------------------------------------------------------------------
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