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

Ondrej Certik ondrej at certik.cz
Thu Apr 10 09:16:37 EDT 2008


On Thu, Apr 10, 2008 at 2:14 PM, Robert Cimrman <cimrman3 at ntc.zcu.cz> wrote:
> Stéfan van der Walt wrote:
>  > On 10/04/2008, Robert Cimrman <cimrman3 at ntc.zcu.cz> wrote:
>
> >> 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.
>
>  Yes, I agree that a standard way of hosting such proposals would be
>  handy. Anyway, I have created the page, so that we can start discussing
>  now. After the right place is agreed upon we can move it easily.

Thanks, "Now is better than never.".

To get the discussion going, here are some comments. Everyone please
let us know what you think:

1)

> s = Solver.anyFromConf( conf, mtx = A ) # Possible pre-solves by LU.

How about this:

s = Solver(conf, mtx = A )

and also this (together with the syntax above):

s = Solver(kind="ls.scipy_iterative", method="cg", mtx = A )

This is useful for reading the configuration from some file. However,
sometimes (a lot of times) I prefer this:

2) how about this:

class SciPyIterative(LinearSolver):
    blabla

class CG(SciPyIterative):
    pass

class Umfpack(LinearSolver):
    pass

and people would just use:

from scipy.sparse.linalg import CG, Umfpack

s = CG(epsA=1e-6, mtx=A)

or

s = Umfpack(mtx=A)

3) I also prefer to pass the matrix as the first argument, becuase you
always need to supply a matrix, only then some optinal default
arguments, or preconditioners, i.e.:

s = CG(A, epsA=1e-6)

or

s = Umfpack(A)

Ondrej


More information about the SciPy-Dev mailing list