From: Dominique O. <dom...@gm...> - 2011-06-13 20:30:19
|
On Mon, Jun 13, 2011 at 1:30 PM, Oz Nahum Tiram <na...@gm...> wrote: > Hi, > Thanks for the answer - I should have mentioned such important info. > I am using pysparse from the debian squeeze repositories... > > Cheers, > > Oz > > > On Mon, Jun 13, 2011 at 3:01 PM, Dominique Orban < > dom...@gm...> wrote: > >> On Mon, Jun 13, 2011 at 8:43 AM, Oz Nahum Tiram <na...@gm...>wrote: >> >>> Hi *, >>> >>> I am trying to solve a simple sparse system and I get an unclear error. >>> I have used the solvers before and never encoutered this error. Here is >>> an example: >>> >>> In [505]: print A >>> --------> print(A) >>> 1.000000 --- --- --- --- >>> --- 2.000000 --- --- --- >>> --- --- 3.000000 --- --- >>> --- --- --- 4.000000 --- >>> --- --- --- --- 5.000000 >>> >>> In [506]: print b >>> --------> print(b) >>> [ 1. 2. 3. 4. 5.] >>> >>> In [507]: b >>> Out[507]: array([ 1., 2., 3., 4., 5.]) >>> >>> In [508]: info, iter, relres = sp.itsolvers.bicgstab(A,b,x, tol, maxit) >>> >>> --------------------------------------------------------------------------- >>> TypeError Traceback (most recent call >>> last) >>> >>> /home/ozdeb/aeg-master/python book/richards flow/RichardsPython/<ipython >>> console> in <module>() >>> >>> TypeError: matvec() takes exactly 2 arguments (3 given) >>> >> >> Hi Oz, >> >> What version of Pysparse are you using? Is this the Pysparse from Pypi or >> one from SVN? >> >> Thanks, >> >> -- >> Dominique > > Hi Oz, I presume your matrix A is an instance of pysparseMatrix. The solvers in the itsolvers module were originally designed for either ll_mat, csr_mat or sss_mat matrices. To fix the problem you can do info, iter, relres = sp.itsolvers.bicgstab(A.matrix, b, x, tol, maxit) I'll fix this in the next release. -- Dominique |