[Numpy-discussion] Numpy + SWIG

2012-06-04 Thread Gideon Simpson
There are two types of swig problems that I was hoping to get some help with. 
First, suppose I have some C function

void f(double *x, int nx, double *y, int ny);

where we input one array, and we output another array, both of which should be 
the same size.

I have used in my .i file:
%apply(double *IN_ARRAY1, int DIM1){(double *x, int nx)}
%apply(double *ARGOUT_ARRAY1, int DIM1){(double *y, int ny)}

and this produces a workable function.  However, it expects, as the functions 
second argument, the length of the array x. Now, it's easy enough to call:
module.f(x, x.shape[0])

but is there a way to automatically get it to use the length of the array?

The second problem I have is for a function of the fomr

void g(double *x, int nx, double *y, int ny, double *z, int nz);

which evaluates some function g at all (x,y) pairs.  The the thing is that nx 
and ny need not be the same size, but nz should be nx * ny.  I'd like to wrap 
this too, and ideally it would also automatically handle the array lengths, but 
I'd be happy to have anything right now.  I'm also quite comfortable with the 
idea of packing z as a column array and reshaping it as necessary. 


-gideon

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Normalization of ifft

2009-03-26 Thread Gideon Simpson
I thought it was the same as the MATLAB format:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/fft.htmlhttp://www.google.com/search
 
?client=safarirls=en-usq=MATLAB+fftie=UTF-8oe=UTF-8

On Mar 26, 2009, at 7:56 PM, Lutz Maibaum wrote:

 Hello,

 I just started to use python and numpy for some numerical analysis. I
 have a question about the definition of the inverse Fourier transform.
 The user gives the formula (p.180)

  x[m] = Sum_k X[k] exp(j 2pi k m / n)

 where X[k] are the Fourier coefficients, and n is the length of the  
 arrays.

 The online documentation
 (http://docs.scipy.org/doc/numpy/reference/routines.fft.html), on the
 other hand, states that there is an additional factor of 1/n, which is
 required to make ifft() the inverse of fft(). Is this a misprint in
 the user guide?

  Lutz
 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Floating point question

2009-03-02 Thread Gideon Simpson
I recently discovered that for 8 byte floating point numbers, my  
fortran compilers (gfortran 4.2 and ifort 11.0) on an OS X core 2 duo  
machine believe the  smallest number 2.220507...E-308.  I presume that  
my C compilers have similar results.

I then discovered that the smallest floating point number in python  
2.5 is 4.9065...E-324.  I have been using numpy to generate data,  
saving it with savetxt, and then reading it in as ASCII into my  
fortran code.  Recently, it crapped out on something because it didn't  
like reading it a number that small, though it is apparently perfectly  
acceptable to python.

My two questions are:

1.  What is the best way to handle this?  Is it just to add a filter  
of the form

u = u * ( np.abs(u)  2.3 e-308)

2.  What gives?  What's the origin of this (perceived) inconsistency  
in floating points across languages within the same platform?

I recognize that this isn't specific to Scipy/Numpy, but thought  
someone here might have the answer.

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Floating point question

2009-03-02 Thread Gideon Simpson
On Mar 2, 2009, at 4:00 PM, Michael S. Gilbert wrote:


 how are you calculating fmin?  numpy has a built-in function that
 will tell you this information:

 numpy.finfo( numpy.float ).min
 -1.7976931348623157e+308

 hopefully this helps shed some light on your questions.

 regards,
 mike


When I first discovered this, I was computing:

numpy.exp(-x**2)

If you try x = 26.7, you'll get
2.4877503498797906e-310

I then confirmed this by dividing 1. by 2. until python decided the  
answer was 0.0

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] loadtxt slow

2009-03-01 Thread Gideon Simpson
So I have some data sets of about 16 floating point numbers stored  
in text files.  I find that loadtxt is rather slow.  Is this to be  
expected?  Would it be faster if it were loading binary data?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] casting integers to reals

2009-02-26 Thread Gideon Simpson
I want to do:

numpy.float(numpy.arange(0, 10))

but get the error:

Traceback (most recent call last):
   File stdin, line 1, in module
TypeError: only length-1 arrays can be converted to Python scalars

How should I do this?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] convolution axis

2009-01-29 Thread Gideon Simpson
The first option doesn't accept complex data.
-gideon

