Dear NumPythoneers,
I have to solve the generalized Eigenvalue problem A u = lambda B
u
There are lapack procedures http://netlib2.cs.utk.edu/lapack/lug/node37.html.
These procedures are not present in the lite versions included in the NumPy
distribution.
Did somebody already treat such problems?? Within Numpy or outside
Numpy. Do I have to install the full blown version of Lapack??
Wim Vanroose

Michel Sanner wrote:
> I built Numeric on a Dec Alpha under OSF1 V4.0. I built fine but when I ran
> it I witnessed strange behavior.
>
> a = Numeric.identity(4)
> a.shape = (16,)
>
> would raise an exception about the size of the array needing to remain
> the same ???
I have seen the same behavior on a Dec Alpha running RedHat Linux,
with Numeric compiled with gcc.
The other random pieces of Numeric that I tried seemed to work
correctly.
Chris
==========================================================================
Chris Myers
Cornell Theory Center
--------------------------------------------------------------------------
636 Rhodes Hall email: myers(a)tc.cornell.edu
Cornell University phone: (607) 255-5894 / fax: (607) 254-8888
Ithaca, NY 14853 http://www.tc.cornell.edu/~myers
--------------------------------------------------------------------------
"To thine own self be blue." - Polonious Funk
==========================================================================
On Sat, 24 Jun 2000 numpy-discussion-admin(a)lists.sourceforge.net wrote:
> Date: Sat, 24 Jun 2000 12:19:28 -0700
> From: numpy-discussion-admin(a)lists.sourceforge.net
> Reply-To: numpy-discussion(a)lists.sourceforge.net
> To: numpy-discussion(a)lists.sourceforge.net
> Subject: Numpy-discussion digest, Vol 1 #70 - 1 msg
>
>
> Send Numpy-discussion mailing list submissions to
> numpy-discussion(a)lists.sourceforge.net
>
> To subscribe or unsubscribe via the web, visit
> http://lists.sourceforge.net/mailman/listinfo/numpy-discussion
> or, via email, send a message with subject or body 'help' to
> numpy-discussion-request(a)lists.sourceforge.net
> You can reach the person managing the list at
> numpy-discussion-admin(a)lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of Numpy-discussion digest..."
>
>
> Today's Topics:
>
> 1. Numeric on Dec Alpha (Michel Sanner)
>
> --__--__--
>
> Message: 1
> From: "Michel Sanner" <sanner(a)scripps.edu>
> Date: Fri, 23 Jun 2000 12:22:24 -0700
> To: numpy-discussion(a)lists.sourceforge.net
> Subject: [Numpy-discussion] Numeric on Dec Alpha
>
> Hi, I posted this message on the python-list a while ago and did not hear
> anything .. so I try here :)
>
> I built Numeric on a Dec Alpha under OSF1 V4.0. I built fine but when I ran it
> I witnessed strange behavior.
>
> a = Numeric.identity(4)
> a.shape = (16,)
>
> would raise an exception about the size of the array needing to remain the same
> ???
>
> Using the debugger I found in arrayobject.c:2201
>
> if (PyArray_As1D(&shape, (char **)&dimensions, &n, PyArray_LONG) == -1)
> return NULL;
>
> After this call shape [0] is 4 BUT shape[1] is 0 !
>
> I changed the code to
> if (PyArray_As1D(&shape, (char **)&dimensions, &n,
> PyArray_INT) == -1) return NULL;
>
> and got the right result.
>
> Did anyone else run into this kind of preblems ? what is the correct way to fix
> that ?
>
> thanks
>
> -Michel
>
>
> --
>
> -----------------------------------------------------------------------
>
> >>>>>>>>>> AREA CODE CHANGE <<<<<<<<< we are now 858 !!!!!!!
>
> Michel F. Sanner Ph.D. The Scripps Research Institute
> Assistant Professor Department of Molecular Biology
> 10550 North Torrey Pines Road
> Tel. (858) 784-2341 La Jolla, CA 92037
> Fax. (858) 784-2860
> sanner(a)scripps.edu http://www.scripps.edu/sanner
> -----------------------------------------------------------------------
>
>
>
>
> --__--__--
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion(a)lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/numpy-discussion
>
>
> End of Numpy-discussion Digest
>

Hi, I posted this message on the python-list a while ago and did not hear
anything .. so I try here :)
I built Numeric on a Dec Alpha under OSF1 V4.0. I built fine but when I ran it
I witnessed strange behavior.
a = Numeric.identity(4)
a.shape = (16,)
would raise an exception about the size of the array needing to remain the same
???
Using the debugger I found in arrayobject.c:2201
if (PyArray_As1D(&shape, (char **)&dimensions, &n, PyArray_LONG) == -1)
return NULL;
After this call shape [0] is 4 BUT shape[1] is 0 !
I changed the code to
if (PyArray_As1D(&shape, (char **)&dimensions, &n,
PyArray_INT) == -1) return NULL;
and got the right result.
Did anyone else run into this kind of preblems ? what is the correct way to fix
that ?
thanks
-Michel
--
-----------------------------------------------------------------------
>>>>>>>>>> AREA CODE CHANGE <<<<<<<<< we are now 858 !!!!!!!
Michel F. Sanner Ph.D. The Scripps Research Institute
Assistant Professor Department of Molecular Biology
10550 North Torrey Pines Road
Tel. (858) 784-2341 La Jolla, CA 92037
Fax. (858) 784-2860
sanner(a)scripps.edu http://www.scripps.edu/sanner
-----------------------------------------------------------------------

If I move things like FFT out of the core and make them separate packages, I
am left with a choice: make them real packages, which means their usage
would change, or structure the packages so that everything gets installed in
the Python search path the way it does now.
The first choice is better for the future, walling everything off into
namespaces properly. The second choice doesn't break any existing code.
The changes involve just namespace issues. Right now all of Numeric is
installed as separate top-level modules.
The same considerations apply somewhat to Numeric itself. By making the
existing Numeric.py into the __init__.py for a Numeric package, nothing
would break except imports of Precision and ArrayPrinter, which would have
to become Numeric.Precision, etc.
How much pain is the future worth?

Hello, I started to use PyUnit to build another test framework for
NumPy. The ideas behind this approach are:
-- Build on a known and maybe standard framework.
-- Make tests in such a way that they can be handled with Python so
helper functions can be written to perform single tests from the
commandline.
-- The framework should facilitate the writing of new tests by
everyone, not only for NumPy routines but also for more complex or
derived programs.
-- The tests should be self contained, each test is done in a clean
environment.
-- The hole test suite can be run, also if some tests are
failing. This is important for all these cases, where there are
known errors in the system libraries.
-- Define and document what actually is tested. There are different
criteria for tests on numerical functions, like testing the
interface, the numerical valid input range, type coercions, the
algorithm and so on.
In the end I want to have a module which can be imported and the
contained classes can be used to write new tests, perform tests and
generate reports. Together with a naming convention it should be
possible to automate the testing of new modules.
I have written some ideas down at:
http://lisboa.ifm.uni-kiel.de:80080/NumPy/NaFwiki/TestFramework
There is also a module which is NOT the proposed framework, but which
demonstrates how the code of the tests looks like.
Are there some comments, objections or new ideas?
With regards,
__Janko

