http://qs1969.pair.com?node_id=11137121

Lucero has asked for the wisdom of the Perl Monks concerning the following question:

Hello. I wanted to know if is there a module or library in Perl that uses the Jacobi Method and if it is possible to use from Perl routines that have been created in C.

Replies are listed 'Best First'.
Re: Jacobi Method
by Fletch (Bishop) on Sep 29, 2021 at 17:16 UTC

    Searching for "jacobi method" finds passing mention in PDLA::MatrixOps, but if you perhaps asked a more specific question with sample code showing what you're attempting to do you might get a more germane (or possibly even useful) reply.

    As for your second question, yes; see perlxs or Inline::C for example. In general you'd want to search CPAN first because if you're wanting to use an open source C library there's a good chance someone's written a module wrapping it already.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Thank you. What I have to do is find eigenvalues and eigenvectors using that method but I have been asked to use certain routine from the book Numerical Recipes in C.
        An additional PDL module that uses Jacobians within a Levenberg-Marquardt approach is PDL::Fit::Levmar.
        FWIR, jacobi (and SOR, Gauss-Seidel) are basically just averaging values over time steps. How many dimensions are you dealing with and what is the PDE you're solving? PDL almost surely can help you out; but even if not it'd be pretty easy to implement this in pure Perltm.
Re: Jacobi Method
by bliako (Monsignor) on Sep 30, 2021 at 00:16 UTC
Re: Jacobi Method
by karlgoethebier (Abbot) on Sep 29, 2021 at 20:36 UTC

    Until tonight I didn’t know anything about this issue - except that an old friend of mine is named Jacoby. I guess this is what you are looking for. Probably you find a solution in PDL. I don’t know.

    But you might take a look at this. If I’m not totally wrong about what you want.

    If I guessed right you might take a look at Is this a way to Go Perl #1.

    And probably you find a "simple solution" for your problem or at least some further inspiration. And a serious use case to Go Perl.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»