On Jan 29, 2009, at 1:18 AM, Nadav Horesh wrote:

 There are at least two options:
 1. use convolve1d from numpy.numarray.nd_image (or scipy.ndimage)
 2. use scipy.signal.convolve and adjust the dimensions of the  
 convolution kenel to align it along the desired axis.

  Nadav


 -הודעה מקורית-
 מאת: numpy-discussion-boun...@scipy.org בשם Gideon Simpson
 נשלח: ה 29-ינואר-09 06:59
 אל: Discussion of Numerical Python
 נושא: [Numpy-discussion] convolution axis

 Is there an easy way to perform convolutions along a particular axis
 of an array?

 -gideon

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

 winmail.dat___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] convolution axis

2009-01-28 Thread Gideon Simpson
Is there an easy way to perform convolutions along a particular axis  
of an array?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] glibc error

2009-01-25 Thread Gideon Simpson
Rebuilding the library against ATLAS 3.8.2 with lapack 3.1.1 seems to  
have done the trick.  I do get one failure:

==
FAIL: test_umath.TestComplexFunctions.test_against_cmath
--
Traceback (most recent call last):
   File /usr/local/nonsystem/simpson/lib/python2.5/site-packages/nose/ 
case.py, line 182, in runTest
 self.test(*self.arg)
   File /usr/local/nonsystem/simpson/lib/python2.5/site-packages/ 
numpy/core/tests/test_umath.py, line 268, in test_against_cmath
 assert abs(a - b)  atol, %s %s: %s; cmath: %s%(fname,p,a,b)
AssertionError: arcsinh -2j: (-1.31695789692-1.57079632679j); cmath:  
(1.31695789692-1.57079632679j)

--


-gideon

On Jan 25, 2009, at 5:46 AM, Michael Abshoff wrote:

 David Cournapeau wrote:
 Hoyt Koepke wrote:

 SNIP

 Actually, I would advise using only 3.8.2. Previous versions had bugs
 for some core routines used by numpy (at least 3.8.0 did). I am a bit
 surprised that a 64 bits-built atlas would be runnable at all in a 32
 bits binary - I would expect the link phase to fail if two different
 object formats are linked together.

 Linking 32 and 64 bit ELF objects together in an extension will fail  
 on
 any system but OSX where the ld will happily link together anything.
 Since that linker also does missing symbol lookup at runtime you will
 see some surprising distutils bugs when you thought that the build  
 went
 perfectly, i.e. scipy 0.6 would not use the fortran compiler I would
 tell it to use, but one extension would use gfortran instead of
 sage_fortran when it was available in $PATH. sage_fortran would would
 just inject an -m64 into the options and call gfortran. But with a  
 few
 fortran objects being 32 bit some extensions in scipy would fail to
 import and it took me quite a while to track this one down. I haven't
 had time to test 0.7rc2 yet, but hopefully will do so in the next  
 day or
 two.

 cheers,

 David

 Cheers,

 Michael

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion


 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] numpy and the ACML

2009-01-24 Thread Gideon Simpson
Does anyone have a guide on how to get numpy to use the ACML as its  
blas/lapack backend?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy and the ACML

2009-01-24 Thread Gideon Simpson
Nadav-

That doesn't quite seem to work for me.  I added:

[blas_opt]
library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/lib
include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/include
libraries = acml

[lapack_opt]
library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/lib
include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/include
libraries = acml

to my site.cfg with no luck.  Somewhere else, people indicated that  
the ACML lacked a CBLAS which was necessary to make this work.
-gideon

On Jan 24, 2009, at 3:08 PM, Nadav Horesh wrote:

 You have setup.cfg:
 * set add the directory where acml libraries reside to the library  
 dir path list
 * add acmllibraries under blas and lapack sections

  Nadav


 -הודעה מקורית-
 מאת: numpy-discussion-boun...@scipy.org בשם Gideon Simpson
 נשלח: ש 24-ינואר-09 18:21
 אל: Discussion of Numerical Python
 נושא: [Numpy-discussion] numpy and the ACML

 Does anyone have a guide on how to get numpy to use the ACML as its
 blas/lapack backend?

 -gideon

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

 winmail.dat___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy and the ACML

2009-01-24 Thread Gideon Simpson
I've tried building CBLAS, which seems to run properly by itself, but  
numpy is still having difficulty.  I've got the following in my  
site.cfg:

[blas_opt]
library_dirs = /usr/local/nonsystem/simpson/CBLAS/lib/LINUX:/usr/local/ 
nonsystem/simpson/acml4.2.0/gfortran64/lib
include_dirs = /usr/local/nonsystem/simpson/CBLAS/include:/usr/local/ 
nonsystem/simpson/acml4.2.0/gfortran64/include
libraries = cblas, acml

