Hi Steve,

I think it's an error in the documentation. PDL::Ops claims that ~ serves as an alias to 'bitnot'.

Is there anywhere else besides PDL::Impatient that you saw a reference to ~ as a transpose operator?

cheers,
Derek

Steve Chapel wrote:

Running the following program:

#!/usr/bin/perl
use PDL;
my $y = pdl([[1,2,3],[4,5,6],[7,8,9]]);
print ~$y;

using ActivePerl 5.8.8.820 and PDL 2.4.3 gives the following output:

[
[ -2 -3 -4]
[ -5 -6 -7]
[ -8 -9 -10]
]

According to the PDL documentation
<http://pdl.sourceforge.net/PDLdocs/Impatient.html#matrix_functions>,
"transpose() does what it says and is a convenient way to turn row vectors
into column vectors. It is bound to the unary operator '~' for convenience."
However, transpose() returns the expected result:

[
[1 4 7]
[2 5 8]
[3 6 9]
]

Is this a bug in PDL? An error in the documentation?

Thanks,
Steve

------------------------------------------------------------------------

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to