[SciPy-user] solve for symetric matrix ?
Robert Cimrman
cimrman3 at ntc.zcu.cz
Thu Apr 26 06:18:56 EDT 2007
Nils Wagner wrote:
> fred wrote:
>> Nils Wagner a écrit :
>>
>>> Hi Fred,
>>>
>>> Yes.
>>> See
>>> http://en.wikipedia.org/wiki/Cholesky_decomposition#Computing_the_Cholesky_decomposition
>>>
>>>
>> Thanks Nils !
>>
>>
> Hi Fred,
>
> If you can't believe it run the attached script.
> I get
> python -i cholesky_lu.py
> Elapsed time LU 0.291770935059
> Residual 1.65732165386e-14
> Elapsed time Cholesky 0.210819959641
> Residual 1.8009241117e-14
> ...
> t_0 = time.time()
> x_lu = linalg.solve(A,b)
In [7]:linalg.solve?
Definition: la.solve(a, b, sym_pos=0, lower=0, overwrite_a=0,
overwrite_b=0, debug=0)
Docstring:
solve(a, b, sym_pos=0, lower=0, overwrite_a=0, overwrite_b=0) -> x
...
sym_pos -- Assume a is symmetric and positive definite.
In [8]:scipy.__version__
Out[8]:'0.5.3.dev2935'
Have you tried sym_pos=True? solve should then use Cholesky...
r.
More information about the SciPy-User
mailing list