[lapack_opt]
library_dirs = /usr/local/nonsystem/simpson/CBLAS/lib/LINUX:/usr/local/ 
nonsystem/simpson/acml4.2.0/gfortran64/lib
include_dirs = /usr/local/nonsystem/simpson/CBLAS/include:/usr/local/ 
nonsystem/simpson/acml4.2.0/gfortran64/include
libraries = cblas, acml

I also created a symbolic link in /usr/local/nonsystem/simpson/CBLAS/ 
lib/LINUX, from cblas_LINUX.a to libcblas.a.


Is there an easier way to check if numpy is locating the libs other  
than doing python setup.py build, and looking at the output?
-gideon

On Jan 24, 2009, at 4:05 PM, Pauli Virtanen wrote:

 Sat, 24 Jan 2009 15:26:17 -0500, Gideon Simpson wrote:

 Nadav-

 That doesn't quite seem to work for me.  I added:

 [blas_opt]
 library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/lib
 include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/ 
 include
 libraries = acml

 [lapack_opt]
 library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/lib
 include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/ 
 include
 libraries = acml

 to my site.cfg with no luck.  Somewhere else, people indicated that  
 the
 ACML lacked a CBLAS which was necessary to make this work.

 Yep, IIRC you needed also CBLAS. (I think I got Numpy  Scipy linked
 against ACML at some point, but it's been a while and I've forgotten
 details...) There's a CBLAS here:

   http://www.netlib.org/blas/blast-forum/cblas.tgz

 So, I think you need to compile it  link it with ACML, and add it in
 site.cfg with ACML libs.

 -- 
 Pauli Virtanen

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy and the ACML

2009-01-24 Thread Gideon Simpson
That's not working for me.  Any thoughts on how to troubleshoot it?
-gideon

On Jan 24, 2009, at 6:18 PM, George Nurser wrote:

 I did manage to get it working.
 I remember that both libcblas.a (or a link to it) and libacml.so had
 to be in the same directory.

 Also I had to comment out lines 399-400 of setup.py:
 # if ('NO_ATLAS_INFO',1) in  
 blas_info.get('define_macros',[]):
 # return None # dotblas needs ATLAS, Fortran compiled
 blas will not be sufficient

 In my site.cfg I have
 [blas]
 blas_libs = cblas, acml
 library_dirs = /noc/users/agn/ext/AMD64/acml/ifort64/lib
 include_dirs =  /noc/users/agn/ext/AMD64/acml/ifort64/include

 [lapack]
 language = f77
 lapack_libs = acml
 library_dirs = /noc/users/agn/ext/AMD64/acml/ifort64/lib
 include_dirs = /noc/users/agn/ext/AMD64/acml/ifort64/include

 Both libcblas.a (or a link to it) and libacml.so  are in
 /noc/users/agn/ext/AMD64/acml/ifort64/lib

 HTH. George.

 2009/1/24 Gideon Simpson simp...@math.toronto.edu:
 I've tried building CBLAS, which seems to run properly by itself, but
 numpy is still having difficulty.  I've got the following in my
 site.cfg:

 [blas_opt]
 library_dirs = /usr/local/nonsystem/simpson/CBLAS/lib/LINUX:/usr/ 
 local/
 nonsystem/simpson/acml4.2.0/gfortran64/lib
 include_dirs = /usr/local/nonsystem/simpson/CBLAS/include:/usr/local/
 nonsystem/simpson/acml4.2.0/gfortran64/include
 libraries = cblas, acml

 [lapack_opt]
 library_dirs = /usr/local/nonsystem/simpson/CBLAS/lib/LINUX:/usr/ 
 local/
 nonsystem/simpson/acml4.2.0/gfortran64/lib
 include_dirs = /usr/local/nonsystem/simpson/CBLAS/include:/usr/local/
 nonsystem/simpson/acml4.2.0/gfortran64/include
 libraries = cblas, acml

 I also created a symbolic link in /usr/local/nonsystem/simpson/CBLAS/
 lib/LINUX, from cblas_LINUX.a to libcblas.a.


 Is there an easier way to check if numpy is locating the libs other
 than doing python setup.py build, and looking at the output?
 -gideon

 On Jan 24, 2009, at 4:05 PM, Pauli Virtanen wrote:

 Sat, 24 Jan 2009 15:26:17 -0500, Gideon Simpson wrote:

 Nadav-

 That doesn't quite seem to work for me.  I added:

 [blas_opt]
 library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/ 
 lib
 include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/
 include
 libraries = acml

 [lapack_opt]
 library_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/ 
 lib
 include_dirs = /usr/local/nonsystem/simpson/acml4.2.0/gfortran64/
 include
 libraries = acml

 to my site.cfg with no luck.  Somewhere else, people indicated that
 the
 ACML lacked a CBLAS which was necessary to make this work.

 Yep, IIRC you needed also CBLAS. (I think I got Numpy  Scipy linked
 against ACML at some point, but it's been a while and I've forgotten
 details...) There's a CBLAS here:

  http://www.netlib.org/blas/blast-forum/cblas.tgz

 So, I think you need to compile it  link it with ACML, and add it  
 in
 site.cfg with ACML libs.

 --
 Pauli Virtanen

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] glibc error

