[sage-devel] Re: trouble running n() on matrices

2008-04-08 Thread David Harvey
On Apr 9, 2008, at 12:24 AM, Robert Bradshaw wrote: >> >> Could this be a bit more general? There are other things one wants >> to do that are similar, such as matrix.real() and matrix.imag(), or >> matrix.abs() for real, imaginary, and absolute values of the entries >> respectively. It sounds

[sage-devel] Re: trouble running n() on matrices

2008-04-08 Thread Robert Bradshaw
On Apr 8, 2008, at 11:24 AM, Nick Alexander wrote: > > On 8-Apr-08, at 10:50 AM, David Roe wrote: > >> >> If you take a look at the source code for n(), you'll see that the >> first thing that it does is to try calling numerical_approx(prec) on >> the object, and then tries coercing to real or com

[sage-devel] Re: trouble running n() on matrices

2008-04-08 Thread Nick Alexander
On 8-Apr-08, at 10:50 AM, David Roe wrote: > > If you take a look at the source code for n(), you'll see that the > first thing that it does is to try calling numerical_approx(prec) on > the object, and then tries coercing to real or complex fields. So the > solution is to write a method numeric

[sage-devel] Re: trouble running n() on matrices

2008-04-08 Thread David Roe
If you take a look at the source code for n(), you'll see that the first thing that it does is to try calling numerical_approx(prec) on the object, and then tries coercing to real or complex fields. So the solution is to write a method numerical_approx(prec) in the matrix base class that tries to