I'd like to present a simple package for matrix
manipulation. It implements mostly slicing,
splitting and stacking of (dense) matrices
in various flavors.

These operations are very common in numerical
software packages (Octave, Numpy etc) but are
always useful when working with matrices, also
in the more symbolic context. For example in
reasoning about some matrix based algorithms.

The package can be found here:

http://github.com/raoulb/fricas_code/tree/master/mama

The main code is in this file:

http://github.com/raoulb/fricas_code/blob/master/mama/MAMA.spad

and there are some tests and examples in:

http://github.com/raoulb/fricas_code/blob/master/mama/mama.input

I attached the files for convenience.


The package still has some open issues, for details
please see the comments in the code.


While implementing, I found that

  expand(Segment PI) ---> List INT

What is the reason behind this? Shouldn't it
rather be List PI? Sure, every PI is an INT
but we loose information here by not keeping
the domain tight.

Is this the reason why rows(A:M, si:SPI)
and columns(A:M, si:SPI) do not compile
while bandMatrix(A:M, si:SI) works?
(If not, what is the reason then?)

Another question I have is about the
function blockSplit(A:M, nr:PI, nc:PI).
What exactly am I missing when implementing
it like:

 map((X:M):(List M) +-> horizSplit(X, nc), vertSplit(A, nr))

I need to bind the second argument and do
a partial evaluation before calling map ...


And one more question. Can you please give me
a hint how to improve the line #147 (and #165):

  transpose(row(A pretend Matrix(R), r)::Matrix(R)) pretend M


BTW: Do we have a cumulative sum function in Fricas?
The cumSum([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) should
give me [0,  1,  3,  6, 10, 15, 21, 28, 36, 45].
If not, do we want one?

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Attachment: mama.input
Description: Binary data

Attachment: MAMA.spad
Description: Binary data

Reply via email to