Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Good stuff. I noticed that the Launchpad page says: I decided not to support dynamic linking against 3rd party dll. Because of intrinsics windows limitations, it is impossible to do it in a reliable way without putting too much burden on the maintainer. I might note that I had problems with NumPy and other C code crashing randomly when statically linked against MKL 9.1 on Win32 (probably when using multiple cores). Dynamically linking fixed the problem. I haven't tested with MKL 10 yet. If you use an installed ATLAS/MKL/... library, I don't know where is the problem wit linking with them :| Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Albert Strasheim wrote: Good stuff. I noticed that the Launchpad page says: I decided not to support dynamic linking against 3rd party dll. Because of intrinsics windows limitations, it is impossible to do it in a reliable way without putting too much burden on the maintainer. I might note that I had problems with NumPy and other C code crashing randomly when statically linked against MKL 9.1 on Win32 (probably when using multiple cores). Dynamically linking fixed the problem. I haven't tested with MKL 10 yet. Yes, it is a problem, at least it is advertised as such on mkl release notes (static vs dll). I could use PATH and get away with it, but I am reluctant to do that, because it is really fragile. If I could be sure that nobody would complain about it when it does not work, then I would do it in a minute (codewise, it is trivial; actually, the development version of numscons does it, because it is useful for debugging). But by experience with all my other packages, windows installation is always what get me the most emails, because windows is more fragile, and its users less aware of technical issues. I am okay spending time on code, much less spending time on a platform which I do not use, on a project which I am working for free. So it really boils down to either someone pays me to do it, or someone tells me how to do it reliably (I would of course do something which works reliably, if anyone can explain to me how to). cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
2008/2/19, David Cournapeau [EMAIL PROTECTED]: Matthieu Brucher wrote: If you use an installed ATLAS/MKL/... library, I don't know where is the problem wit linking with them :| Atlas is not a problem, because if you know how to build a dll for ATLAS, you know how to handle environment variable problems. It is not a purely technical problem, but a combination of both cultural and technical. I know that if I tell you, Matthieu, to put you library path in your path, you won't tell me it does not work if the PATH is changed or something similar. But that's not how most windows users work in my experience. Now that you provide an installer for Atlas, it may become the same problem as MKL, can't it ? As for the problem: if you use PATH for dll, you need: - to use PATH inside scons, that is polluting the build environment with a variable you cannot control at all. - to add the path of the used libraries into the user environment. I can imagine many things going wrong in this scenario. And guess who a user will complain to if something is messed up ? :) Yes, they will complain to you for sure, but I can't see where dynamic libraries can become a problem : - are they numpy dlls ? is so there is a problem, I agree with you - are they external dlls ? If so, the installer must have set up everything so that everything works, but this is where people bark at the wrong people : the users of the dll and not the installers. You seem to indicate that the problem is the last dlls, am I correct ? Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Matthieu Brucher wrote: Now that you provide an installer for Atlas, it may become the same problem as MKL, can't it ? It is exactly the same problem, yes. Right now, my installer does not modify the environment at all (like MKL or ACML, actually), and you have to do it manually (add PATH, or put in system32). Yes, they will complain to you for sure, but I can't see where dynamic libraries can become a problem : - are they numpy dlls ? is so there is a problem, I agree with you numpy 'dll' (they are technically dll, but are named .pyd on recent version of windows) are mandatory, and is not a problem: it is handled by python (whose import mechanism knows how to import dll not in the path env var). - are they external dlls ? If so, the installer must have set up everything so that everything works, but this is where people bark at the wrong people : the users of the dll and not the installers. Well, neither ACML or MKL does it, at least the versions I looked into. You have to launch a special cmd.exe (like for VS2005) which import the variables. cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Matthieu Brucher wrote: If you use an installed ATLAS/MKL/... library, I don't know where is the problem wit linking with them :| Atlas is not a problem, because if you know how to build a dll for ATLAS, you know how to handle environment variable problems. It is not a purely technical problem, but a combination of both cultural and technical. I know that if I tell you, Matthieu, to put you library path in your path, you won't tell me it does not work if the PATH is changed or something similar. But that's not how most windows users work in my experience. As for the problem: if you use PATH for dll, you need: - to use PATH inside scons, that is polluting the build environment with a variable you cannot control at all. - to add the path of the used libraries into the user environment. I can imagine many things going wrong in this scenario. And guess who a user will complain to if something is messed up ? :) cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Matthieu Brucher wrote: Yes, that works as long as there are no real dll that were built at the same time. Well, I don't see that happening unintentionally. Installed modules have a directory architecture, so this is not much of an issue, or am I missing something ? David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
It is exactly the same problem, yes. Right now, my installer does not modify the environment at all (like MKL or ACML, actually), and you have to do it manually (add PATH, or put in system32). Have you tried installing the DLLs to C:\Python2x or to the same directory as the numpy .pyd? As far as I know, this should work. The first solution may indeed work (perhaps in C:\Python2x\Lib as well ?) but the second does not. I tried it several times (same with Linux BTW), the library search is then the default one, not Python's one. Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Albert Strasheim wrote: Have you tried installing the DLLs to C:\Python2x or to the same directory as the numpy .pyd? As far as I know, this should work. Yes, it does, I think I tried it. But this mean duplicating dll, and more worrying, filesystem manipulations, which I don't like much (windows having this extremely annoying 'feature' of locking files by default, which is another thing I would have to care about). Obviously there are some issues: multiple modules might be linked to MKL, in which case you would be duplicating a lot of files, but hey, so it goes. Ideally, all the modules should be using one module to interact with native BLAS and LAPACK. In my opinion, modifying the PATH or installing to System32 are not ways to properly deploy DLLs on Windows. I agree, but once you've said modifying PATH and system32 are not the right way, and there is no other way to do it, what's your conclusion :) cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Hello, On Feb 19, 2008 11:34 AM, David Cournapeau [EMAIL PROTECTED] wrote: Matthieu Brucher wrote: Now that you provide an installer for Atlas, it may become the same problem as MKL, can't it ? It is exactly the same problem, yes. Right now, my installer does not modify the environment at all (like MKL or ACML, actually), and you have to do it manually (add PATH, or put in system32). Have you tried installing the DLLs to C:\Python2x or to the same directory as the numpy .pyd? As far as I know, this should work. Obviously there are some issues: multiple modules might be linked to MKL, in which case you would be duplicating a lot of files, but hey, so it goes. Ideally, all the modules should be using one module to interact with native BLAS and LAPACK. In my opinion, modifying the PATH or installing to System32 are not ways to properly deploy DLLs on Windows. Cheers, Albert ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Now that you provide an installer for Atlas, it may become the same problem as MKL, can't it ? It is exactly the same problem, yes. Right now, my installer does not modify the environment at all (like MKL or ACML, actually), and you have to do it manually (add PATH, or put in system32). OK ;) Yes, they will complain to you for sure, but I can't see where dynamic libraries can become a problem : - are they numpy dlls ? is so there is a problem, I agree with you numpy 'dll' (they are technically dll, but are named .pyd on recent version of windows) are mandatory, and is not a problem: it is handled by python (whose import mechanism knows how to import dll not in the path env var). Yes, that works as long as there are no real dll that were built at the same time. - are they external dlls ? If so, the installer must have set up everything so that everything works, but this is where people bark at the wrong people : the users of the dll and not the installers. Well, neither ACML or MKL does it, at least the versions I looked into. You have to launch a special cmd.exe (like for VS2005) which import the variables. That's almost stupid... I understand now what you meant :| Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] [ANN] numscons 0.4.1. Building numpy with MS compiler + g77 works !
Yes, it does, I think I tried it. Strange that it worked for you, it didn't for me :| Matthieu -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] partial_sum/adj_difference?
Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
A Tuesday 19 February 2008, Neal Becker escrigué: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise I don't know, but by using views the next should be fairly efficient: # Partial sum In [28]: a = numpy.arange(10) In [29]: ps = numpy.empty(len(a), 'int') In [30]: for i in range(len(a)): ps[i] = a[:i].sum() : In [31]: ps Out[31]: array([ 0, 0, 1, 3, 6, 10, 15, 21, 28, 36]) # Adj difference: In [35]: ad = numpy.empty(len(a), 'int') In [36]: ad[0] = a[0] In [37]: ad[1:] = a[1:] - a[:-1] In [38]: ad Out[38]: array([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]) Cheers, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data - ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
-Original Message- From: [EMAIL PROTECTED] on behalf of Francesc Altet Instead of for i in range(len(a)): ps[i] = a[:i].sum() use a.cumsum() Nadav Sent: Tue 19-Feb-08 20:59 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] partial_sum/adj_difference? A Tuesday 19 February 2008, Neal Becker escrigué: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise I don't know, but by using views the next should be fairly efficient: # Partial sum In [28]: a = numpy.arange(10) In [29]: ps = numpy.empty(len(a), 'int') In [30]: for i in range(len(a)): ps[i] = a[:i].sum() : In [31]: ps Out[31]: array([ 0, 0, 1, 3, 6, 10, 15, 21, 28, 36]) # Adj difference: In [35]: ad = numpy.empty(len(a), 'int') In [36]: ad[0] = a[0] In [37]: ad[1:] = a[1:] - a[:-1] In [38]: ad Out[38]: array([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]) Cheers, -- 0,0 Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data - ___ 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
Re: [Numpy-discussion] partial_sum/adj_difference?
Hi Neal On Tue, Feb 19, 2008 at 01:38:06PM -0500, Neal Becker wrote: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] numpy.cumsum Yikes, the docstring contains Blah, blah. I'll fix that immediately. adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise numpy.diff Regards Stéfan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
ti, 2008-02-19 kello 13:38 -0500, Neal Becker kirjoitti: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise cumsum and diff do something like this: import numpy a = [1,2,3,4,5,3,1] numpy.cumsum(a) array([ 1, 3, 6, 10, 15, 18, 19]) numpy.diff(a) array([ 1, 1, 1, 1, -2, -2]) signature.asc Description: Digitaalisesti allekirjoitettu viestin osa ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
On Feb 19, 2008 11:38 AM, Neal Becker [EMAIL PROTECTED] wrote: adj_diff[i] = x[i] - x[i-1] : i 1, x[i] otherwise Well, x[1:] - x[:-1] will give the usual differences. If you need the leading x[0] prefix the x vector with a 0. There's also numpy.diff, and the little known numpy.ediff1d x=numpy.arange(10) numpy.ediff1d(x,to_begin=0) array([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]) ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
On Feb 19, 2008 12:41 PM, Stefan van der Walt [EMAIL PROTECTED] wrote: Hi Neal On Tue, Feb 19, 2008 at 01:38:06PM -0500, Neal Becker wrote: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] numpy.cumsum Yikes, the docstring contains Blah, blah. I'll fix that immediately. Gosh, And here I thought you were going to fix that. Deleting the blahs isn't a fix, it's a coverup. Now there is no extended documentation at all. Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
On Tue, 19 Feb 2008 13:50:04 -0700 Charles R Harris [EMAIL PROTECTED] wrote: On Feb 19, 2008 12:41 PM, Stefan van der Walt [EMAIL PROTECTED] wrote: Hi Neal On Tue, Feb 19, 2008 at 01:38:06PM -0500, Neal Becker wrote: Does numpy/scipy have a partial_sum and adj_difference function? partial_sum[i] = \sum_{j=0}^{i} x[j] numpy.cumsum Yikes, the docstring contains Blah, blah. I'll fix that immediately. Gosh, And here I thought you were going to fix that. Deleting the blahs isn't a fix, it's a coverup. Now there is no extended documentation at all. Chuck ;-) from numpy import cumprod help (cumprod) Nils ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
On Tue, Feb 19, 2008 at 01:50:04PM -0700, Charles R Harris wrote: And here I thought you were going to fix that. Deleting the blahs isn't a fix, it's a coverup. Now there is no extended documentation at all. I wouldn't call Blah, blah extended documentation -- in fact, I would've been rather embarrassed if that showed up on my screen during a workshop. Blah, blah also doesn't strike me as the ideal TODO marker. We can maybe use some more sensible text, or write a decorator to mark these functions. I'd say we add them to the TODO list for the next doc-day and run with it... Regards Stéfan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] numpy record array segfault
Hi, I'm getting a segfault when using python objects with record arrays. The code (below) basically assigns a single datetime object to a slice of a column in the record array and then python segfaults as soon as I try to access those array values. I'm using the latest svn version of numpy compiled with gcc 3.4.1 on Solaris (intel). Any ideas why this is happening? A reference counting problem maybe? Thanks for taking a look. Sameer [EMAIL PROTECTED]:~ gcc --version gcc (GCC) 3.4.1 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:~ uname -a SunOS flag 5.10 Generic_118855-15 i86pc i386 i86pc [EMAIL PROTECTED]:~ python -V Python 2.4.2 [EMAIL PROTECTED]:~ cat tmp.py import datetime import numpy as np print np.__version__ def myfunc(N): newrec = np.empty(N, dtype=[('date', '|O4'), ('age', int)]) newrec['date'] = datetime.date(2002,1,1) newrec['age'] = 22 newrec['date'][1:12] = datetime.date(2003,1,1) return newrec.view(np.recarray) if __name__=='__main__': newrec = myfunc(29) print newrec['date'] [EMAIL PROTECTED]:~ python ~/tmp.py 1.0.5.dev4812 Segmentation Fault (core dumped) ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] partial_sum/adj_difference?
On Feb 19, 2008 2:20 PM, Stefan van der Walt [EMAIL PROTECTED] wrote: On Tue, Feb 19, 2008 at 01:50:04PM -0700, Charles R Harris wrote: And here I thought you were going to fix that. Deleting the blahs isn't a fix, it's a coverup. Now there is no extended documentation at all. I wouldn't call Blah, blah extended documentation -- in fact, I would've been rather embarrassed if that showed up on my screen during a workshop. Blah, blah also doesn't strike me as the ideal TODO marker. We can maybe use some more sensible text, or write a decorator to mark these functions. It has certainly been effective in practice. Chuck ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] finding eigenvectors etc
hi i was calculating eigenvalues and eigenvectors for a covariancematrix using numpy adjfaces=matrix(adjarr) faces_trans=adjfaces.transpose() covarmat=adjfaces*faces_trans evalues,evect=eigh(covarmat) for a sample covarmat like [[ 1.69365981e+13 , -5.44960784e+12, -9.00346400e+12 , -2.48352625e +12] [ -5.44960784e+12, 5.08860660e+12, -8.67539205e+11 , 1.22854045e +12] [ -9.00346400e+12, -8.67539205e+11, 1.78184943e+13 ,-7.94749110e +12] [ -2.48352625e+12 , 1.22854045e+12, -7.94749110e+12 , 9.20247690e +12]] i get these evalues [ 3.84433376e-03, 4.17099934e+12 , 1.71771364e+13 , 2.76980401e+13] evect [[ 0.5-0.04330262 0.60041892 -0.62259297] [ 0.5-0.78034307 -0.35933516 0.10928372] [ 0.5 0.25371931 0.3700265 0.74074753] [ 0.5 0.56992638 -0.6026 -0.22743827]] what bothers me is that for the same covarmat i get a different set of eigenvectors and eigenvalues when i use java library Jama's methods Matrix faceM = new Matrix(faces, nrfaces,length); Matrix faceM_transpose = faceM.transpose(); Matrix covarM = faceM.times(faceM_transpose); EigenvalueDecomposition E = covarM.eig(); double[] eigValue = diag(E.getD().getArray()); double[][] eigVector = E.getV().getArray(); here the eigValue= [-6.835301757686207E-4, 4.170999335736721E12, 1.7177136443134865E13, 2.7698040117669414E13] and eigVector [ [0.5, -0.04330262221379265, 0.6004189175979487, 0.6225929700052174], [0.5, -0.7803430730840767, -0.3593351608695496, -0.10928371540423852], [0.49994, 0.2537193127299541, 0.370026504572483, -0.7407475253159538], [0.49994, 0.5699263825679145, -0.602613008821, 0.22743827071497524] ] I am quite confused bythis difference in results ..the first element in eigValue is different and also the signs in last column of eigVectors are diff..can someone tell me why this happens? thanks dn ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] numpy record array segfault
On Tue, 19 Feb 2008 17:10:10 -0600 Sameer DCosta [EMAIL PROTECTED] wrote: Hi, I'm getting a segfault when using python objects with record arrays. The code (below) basically assigns a single datetime object to a slice of a column in the record array and then python segfaults as soon as I try to access those array values. I'm using the latest svn version of numpy compiled with gcc 3.4.1 on Solaris (intel). Any ideas why this is happening? A reference counting problem maybe? Thanks for taking a look. Sameer [EMAIL PROTECTED]:~ gcc --version gcc (GCC) 3.4.1 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:~ uname -a SunOS flag 5.10 Generic_118855-15 i86pc i386 i86pc [EMAIL PROTECTED]:~ python -V Python 2.4.2 [EMAIL PROTECTED]:~ cat tmp.py import datetime import numpy as np print np.__version__ def myfunc(N): newrec = np.empty(N, dtype=[('date', '|O4'), ('age', int)]) newrec['date'] = datetime.date(2002,1,1) newrec['age'] = 22 newrec['date'][1:12] = datetime.date(2003,1,1) return newrec.view(np.recarray) if __name__=='__main__': newrec = myfunc(29) print newrec['date'] [EMAIL PROTECTED]:~ python ~/tmp.py 1.0.5.dev4812 Segmentation Fault (core dumped) ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion No problem here python tmp.py 1.0.5.dev4811 [2002-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2003-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01 2002-01-01] Can you send a backtrace (gdb) ? Nils ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] finding eigenvectors etc
Yes. Your first eigenvalue is effectively 0, the values you see are just noise. Different implementations produce different noise. As for the signs ot the eigenvector components, which direction is + or - X is arbitrary. Different implementations follow different conventions as to which is which. Sometimes it's just an accident. Nothing-to-see-here-move-along-ly, w On Wed, 20 Feb 2008, Matthieu Brucher wrote: Hi, The results are OK, they are very close. Your matrix is almost singular, is badly conditionned, ... But the results are very close is you check them in a relative way. 3.84433376e-03 or -6.835301757686207E-4 is the same compared to 2.76980401e+13 Matthieu 2008/2/20, [EMAIL PROTECTED] [EMAIL PROTECTED]: hi i was calculating eigenvalues and eigenvectors for a covariancematrix using numpy adjfaces=matrix(adjarr) faces_trans=adjfaces.transpose() covarmat=adjfaces*faces_trans evalues,evect=eigh(covarmat) for a sample covarmat like [[ 1.69365981e+13 , -5.44960784e+12, -9.00346400e+12 , -2.48352625e +12] [ -5.44960784e+12, 5.08860660e+12, -8.67539205e+11 , 1.22854045e +12] [ -9.00346400e+12, -8.67539205e+11, 1.78184943e+13 ,-7.94749110e +12] [ -2.48352625e+12 , 1.22854045e+12, -7.94749110e+12 , 9.20247690e +12]] i get these evalues [ 3.84433376e-03, 4.17099934e+12 , 1.71771364e+13 , 2.76980401e+13] evect [[ 0.5-0.04330262 0.60041892 -0.62259297] [ 0.5-0.78034307 -0.35933516 0.10928372] [ 0.5 0.25371931 0.3700265 0.74074753] [ 0.5 0.56992638 -0.6026 -0.22743827]] what bothers me is that for the same covarmat i get a different set of eigenvectors and eigenvalues when i use java library Jama's methods Matrix faceM = new Matrix(faces, nrfaces,length); Matrix faceM_transpose = faceM.transpose(); Matrix covarM = faceM.times(faceM_transpose); EigenvalueDecomposition E = covarM.eig(); double[] eigValue = diag(E.getD().getArray()); double[][] eigVector = E.getV().getArray(); here the eigValue= [-6.835301757686207E-4, 4.170999335736721E12, 1.7177136443134865E13, 2.7698040117669414E13] and eigVector [ [0.5, -0.04330262221379265, 0.6004189175979487, 0.6225929700052174], [0.5, -0.7803430730840767, -0.3593351608695496, -0.10928371540423852], [0.49994, 0.2537193127299541, 0.370026504572483, -0.7407475253159538], [0.49994, 0.5699263825679145, -0.602613008821, 0.22743827071497524] ] I am quite confused bythis difference in results ..the first element in eigValue is different and also the signs in last column of eigVectors are diff..can someone tell me why this happens? thanks dn ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] CFLAGS, LDFLAGS, appending and overwriting: what should be the behavior of numscons ?
Hi, I would like to know what the UI should be for numscons wrt to compilation / link flags. This is an issue which has confused many people with distutils, and something we can fix with numscons. Several approaches are possible for numscons, but I was wondering about the preferred behavior. Right now, by default: - using CFLAGS will only change debug/warning/optimization flags (that is, you can't remove -fPIC with CFLAGS on platforms which need it). I understand than totally overwriting the flags should also be possible (e.g. the current *distutils* behavior). Is handling new compilers the only reason, in which case a better solution is available for numscons through scons tools ? - using LDFLAGS: I do not use it right now. Is anything needed on this front ? More generally, since numscons is easier to use now thanks to the merge into the numpy trunk, and can work on all major platforms since 0.4.1 release, I am interested in getting feedback from numpy developers as well. Internally, I tried to make as few choices as possible, so it should be quite flexible wrt things difficult to handle with distutils. thanks, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] finding eigenvectors etc
Hi, The results are OK, they are very close. Your matrix is almost singular, is badly conditionned, ... But the results are very close is you check them in a relative way. 3.84433376e-03 or -6.835301757686207E-4 is the same compared to 2.76980401e+13 Matthieu 2008/2/20, [EMAIL PROTECTED] [EMAIL PROTECTED]: hi i was calculating eigenvalues and eigenvectors for a covariancematrix using numpy adjfaces=matrix(adjarr) faces_trans=adjfaces.transpose() covarmat=adjfaces*faces_trans evalues,evect=eigh(covarmat) for a sample covarmat like [[ 1.69365981e+13 , -5.44960784e+12, -9.00346400e+12 , -2.48352625e +12] [ -5.44960784e+12, 5.08860660e+12, -8.67539205e+11 , 1.22854045e +12] [ -9.00346400e+12, -8.67539205e+11, 1.78184943e+13 ,-7.94749110e +12] [ -2.48352625e+12 , 1.22854045e+12, -7.94749110e+12 , 9.20247690e +12]] i get these evalues [ 3.84433376e-03, 4.17099934e+12 , 1.71771364e+13 , 2.76980401e+13] evect [[ 0.5-0.04330262 0.60041892 -0.62259297] [ 0.5-0.78034307 -0.35933516 0.10928372] [ 0.5 0.25371931 0.3700265 0.74074753] [ 0.5 0.56992638 -0.6026 -0.22743827]] what bothers me is that for the same covarmat i get a different set of eigenvectors and eigenvalues when i use java library Jama's methods Matrix faceM = new Matrix(faces, nrfaces,length); Matrix faceM_transpose = faceM.transpose(); Matrix covarM = faceM.times(faceM_transpose); EigenvalueDecomposition E = covarM.eig(); double[] eigValue = diag(E.getD().getArray()); double[][] eigVector = E.getV().getArray(); here the eigValue= [-6.835301757686207E-4, 4.170999335736721E12, 1.7177136443134865E13, 2.7698040117669414E13] and eigVector [ [0.5, -0.04330262221379265, 0.6004189175979487, 0.6225929700052174], [0.5, -0.7803430730840767, -0.3593351608695496, -0.10928371540423852], [0.49994, 0.2537193127299541, 0.370026504572483, -0.7407475253159538], [0.49994, 0.5699263825679145, -0.602613008821, 0.22743827071497524] ] I am quite confused bythis difference in results ..the first element in eigValue is different and also the signs in last column of eigVectors are diff..can someone tell me why this happens? thanks dn ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion