On Thu, 25 Jan 2007 16:56:54 -0200
  "Paulo J. S. Silva" <[EMAIL PROTECTED]> wrote:
> Em Qui, 2007-01-25 às 19:46 +0100, Nils Wagner escreveu:
> 
>> 
>> It works if you use
>> M=num.random.rand(2,2)
>> 
>> Nils
>> 
> 
> Yes, it works for arrays but not for matrices. I thought 
>that
> scipy.linalg functions were supposed to work with 
>matrices.
> 
> Paulo
> 
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
  
linalg.solve works with matrix input

In [1]: import numpy as num

In [2]: import scipy.linalg as la

In [3]: M = num.mat(num.random.rand(2,2))

In [4]: b = num.random.rand(2)

In [5]: x = la.solve(M,b)

In [6]: print M*x
[[ 0.29508067  0.17152755]]

In [7]: b
Out[7]: array([ 0.29508067,  0.17152755])

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

Reply via email to