On Tue, May 13, 2008 at 10:28 AM,  <[EMAIL PROTECTED]> wrote:
>
>  Greetings.  I'm brand new to Sage, and am excited to get started.
>  I've been using Maple recently, namely the 'linalg' and
>  'LinearAlgebra' packages.
>
>  Browsing the Sage Reference Manual, I don't see an analogue for these
>  packages.  For instance, I want to perform a pseudo-inverse operation
>  to solve for an overdetermined linear system.  Can I do this with
>  Sage?  If so, would you kindly point me to the right place in the
>  documentation.
>
>  Many thanks,
>  Andrew

Just use the backslash operator or "solve_right", e.g.,

sage: a = matrix(QQ, 4, 3, [1..12])
sage: a
[ 1  2  3]
[ 4  5  6]
[ 7  8  9]
[10 11 12]
sage: a.rank()
2
sage: v = matrix(QQ, 4, 1, [4,12,20,28])
sage: a \ v
[4/3]
[4/3]
[  0]
sage: b = a.transpose(); b
[ 1  4  7 10]
[ 2  5  8 11]
[ 3  6  9 12]
sage: w = matrix(QQ, 3, 1, [5,7,9])
sage: b \ w
[1]
[1]
[0]
[0]
sage: b.solve_right(w)
[1]
[1]
[0]
[0]

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to