Neither Perl, nor (as far as I'm aware), PDL provides a mechanism for creating banded (sparse) matrices. You could use normal rectangular matrix, and just ignore the zeros, but for large dimensions, that would waste a lot of space.
However, the "normal" way of dealing with them, is to map the active elements to an appropriately sized (smaller) rectangular matrix. The mapping is very simple & regular. A simple sub that maps the original coordinates to the reduced matrix should be pretty simple to write.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Thank you.
Perhaps I should post this as a new question, but I was going to write a spline interpolation code so I could modify it for other forms of interpolation. Hence the reason I wanted to make the band matrix so I could invert it. How might I do that without the matrix itself?
| [reply] |
Sorry. Programmer here, not a mathematician.
You're going to have to couch that question in English for me to be able to understand it :)
I'd suggest that you supply a (say) 5x6 3-band matrix as input; and the required output of the inversion.
(Don't forget the <code></code> tags.)
I suspect, that once you have a subroutine that maps the sparse matrix coordinates to the compact rectangular matrix coords, that applying the inversion algorithm in terms of the pre-map coordinates will effect the require transformation upon the compact representation. But I'd need to see it spelt out in english to be sure.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
For common algorithms, they are likely to be in one of LAPACK or GSL. PDL has bindings to both LAPACK (PDL::LinearAlgebra) and GSL (PDL::GSL). | [reply] |