[SciPy-user] Linalg should work in latest CVS tree with latest f2py
Nils Wagner
nwagner at mecha.uni-stuttgart.de
Tue Mar 26 03:04:42 CST 2002
Travis Oliphant schrieb:
>
> Users,
>
> There has been some difficulty with the linalg subpackage and the newest f2py
> (particularly effecting people who wanted to use matrix exponential
> algorithm).
>
> This has been resolved. You have two options.
>
> If your ATLAS is older than 3.3.13 and you don't want to upgrade your ATLAS
> installation (e.g. because it takes awhile to compile binaries), then you can
> get the latest CVS, build scipy, and use the linalg algorithms.
>
> If you want to go ahead and get ATLAS > 3.3.13 then you can use linalg2 (not
> imported by default --- you have to specifically import it (e.g. import
> scipy.linalg2 as linalg2)
>
> Not all algorithms are in linalg2 as of yet, but it won't be long.
>
> Thanks for your patience.
>
> -Travis Oliphant
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
After installing the latest SciPy via CVS this is what happens when
I start a small test program for matrix functions
Matrix function for arbitrary callable object func.
array_from_pyobj:FromDims failed: intent(hide)
Traceback (most recent call last):
File "exptest.py", line 42, in ?
print funm(identity(2)*1.0 , exp)
File
"/usr/local/lib/python2.1/site-packages/scipy/linalg/linear_algebra.py",
line 836, in funm
Z, T = schur(A)
File
"/usr/local/lib/python2.1/site-packages/scipy/linalg/linear_algebra.py",
line 315, in schur
result = lapack_routine(lambda x: None, a, lwork=-1) # query
MemoryError: can't allocate memory for array
Moreover, there is still a problem concering the computation of the
matrix exponential
by using a Pade approximation (expm(A)).
Any suggestion ?
Nils
from scipy import *
from scipy.linalg import expm, expm2, expm3, funm
#
# page 820 Cleve Moler and Charles van Loan Nineteen dubious ways ...
#
eps = 1.e-5
a = array([[1.+eps,1.0],[0.,1.-eps]])
#
# Pade approximant
#
help (expm)
print expm(a,5)
#
# Eigenvalue decomposition
#
help (expm2)
print expm2(a)
#
# Taylor series
#
help (expm3)
print expm3(a)
#
# Standard test problem p.184 L. Dieci, A.Papini
# Linear Algebra and its applications Vol.308 (2000) 183-202
#
omega = 1.0
x = 1.0e6
b = array([[omega,x],[0,omega]])
b = omega*identity(2)+([[0.,x],[0.,0.]])
#
help (expm)
print expm(b)
#
help (expm2)
print expm2(b)
#
help (expm3)
print expm3(b)
help (funm)
print funm(identity(2)*1.0 , exp)
More information about the SciPy-user
mailing list