Am Montag, den 15.03.2010, 00:48 -0700 schrieb Alec Mihailovs:
> On Mar 15, 3:39 am, Alec Mihailovs <[email protected]> wrote:
> > The second problem is that something strange happens for 1x1 matrices,
> > with any dtype,
> >
> > matrix(fromfunction(lambda i,j:i-j,(1,1),dtype=int))
> >
> > []
> >
> > matrix(fromfunction(lambda i,j:i-j+3,(1,1),dtype=int))
> >
> > [0 0 0]
> > [0 0 0]
> > [0 0 0]
> 
> That seems to be a bug introduced in Sage, not in numpy,
> 
> sage: fromfunction(lambda i,j:i-j+3,(1,1),dtype=int)
> 
> array([[3]])
> 
> sage: matrix(_)
> 
> [0 0 0]
> [0 0 0]
> [0 0 0]
> 
> Alec Mihailovs
> 
Are you using an older version of Sage?  In Sage Version 4.3.3, Release
Date: 2010-02-21:

sage: fromfunction(lambda i,j:i-j+3,(1,1),dtype=int)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call
last)

/home/ecki/<ipython console> in <module>()

NameError: name 'fromfunction' is not defined


and with David Joyner's method:

sage: n=5; matrix([[10*i+j for j in range(n)] for i in range(n)])
[ 0  1  2  3  4]
[10 11 12 13 14]
[20 21 22 23 24]
[30 31 32 33 34]
[40 41 42 43 44]
sage: n=1; matrix([[10*i+j for j in range(n)] for i in range(n)])
[0]

      Eckhard
-- 
  Service für Mathematik und Simulation
  Dr. Eckhard Kosin, selbständiger Diplom-Mathematiker

  Am Nymphenbad 14
D-81245 München, Germany

  Tel.: (+49)(+89) 88 88 479
  Tel.,Fax: (+49)(+89) 835 844
  mailto:[email protected]
  http://www.mathematik-service-kosin.de

-- 
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-support
URL: http://www.sagemath.org

Reply via email to