[SciPy-Dev] Python bindings for KLU

Richard Lincoln r.w.lincoln@gmail....
Sat Mar 17 20:08:41 CDT 2012


On 17 March 2012 20:36, Nathaniel Smith <njs@pobox.com> wrote:
> On Mar 17, 2012 5:21 PM, "Richard Lincoln" <r.w.lincoln@gmail.com> wrote:
>>
>> Hello SciPy-Dev,
>
> Hi Richard,
>
>> I am working on a distribution system simulator in Python.  I would
>> like to use KLU to solve sparse sets of complex linear equations.
>>
>> http://www.cise.ufl.edu/research/sparse/klu/
>>
>> What would you recommend I use to create Python bindings for this C
>> library?  I don't have any experience with this and there seem to be
>> several options available.  If you could point me towards any good
>> examples of similar bindings, that too would be very greatly
>> appreciated.
>
> I'd suggest using Cython for bindings, and taking a look at scikits.sparse:
>  https://code.google.com/p/scikits-sparse/
>
> It has quite complete Cython bindings for CHOLMOD:
>  http://packages.python.org/scikits.sparse/cholmod.html
>  https://code.google.com/p/scikits-sparse/source/browse/scikits/sparse/cholmod.pyx
>
> Not only does this give an example of using Cython to work with sparse
> matrices and Tim Davis' code, there's a fair amount of infrastructure
> that can probably be re-used -- I believe that KLU relies on CHOLMOD's
> data structures for basic sparse matrix tasks. If you'd like to
> contribute your work to scikits.sparse, then we can factor this out
> into shared code.

Thank you for the advice Nathaniel.  Unfortunately, my project has a
BSD license and scikits-sparse uses the GNU GPL.  However, I found
scikits-umfpack by Robert Cimrman.

http://scikits.appspot.com/umfpack

It uses SWIG and shouldn't take much effort to adapt.


Thanks again,

Richard


More information about the SciPy-Dev mailing list