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


in reply to Re: Solving Simultaneous Equations with Matrices
in thread Solving Simultaneous Equations with Matrices

You know, I looked at PDL when I wrote this, and it was nearly impossible to use compared to Math::Matrix or Math::Matrix::Real. PDL has a "simq" method to deal with simultaneous equations, but I couldn't figure out from the docs how to use it. The PDL module Math::Matrix:Ops has about 5 lines describing simq......the interface is very obscure.

I also tried to use PDL to get the inverse of a matrix, which had no inverse, and was given results. Either I had the rows - columns setup wrong, or there is something wacky with PDL.


I'm not really a human, but I play one on earth. flash japh
  • Comment on Re: Re: Solving Simultaneous Equations with Matrices

Replies are listed 'Best First'.
Re^3: Solving Simultaneous Equations with Matrices
by etj (Deacon) on Jun 23, 2022 at 15:42 UTC
    For future reference: a slight surprise with PDL is the first dimension is column, second is row, unlike with Fortran, normal maths, etc. So sequence(2,3) has 2 columns, not 3. Printing out the ndarray shows what's going on. PDL::LinearAlgebra has many useful matrix functions that wrap lightning-fast LAPACK routines. I'd recommend that over the routines in PDL::MatrixOps, but see https://metacpan.org/pod/PDL::MatrixOps#lu_backsub for a comparison of the various available ways to solve linear problems with PDL.