in reply to Surface fitting with PDL
I'm not an expert regarding PDL, but it's safe to say that re-arranging 2d data into 1d is a very cheap operation. There is no data movement involved - it's just the creation of a new index to the existing data.
UPDATE
Just to give an impression:
#!/usr/bin/perl use strict; use warnings; use feature 'say'; use PDL; my $p2d = sequence(3, 3); say $p2d; my $p1d = $p2d->clump(0, 1); say $p1d; $p1d->set(4, 42); say $p2d; __DATA__ [ [0 1 2] [3 4 5] [6 7 8] ] [0 1 2 3 4 5 6 7 8] [ [ 0 1 2] [ 3 42 5] [ 6 7 8] ]
Greetings,
-jo
|
|---|