On Jul 10, 2009, at 3:01 AM, Dag Sverre Seljebotn wrote:

> Robert Bradshaw wrote:
>> On Jul 9, 2009, at 3:36 AM, Robert Bradshaw wrote:
>>
>>> See http://trac.sagemath.org/sage_trac/ticket/5081 .
>>>
>>> sage: numpy.array([1, 10, 100]).dtype
>>> dtype('int64')
>>
>> Following up on this, I've also posted http://trac.sagemath.org/
>> sage_trac/ticket/6506 . This brings up an interface question, and I
>> thought I'd bring it up here. With the latest patch, we have the
>> following behavior:
>>
>> Integer -> long (if it fits), then int64 (if it fits) and object
>> otherwise
>> Real/Complex -> float64 (if it's less than 57 bits, which is the
>> cuttoff for RealNumber(repr(float(x))), and object for greater prec
>> Rational -> same as Integer for integral, float64 otherwise
>>
>> I figured this is mostly for numerical use (whenever I import numpy,
>> that's the mode I'm in), and the real advantage of numpy is when
>> using native types. If I want exact linear algebra then I'd be using
>> Sage types anyways, not numpy. Does this seem reasonable?
>
> Sounds reasonable to me.
>
> I must say I disagree rather strongly with your view of NumPy  
> though. The
> real advantage of NumPy (for certain purposes) is the semantics,  
> which is
> not focused around doing linear algebra at all. (I've written about  
> this
> at length earlier though so won't repeat myself.)

That is a good point. I should have said "whenever I use NumPy/ 
SciPy." It's probably still fair to say that the "average" (whatever  
that means) NumPy users as a whole is more concentrated around the  
numerics side of things than the "average" Sage user, but you're  
right that the power of ndarray is about its broadcasting, slicing, etc.

> BTW, thanks a lot for looking at these issues, it looks promising!  
> Come
> autumn I'll make a serious attempt at using Sage proper and report  
> back
> (or even provide a patch) if I still give it up.


Good to hear.

- Robert


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

Reply via email to