#11 Add more generic linear solver (like lapack dgels) for simq

open
nobody
None
2
2009-04-29
2009-04-19
Jan
No

For a project, I need some routines to handle over/under determined matrices with.
I have a project that I started out in PDL, and I want to extend.
Unfortunately, PDL is very limited in this respect, and only gives the simq function.

In other programs (written in C), I have used the lapack routines for this task.
http://www.netlib.org/lapack/explore-html/dgels.f.html
I have no experience in writing interface routines from PDL to external functions.
Has anybody made a lapack interface from PDL ?

Discussion

  • Chris Marshall
    Chris Marshall
    2009-04-22

    Jan-

    I haven't seen any lapack bindings for PDL. One issue is that lapack is in fortran which requires more hand wrapping to interface to perl in general or PDL specifically. For PDL development, we've been reducing the dependence on non-C packages and libraries to improve portability and buildability of PDL.

    That said, some of the same functionality you mention is available via the GNU Scientific Library which is written in C and thus easy to interface to PDL. In fact, the basic linear algebra routines could be done with some Inline::Pdlpp code to provide the PDL functions. Try perldoc Inline::Pdlpp to get you started.

    --Chris

     
  • Chris Marshall
    Chris Marshall
    2009-04-29

    • priority: 5 --> 2
     
  • Chris Marshall
    Chris Marshall
    2009-04-29

    I've added feature request #2784029 for enhanced GSL support in PDL which would include the linear solver functions.

     
  • eartoaster
    eartoaster
    2009-04-30

    Well, in general BLAS/LAPACK bindings would be great, as this is a kind of standard interface, with highly optimized implementations available, such as Intel MKL on x86; up until now, there seems to be a CUDA
    (nvidia) implementation of BLAS.
    therefore we would profit performance-wise for operations that are covered within these libraries...

     
  • Chris Marshall
    Chris Marshall
    2009-05-01

    For portability, we've had more success with functionality from external C libraries because if you can build perl, you have a C compiler. LAPACK would be a great functionality to have. For future PDL development, the goal is to move to a more modular framework approach where external libraries are in external PDL modules...still fully installable via CPAN and other install methods but not preventing the install of the basic, core PDL module functionality.

     
  • Terry Gaetz
    Terry Gaetz
    2009-05-01

    There is also a c (f2c'd) version of lapack available; see http://www.netlib.org/clapack

     
  • Jan
    Jan
    2009-06-01

    test program for lapack

     
    Attachments
  • Jan
    Jan
    2009-06-01

    I've attached a .pl file and a .pm file.
    I have started with 425 lapack source files (excluding single precision and complex).
    The .pm file has definitions from 278 of these, generated automatically (so not verified).

    I do not yet know how to return function values (documentation of PP is unclear if this should be the first, or the last [o] parameter, and I have not checked it.

    These files do not compile outright (> 3Gb swap space needed !?).
    Keep only the definitions you need.
    If you keep only dgesv and dsyev, the test program runs well.

     
  • Jan
    Jan
    2009-06-02

    update for the library and the test program

     
    Attachments