in reply to perl PDL question
This inserts a dummy dimension into $a so that $a is dimensionality (10,1) and $b is dimensionality (1,3). Dimensions of length 1 get threaded over nicely. The sumover is there to take away 1 of the dimensions (otherwise you get location in $a times location in $b) for matchesmy $a = sequence(10)->dummy; my $b = pdl(2,5,7); my $z = which(sumover($a == $b));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl PDL question
by Anonymous Monk on Nov 27, 2007 at 11:34 UTC | |
by nickschurch (Acolyte) on Nov 28, 2007 at 01:53 UTC | |
|
Re^2: perl PDL question
by nickschurch (Acolyte) on Nov 28, 2007 at 02:39 UTC | |
by Anonymous Monk on Nov 28, 2007 at 07:53 UTC | |
by nickschurch (Acolyte) on Nov 29, 2007 at 04:22 UTC |