in reply to How to make matrix/piddle/array with PDL or perl.
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make matrix/piddle/array with PDL or perl.
by Anonymous Monk on Sep 27, 2010 at 15:55 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2010 at 16:08 UTC |