Are you craving for Matlab/Octave style expressions in Python? (For example,
A*B is matrix multiplication, not elementwise.) Now you can.
I've just made a package MatPy and started a SourceForge project for it.
It is implemented as wrappers around the Numeric and Gnuplot packages.
You can find the source codes, tests and docs on the home page
http://MatPy.sourceforge.net
The main reason I have written this package is that I'm tired of dealing
with NewAxis and have "Frame not aligned" exceptions. Now matrices and
vectors behave as one would expect from linear algebra.
Examples:
>>> from MatPy.Matrix import *
>>> A = rand((20,5))
>>> x = rand((5,1))
>>> y = A*x
>>> b = solve(A,y)
>>> norm(b-x)
1.16043535672e-15
>>> print x
[ 0.276
0.553
0.733
0.388
0.5 ]
>>> print x.T()
[ 0.276 0.553 0.733 0.388 0.5 ]
>>> print x.T()*x
[ 1.32 ]
>>> print x*x.T()
[ 0.0763 0.153 0.203 0.107 0.138
0.153 0.306 0.406 0.214 0.277
0.203 0.406 0.538 0.284 0.367
0.107 0.214 0.284 0.15 0.194
0.138 0.277 0.367 0.194 0.25 ]
>>> z = x + rand(x.shape)*1j
>>> z.H()
[ 0.276-0.606j 0.553-0.376j 0.733-0.933j 0.388-0.636j 0.5-0.314j ]
>>> z.H()*z
[ 3.2+0j ]
>>> norm(z)**2
3.2026003449
There are also matrix and elementwise versions of functions:
expm and exp, sqrtm and sqrt, etc.
Questions, comments, suggestions and helps are all very welcome.
It is a future plan to have an efficient interface to Octave to leverage its
large code base.
Enjoy!
Huaiyu <hzhu(a)users.sourceforge.net>

> But memory is so cheap these days! ;-)
I am a grad student, and have no money. :(
> > However, the matrix is empty except for the main diagonal.
> Multiplying by a diagonalized matrix is just vectorized multiplication:
> a 0 0
> 0 b 0 . <x, y, z> = <az, by, cz>
> 0 0 c
My mistake - I need to multiply the 7731x7731 by a 7731x220 element matrix -
square matrix times rectangular matrix, not just 2 diagonal matrices.
Otherwise, the problem wouldn't be so hard. :)
--
That which does not kill you, didn't try hard enough.

Charles G Waldman <cgw(a)fnal.gov> writes:
> > >>> Numeric.__version__
> > '11'
> >>> Numeric.__version__
> '15.2'
> >>> Numeric.arange(2)*1j
> array([ 0.+0.j, 0.+1.j])
I tested for the bug in the Numeric version 11 on the following:
Python 1.5.2+ (#7, Nov 13 1999, 17:39:22) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Python 1.5.2+ (#4, Oct 6 1999, 22:18:42) [C] on linux2 (alpha with cc)
Python 1.5.2 (#1, Apr 18 1999, 16:03:16) [GCC pgcc-2.91.60 19981201 (egcs-1.1.1 on linux2
The bug was not present on these, nor in Numeric 15.2 in an SGI. So the
problem seems to be not in the source but in the installation (or the
compiler).
--
Janne

I have a problem where I need to do matrix multiplication of a 7731x7731
matrix; storing this thing would take over 250 MB of memory, which is more
than my machine has. :( However, the matrix is empty except for the main
diagonal. Ideally, all that needs to be stored is a single vector 7731
elements long, and then tweak matrix multiplication algorithms to account for
this. Are there any facilities in NumPy to do this sort of thing, or do I
have to roll my own? Is there a way to effeciently store a very sparse
matrix and do standard matrix multiplies? Thanks.
-Paul Gettings
Dep't of Geology & Geophysics
University of Utah
--
But Your Honor, they needed killin'.

Hey Numeric people!
I am just upgrading to a more recent version of Numeric and observe a new
behaviour:
Python 1.5.2 (#9, May 30 2000, 15:08:12) [GCC 2.95.2 19991024 (release)]
on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
Hello from .pythonrc.py
>>> import Numeric
>>> Numeric.__version__
'11'
>>> Numeric.arange(2)*1j
Segmentation fault
Python 1.5.1 (#1, Dec 17 1998, 20:58:15) [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
Hello from .pythonrc.py
>>> import Numeric
>>> Numeric.__version__
'1.7'
>>> Numeric.arange(2)*1j
array([ 0.+0.j, 0.+1.j])
I also saw:
Numerical Python - Bug Tracking
Viewing Open Bugs
Bug ID
Summary
102277
CFLOAT/DOUBLE_setitem crashes when accessing imag.
part
Am I hitting that bug?
CU
Jean-Bernard