2009-01-24 Thread Gideon Simpson
Having built an up to date lapack and ATLAS against gcc 4.3.2, I tried  
installing numpy 1.2.1 on Python 2.5.4.  When testing I get:

Python 2.5.4 (r254:67916, Jan 24 2009, 00:27:20)
[GCC 4.3.2] on linux2
Type help, copyright, credits or license for more information.
  import numpy
  numpy.test()
Running unit tests for numpy
NumPy version 1.2.1
NumPy is installed in /usr/local/nonsystem/simpson/lib/python2.5/site- 
packages/numpy
Python version 2.5.4 (r254:67916, Jan 24 2009, 00:27:20) [GCC 4.3.2]
nose version 0.10.4
..F
 
K 
 
 
***
 glibc 
  detected *** python: free(): invalid next size (fast):  
0x1196b550 ***


I then have to kill python to get control again.
-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] glibc error

2009-01-24 Thread Gideon Simpson
Rerunning the tests with verbosity, it dies at:

test_single (test_linalg.TestSolve) ... ok
Ticket #652 ... *** glibc detected *** python: free(): invalid next  
size (fast): 0x01e284e0 ***

I'm using ATLAS 3.8.2 and lapack 3.2.  ATLAS and lapack were all built  
with the -m64 flag.
-gideon

On Jan 24, 2009, at 11:37 PM, David Cournapeau wrote:

 Gideon Simpson wrote:
 Having built an up to date lapack and ATLAS against gcc 4.3.2, I  
 tried
 installing numpy 1.2.1 on Python 2.5.4.  When testing I get:

 Python 2.5.4 (r254:67916, Jan 24 2009, 00:27:20)
 [GCC 4.3.2] on linux2
 Type help, copyright, credits or license for more  
 information.
 import numpy
 numpy.test()
 Running unit tests for numpy
 NumPy version 1.2.1
 NumPy is installed in /usr/local/nonsystem/simpson/lib/python2.5/ 
 site-
 packages/numpy
 Python version 2.5.4 (r254:67916, Jan 24 2009, 00:27:20) [GCC 4.3.2]
 nose version 0.10.4
 ..F
 K
 
 
 ***
  glibc
  detected *** python: free(): invalid next size (fast):
 0x1196b550 ***


 Can you rerun the test verbosely ?

 python -c import numpy; numpy.test(verbose=10)

 This glibc message is generally a symptom of serious memory  
 corruption -
 which is why only the OS can stop it at that point.

 cheers,

 David

 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] failure

2009-01-21 Thread Gideon Simpson
Installing on a Sun machine with Red Hat linux, I got the following  
error:

==
FAIL: test_umath.TestComplexFunctions.test_against_cmath
--
Traceback (most recent call last):
   File /usr/local/nonsystem/simpson/lib/python2.5/site-packages/nose/ 
case.py, line 182, in runTest
 self.test(*self.arg)
   File /usr/local/nonsystem/simpson/lib/python2.5/site-packages/ 
numpy/core/tests/test_umath.py, line 268, in test_against_cmath
 assert abs(a - b)  atol, %s %s: %s; cmath: %s%(fname,p,a,b)
AssertionError: arcsinh -2j: (-1.31695789692-1.57079632679j); cmath:  
(1.31695789692-1.57079632679j)

--
Ran 1740 tests in 9.839s

FAILED (KNOWNFAIL=1, failures=1)
nose.result.TextTestResult run=1740 errors=0 failures=1

How would you recommend I troubleshoot this?  How seriously should I  
take it?

This is with a fresh Python 2.5.4 installation too.

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] efficient usage of tensordot

2009-01-17 Thread Gideon Simpson
This is related to a question I posted earlier.

Suppose I have array A with dimensions n x m x l and array x with  
dimensions m x l.  Interpret this as an array of l nxm matrices and  
and array of l m dimensional vectors.  I wish to compute the matrix- 
vector product A[:,:,k] x[:,k] for each k = 0,... l -1.  I discovered  
that I could accomplish this with the command

np.diagonal(np.tensordot(A, k, axes=(1,0)), axis1= 1, axis2 = 2)

The tensordot command gives me

A_{ijk}x_{jl} = C_{ikl}

And the diagonal command grabs the entries in array C where k=l.

Is this the optimal way to make this calculation in numpy?  It  
certainly makes for nice, clean code, but is it the fastest I can get?


-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] tensor contractions

2009-01-16 Thread Gideon Simpson
Suppose I have a 3d array, A, with dimensions 2 x 2 x N, and a 2d  2 x  
N array, u.  I interpret A as N 2x2 matrices and u as N 2d vectors.   
Suppose I want to apply the mth matrix to the mth vector, i.e.

A[, , m] u[, m] = v[, m]

Aside from doing
A[0,0,:] u[0,:]  + A[0,1,:] u[1,:] = v[0,:]
and
A[1,0,:] u[0,:]  + A[1,1,:] u[1,:] = v[1,:]
is there a smart way to perform this computation?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] os x, intel compilers mkl, and fink python

2008-11-28 Thread Gideon Simpson
Has anyone gotten the combination of OS X with a fink python  
distribution to successfully build numpy/scipy with the intel  
compilers and the mkl?  If so, how'd you do it?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] MATLAB ASCII format

2008-11-21 Thread Gideon Simpson
Is there (or should there be) a routine for reading and writing numpy  
arrays and matrices in MATLAB ASCII m-file format?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] fink python26 and numpy 1.2.1

2008-11-03 Thread Gideon Simpson
The fink guys fixed a bug so it now at least builds properly with  
python 2.6.
-gideon

On Nov 3, 2008, at 1:35 AM, David Cournapeau wrote:

 Michael Abshoff wrote:

 Unfortunately numpy 1.2.x does not support Python 2.6. IIRC support  
 is
 planned for numpy 1.3.


 Also it is true it is not supported, it should at least build on  
 most if
 not all platforms where numpy used to run under python 2.5.

 Not finding -lpython2.6 is more likely a bug/installation problem from
 fink (unless you are ready to deal with multiple version problems of
 python, I would advice against using fink: it makes it difficult to be
 sure there are no conflict between system python, fink python and
 python.org python. It is not impossible, of course, but that  
 complicates
 matters a lot in my own experience).

 cheers,

 David
 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] fink python26 and numpy 1.2.1

2008-11-02 Thread Gideon Simpson
Not sure if this is an issue with numpy or an issue with fink python  
2.6, but when trying to build numpy, I get the following error:

gcc -L/sw/lib -bundle /sw/lib/python2.6/config -lpython2.6 build/ 
temp.macosx-10.5-i386-2.6/numpy/core/src/multiarraymodule.o -o build/ 
lib.macosx-10.5-i386-2.6/numpy/core/multiarray.so
ld: library not found for -lpython2.6
collect2: ld returned 1 exit status
ld: library not found for -lpython2.6
collect2: ld returned 1 exit status
error: Command gcc -L/sw/lib -bundle /sw/lib/python2.6/config - 
lpython2.6 build/temp.macosx-10.5-i386-2.6/numpy/core/src/ 
multiarraymodule.o -o build/lib.macosx-10.5-i386-2.6/numpy/core/ 
multiarray.so failed with exit status 1


-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] fast matrix vector operations

2008-10-04 Thread Gideon Simpson
Suppose I have a toeplitz matrix, A.  There is a well known algorithm  
for computing the matrix vector product Ax, in NlogN operations.  An  
exact reference escapes me, but it may be in Golub  van Loan's book.

My question is, how could I best take advantage of this algorithm  
within numpy/scipy?

I could code it python.  However, since python is a high level  
language, it's not clear to me that I'd see an execution time benefit  
over numpy.dot(A,x).  Alternatively, I could write it in a compiled  
language and build python bindings to it.

Thoughts?

-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] exponentiation q.

2008-07-25 Thread Gideon Simpson
How does python (or numpy/scipy) do exponentiation?  If I do x**p,  
where p is some positive integer, will it compute x*x*...*x (p times),  
or will it use logarithms?
-gideon

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion