From: Artur P. <art...@gm...> - 2008-06-20 10:50:05
|
Thank you for your help Daniel I have downloaded it but it is asking for more modules from your project. I will try to have a look and see if I can do something based on what you did. In the meantime I will also have a look a pyTrilinos. Thank you once again. -artur palha On Tue, Jun 17, 2008 at 11:33 AM, Artur Palha <art...@gm...> wrote: > Hi to you all, I hope someone can help me. > > I am trying to do the following with pysparse but I am having problems doing it. > > I have a dense vector, say: > > x = numpy.arange(0,10) > > and a sparse matrix: > > A = pysparse.spmatrix.ll_mat(10,10) > > What I wish to do is: > > x = x + A[:, 2] > > But this gives the following error: > TypeError: unsupported operand type(s) for +: 'float' and 'll_mat' > > Then I tried like this: > > x = numpy.arange(0,10) > > A = pysparse.sparray.sparray((10,10)) > > With this it works ok but then, when I try to do a slice: > > A_reduced = A[0:5, 0:5] > > It gives an error: > TypeError: unsupported operand type(s) for +: 'int' and 'slice' > > Anybody can give a help? > > Also, what is the main difference between spmatrix and sparray? > > Thanking in advance > > Best regards > > -artur palha > |