[SciPy-dev] help: wrapping generalized symmetric evp functions
Ondrej Certik
ondrej at certik.cz
Thu Apr 10 07:32:51 EDT 2008
On Thu, Apr 10, 2008 at 10:34 AM, Robert Cimrman <cimrman3 at ntc.zcu.cz> wrote:
> Nathan Bell wrote:
> > On Tue, Apr 8, 2008 at 8:14 AM, Robert Cimrman <cimrman3 at 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.
Please start the page.
Ondrej
More information about the SciPy-Dev
mailing list