[SciPy-dev] help: wrapping generalized symmetric evp functions

Stéfan van der Walt stefan@sun.ac...
Thu Apr 10 04:44:38 CDT 2008


On 10/04/2008, Robert Cimrman <cimrman3@ntc.zcu.cz> wrote:
> Nathan Bell wrote:
>  > On Tue, Apr 8, 2008 at 8:14 AM, Robert Cimrman <cimrman3@ntc.zcu.cz> wrote:
>  >>  There could be even proper solver classes (LinearSolver,
>  >>  EigenvalueSolver, etc.) with a common interface in each solver family.
>  >>  Below, as an example, is the code we use in sfepy. As you can see, the
>  >>  solver classes have only the __init__ method (can be used e.g. to
>  >>  pre-factorize a matrix in the case of a linear solver) and the __call__
>  >>  method (application of the solver). Would it be interesting to have
>  >>  something in that spirit in scipy?
>  >>
>  >>  class Solver( Struct ):
>  >>      def __init__( self, conf, **kwargs ):
>  >>          Struct.__init__( self, conf = conf, **kwargs )
>  >>      def __call__( self, **kwargs ):
>  >>          print 'called an abstract Solver instance!'
>  >>          raise ValueError
>  >>
>  > <snip>
>  >
>  > Robert, I like the idea of having an abstract interface to the various
>  > solvers/eigensolvers.  I'm currently battling with this in PyAMG for
>  > various coarse-grid solvers and relaxation methods.
>  >
>  > We should definitely pursue this idea further.  In the meantime, we
>  > should strive to make the arguments to the individual solvers as
>  > uniform as possible (e.g. 'tol', 'maxiter', preconditioners, etc).
>  > This will make LinearSolver() etc. easier to create.
>
>
> We could make a proposal on the wiki, let's say
>  http://scipy.org/SolversProposal? If all are ok with this name, I will
>  initiallize the page with what we have in sfepy, to have something to
>  start with.

Developer's info can also go on the Trac wiki.  We haven't discussed
where we want to host such proposals, or what their structures should
be, but we should do that soon; Numpy Enhancement Proposals were
mentioned on the numpy-discussion list just yesterday.

Cheers
Stéfan


More information about the Scipy-dev mailing list