[SciPy-dev] Compiling pysparse from the sandbox

Bill Baxter wbaxter at gmail.com
Wed Apr 18 23:54:50 EDT 2007


On 4/19/07, Nathan Bell <wnbell at gmail.com> wrote:
> On 4/18/07, Daniel Wheeler <daniel.wheeler at nist.gov> wrote:
> > Probably not. Pysparse at sourceforge is being maintained and is at release
> > 1.0. It's been updated
> > to use numpy with the numpy/noprefix.h method mentioned above. Use cvs
> > rather than 1.0 as 1.0
> > doesn't see the numpy header files.
>
> Just out of curiosity, is there important functionality that PySparse
> offers that's not currently available in SciPy?  From what I can tell,
> PySparse has a few preconditioners and an eigensolver, in addition to
> what SciPy also has.

SciPy's sparse matrices also lack any way to operate based on a sparse
index, which is a fundamental operation in FEM codes.  Basically you
need to be able to do something like
    idx = [1,8,13,15]
    K[ix_[idx,idx]] += node_contribution

pysparse has an update_add_masked function which can do that
efficiently (although it would obviously be better if regular numpy
indexing just worked.)

> Is there an interest in including these or any other sparse features in SciPy?
>
> I have some Algebraic Multigrid code (AMG) that I've been working on
> for a while.  I've implemented the so-called "classical" AMG of Ruge &
> Stuben and also Smoothed Aggregation as described in by Vanek et. al.
>
> Would others be interested in using AMG in SciPy?  For those not
> familiar with AMG, or multigrid in general - multigrid can solve
> linear systems that arise in certain elliptic PDEs (e.g. Poisson
> equations, heat diffusion, linear elasticity, etc) in optimal time.
> Furthermore, the AMG methods mentioned above are "black box" in the
> sense that only the matrix needs to be provided to the solver - so no
> knowledge of the mesh geometry is necessary.

Sounds great to me.  I've toyed with MG, but never got very far.
Non-power-of-two grids and boundary conditions were too tricksy for
me.  But the O(N) solve time is great if someone else does all the
hard work for me. :-)

> Also, are the iterative methods (pcg,gmres,etc.) reentrant?  I recall
> having problems using cg with a preconditioner that also called cg
> (for a coarse level solve).

--bb



More information about the SciPy-Dev mailing list