Re: [Numpy-discussion] inplace matrix multiplication

2009-04-28 Thread David Warde-Farley
On 28-Apr-09, at 10:56 AM, Dan Goodman wrote: > Can anyone explain the results below? It seems that for small matrices > dot(x,y) is outperforming dgemm(1,x,y,0,y,overwrite_c=1), but for > larger > matrices the latter is winning. In principle it seems like I ought > to be > able to always do b

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread David Cournapeau
Stéfan van der Walt wrote: > 2009/4/28 David Cournapeau : > >> the header file is not very reliable. More generally, I think we >> should have a way to track C API and ABI relatively to the number >> version, as well as automatically generate the related documentation. >> > > We can already

Re: [Numpy-discussion] MemoryError for computing eigen-vect or on 10,000*10, 000 matrix

2009-04-28 Thread Zhenxin Zhan
Thanks. My mistake. The os is 32-bit. I am doing a network-simulation for my teacher. The average degree of the network topology is about 6.0. So I think it is sparse. The paper needs the eigen values and the eigen vectors which are necessary for the further simulation. I use the following pro

Re: [Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

2009-04-28 Thread David Cournapeau
Zhenxin Zhan wrote: > Thanks for your reply. > My os is Windows XP SP3. I tried to use array(ojb, dtype=float), but > it didn't work. And I tried 'float32' as you told me. And here is the > error message: > File "C:\Python26\Lib\site-packages\numpy\linalg\linalg.py", line 791, > in eig > a, t, resu

Re: [Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

2009-04-28 Thread Charles R Harris
2009/4/28 Zhenxin Zhan > Thanks for your reply. > > My os is Windows XP SP3. I tried to use array(ojb, dtype=float), but it > didn't work. And I tried 'float32' as you told me. And here is the error > message: > > > File "C:\Python26\Lib\site-packages\numpy\linalg\linalg.py", line 791, in > e

Re: [Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

2009-04-28 Thread Zhenxin Zhan
Thanks for your reply. My os is Windows XP SP3. I tried to use array(ojb, dtype=float), but it didn't work. And I tried 'float32' as you told me. And here is the error message: File "C:\Python26\Lib\site-packages\numpy\linalg\linalg.py", line 791, in eig a, t, result_t = _convertarray(a) #

Re: [Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

2009-04-28 Thread David Cournapeau
Zhenxin Zhan wrote: > Hello, > > I am a new learner of Numpy. From 'numpybook', I use > numpy.linalg.eig(A) to calculate a matrix 2,000*2,000 and it works well. > > But, when I calculate eigen vector for 10,000*10,000 matrix, there is > 'MemoryError' error message in statement numpy.array(...)

[Numpy-discussion] MemoryError for computing eigen-vector on 10, 000*10, 000 matrix

2009-04-28 Thread Zhenxin Zhan
Hello, I am a new learner of Numpy. From 'numpybook', I use numpy.linalg.eig(A) to calculate a matrix 2,000*2,000 and it works well. But, when I calculate eigen vector for 10,000*10,000 matrix, there is 'MemoryError' error message in statement numpy.array(...). My laptop has 4GB memory. How

[Numpy-discussion] Arithmetic on arrays of pointers

2009-04-28 Thread Dan Goodman
Hi all, I have a slightly strange idea for something I would like to do with numpy which I guess probably doesn't exist, but I may be wrong. What I want to do, essentially, is to have two arrays of equal size, say X and Y, of pointers to doubles say. Then I want to do (in C notation) *x += *y

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Stéfan van der Walt
2009/4/29 Charles R Harris : > 1.4 should probably run under with 1.3. Or we could just bite the bullet and > make folks upgrade their numpy installations again. I don't want to bite any bullets :) I'd opt for a workaround on our side, as not to inconvenience users. Stéfan __

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
2009/4/28 Stéfan van der Walt > 2009/4/28 Charles R Harris : > >> IIRC, we can expose NPY_FEATURE_VERSION as part of the API without > >> breaking ABI compatibility, as long as we add it at the end of the API > >> functions list. As a hack, we can then check the length of the API > >> functions

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Stéfan van der Walt
2009/4/28 Charles R Harris : >> IIRC, we can expose NPY_FEATURE_VERSION as part of the API without >> breaking ABI compatibility, as long as we add it at the end of the API >> functions list.  As a hack, we can then check the length of the API >> functions list to make sure it is available before w

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
2009/4/28 Stéfan van der Walt > 2009/4/28 Charles R Harris : > > It is needed when the extension is loaded, that is why the very first > > function in the API returns it. Otherwise it is impossible to check if > > extensions compiled against one version of numpy can be loaded when > another > > v

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Stéfan van der Walt
2009/4/28 Charles R Harris : > It is needed when the extension is loaded, that is why the very first > function in the API returns it. Otherwise it is impossible to check if > extensions compiled against one version of numpy can be loaded when another > version of numpy is present. You need to know

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
2009/4/28 Stéfan van der Walt > 2009/4/28 Charles R Harris : > > 2009/4/28 Stéfan van der Walt > >> We can already do this: simply choose a convention for NPY_VERSION and > >> NPY_FEATURE_VERSION so that they are related. > > > > NPY_VERSION has been 0x0109 since 1.0. NPY_FEATURE_VERSION was

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Stéfan van der Walt
2009/4/28 Charles R Harris : > 2009/4/28 Stéfan van der Walt >> We can already do this: simply choose a convention for NPY_VERSION and >> NPY_FEATURE_VERSION so that they are related. > > NPY_VERSION has been 0x0109 since 1.0. NPY_FEATURE_VERSION was added for > 1.2, but is useless since it ca

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
2009/4/28 Stéfan van der Walt > 2009/4/28 David Cournapeau : > > the header file is not very reliable. More generally, I think we > > should have a way to track C API and ABI relatively to the number > > version, as well as automatically generate the related documentation. > > We can already do t

[Numpy-discussion] numpy.int32 -> double?

2009-04-28 Thread Bruce Sherwood
I'm not sure this is the right forum for my question; it's quite possible that this is a Boost question. VPython (vpython.org) is the name of Python plus the 3D Visual module, which is mostly written in C++ and connected to Python using the Boost libraries. Visual imports numpy. When I build Visu

Re: [Numpy-discussion] MemoryError in numpy.test() on AIXinstallation

2009-04-28 Thread Whitcomb, Mr. Tim
> > To further complicate issues, I do not have sysadmin rights on the > > machine in question, and I'm not entirely confident that > Python itself > > was built properly (I've had to sort out some other issues as well). > > The version in use is: > > Python 2.5.2 (r252:60911, Sep 17 2008, 13:24

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Stéfan van der Walt
2009/4/28 David Cournapeau : > the header file is not very reliable. More generally, I think we > should have a way to track C API and ABI relatively to the number > version, as well as automatically generate the related documentation. We can already do this: simply choose a convention for NPY_VER

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
On Tue, Apr 28, 2009 at 9:57 AM, David Cournapeau wrote: > On Wed, Apr 29, 2009 at 12:45 AM, Charles R Harris > wrote: > > > > > > On Tue, Apr 28, 2009 at 9:41 AM, David Cournapeau > > wrote: > >> > >> On Tue, Apr 28, 2009 at 11:58 PM, Travis Oliphant > >> wrote: > >> > > >> > On Apr 27, 2009,

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread David Cournapeau
On Wed, Apr 29, 2009 at 12:45 AM, Charles R Harris wrote: > > > On Tue, Apr 28, 2009 at 9:41 AM, David Cournapeau > wrote: >> >> On Tue, Apr 28, 2009 at 11:58 PM, Travis Oliphant >> wrote: >> > >> > On Apr 27, 2009, at 4:05 PM, Wes McKinney wrote: >> > >> >> Hello, >> >> >> >> I am wondering if

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Charles R Harris
On Tue, Apr 28, 2009 at 9:41 AM, David Cournapeau wrote: > On Tue, Apr 28, 2009 at 11:58 PM, Travis Oliphant > wrote: > > > > On Apr 27, 2009, at 4:05 PM, Wes McKinney wrote: > > > >> Hello, > >> > >> I am wondering if anyone can offer some suggestions on this problem. > >> Over the last year or

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread David Cournapeau
On Tue, Apr 28, 2009 at 11:58 PM, Travis Oliphant wrote: > > On Apr 27, 2009, at 4:05 PM, Wes McKinney wrote: > >> Hello, >> >> I am wondering if anyone can offer some suggestions on this problem. >> Over the last year or so I have been building a number of libraries >> on top of NumPy + SciPy + m

Re: [Numpy-discussion] inplace matrix multiplication

2009-04-28 Thread Dan Goodman
Can anyone explain the results below? It seems that for small matrices dot(x,y) is outperforming dgemm(1,x,y,0,y,overwrite_c=1), but for larger matrices the latter is winning. In principle it seems like I ought to be able to always do better with inplace rather than making copies? From looking

Re: [Numpy-discussion] [SciPy-user] Managing Python with NumPy and many external libraries on multiple Windows machines

2009-04-28 Thread Travis Oliphant
On Apr 27, 2009, at 4:05 PM, Wes McKinney wrote: > Hello, > > I am wondering if anyone can offer some suggestions on this problem. > Over the last year or so I have been building a number of libraries > on top of NumPy + SciPy + matplotlib and other libraries which are > being used for inve

Re: [Numpy-discussion] Creating a RGB-image from BW

2009-04-28 Thread Zachary Pincus
Hi Johannes, According to http://www.pygtk.org/pygtk2reference/class- gdkpixbuf.html , the pixels_array is a numeric python array (a predecessor to numpy). The upshot is that perhaps the nice broadcasting machinery will work fine: pb_pixels[...] = fits_pixels[..., numpy.newaxis] This might