From: Dominique O. <dom...@gm...> - 2011-06-14 13:26:14
|
On Tue, Jun 14, 2011 at 7:11 AM, Oz Nahum Tiram <na...@gm...> wrote: > On Tue, Jun 14, 2011 at 5:12 AM, Dominique Orban > <dom...@gm...> wrote: > > > > Hi Oz, > > I just pushed improved wrappers for the iterative solvers to the > 'suitesparse' branch of Pysparse (which is meant to become trunk in the near > future). The wrappers are now more streamlined. For some reason, Bicgstab > and Gmres were left out when we wrote those wrappers. I just added them. If > you look in itsolvers_utils.py, you will see an example towards the bottom > of the file. The wrappers accept both ll_mat and PysparseMatrix input. This > is the better way to call the iterative solvers. There shouldn't be much of > a difference in speed. > > What do you mean by "why is your code not there"? > > > > -- > > Dominique > > Hi Dominique, > I looked at the code in itsolvers_utils.py, which uses the classes and > objects concept. > It is not unfamiliar for me to write code like that, but imho it adds > a layer of complexity I prefer to avoid. > Complexity? In my view such classes offer more flexibility (e.g., you can subclass them) and are designed to make the user's life easier. For instance, now, they accept both ll_mat and PysparseMatrix input. I also moved arguments such as tol, itmax and K (the preconditioner) to the solve() method as that is where they belong. The old-style calling sequence is more C-like and less Python-like. In what way are they more complex to you? > What I meant in my question is from the two ways I used the matrices, > is there some which gives better performance ? > No, there should not be any performance hit when calling the solver. There may be a slight hit when you construct the matrix, but I would guess it is negligible and I've never bothered to measure it. >What do you mean by "why is your code not there"? > About code in scipy: it is good to have both projects, I just thought > if you merge your code into scipy, it will reach bigger audiences. > As you may know, Pysparse used to be part of Scipy several years ago. For some reason, the Scipy folks decided to write their own sparse matrix library. -- Dominique |