Re: [Numpy-discussion] ValueError: matrices are not aligned!!!

2013-09-18 Thread Happyman
I understand ,sometimes, it is normal that number of equations are less or more than number of unknowns that means non square matrix appearance. If so,  how  would you compose Av(v) function, because I have only constant dimensional values such as A matrix(MxN) and array b array (M)??? Среда,

Re: [Numpy-discussion] ValueError: matrices are not aligned!!!

2013-09-18 Thread Bradley M. Froehle
In [2]: %debug > (5)Av() 4 def Av(A,v): > 5 return np.dot(A,v) 6 ipdb> !A.shape (4, 8) ipdb> !v.shape (4,) In your code it looks like you are essentially computing A.dot(v) where A is a 4-by-8 matrix and v is vector of length 4. That's what the error is telling you --- that

[Numpy-discussion] ValueError: matrices are not aligned!!!

2013-09-18 Thread Happyman
Hello, I am trying to solve linear Ax=b problem, but some error occurs in the process like:  -- Traceback (most recent call last): File "C:\Python27\Conjugate_Gradient.py", line 66, in x, iter_number = conjGrad(Av,A, x, b) File "C:\Python27\Conjugate_