On Feb 1, 2008 5:33 PM, VictorMiller <[EMAIL PROTECTED]> wrote:
>
> Magma has the useful functions VerticalJoin and HorizontalJoin to
> build matrices out of other matrices (numpy has similar functionality
> with concatenate).  Is there something similar for a Sage Matrix?
>

Yes.  They are called "stack" and "augment" in Sage, and they
should work with any Sage matrix types.

sage: a = random_matrix(ZZ, 2,3); b = random_matrix(ZZ, 2, 3)
sage: a.stack(b)
[-4 20 -4]
[-4 -4  3]
[-1 25 -8]
[ 1 -2  1]
sage: a.augment(b)
[-4 20 -4 -1 25 -8]
[-4 -4  3  1 -2  1]

 -- William

--~--~---------~--~----~------------~-------~--~----~
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/sage-forum
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to