transform.t (PDL-2.080) | : | transform.t (PDL-2.081) | ||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
my $t2 = t_linear(scale=>[2,3]); | my $t2 = t_linear(scale=>[2,3]); | |||
ok( $t2->{idim} == 2 && $t2->{odim} == 2, "t_linear can make a 2-d transf orm" ); | ok( $t2->{idim} == 2 && $t2->{odim} == 2, "t_linear can make a 2-d transf orm" ); | |||
$pb = $pa->apply($t2); | $pb = $pa->apply($t2); | |||
ok( all( approx( $pb, pdl( [2, 6], [6, 12] ) )), "2-d apply treats the hi gher dim"); | ok( all( approx( $pb, pdl( [2, 6], [6, 12] ) )), "2-d apply treats the hi gher dim"); | |||
$pb = pdl(2,3)->invert($t2); | $pb = pdl(2,3)->invert($t2); | |||
ok( all( approx($pb, 1) ), "invert works"); | ok( all( approx($pb, 1) ), "invert works"); | |||
my $t3 = t_rot([45,45,45]); | ||||
$pa = PDL::MatrixOps::identity(3); | ||||
my $got = $pa->apply($t3); | ||||
ok all(approx $got, pdl(<<'EOF'), 1e-4), 't_rot works' or diag 'got=', $g | ||||
ot; | ||||
[ | ||||
[ 0.5 -0.14644661 0.85355339] | ||||
[ 0.5 0.85355339 -0.14644661] | ||||
[-0.70710678 0.5 0.5] | ||||
] | ||||
EOF | ||||
} | } | |||
{ | { | |||
############################## | ############################## | |||
# Simple testing of the map autoscaling | # Simple testing of the map autoscaling | |||
my $pa = sequence(5,5); | my $pa = sequence(5,5); | |||
{ | { | |||
# Identity transformation should be an expensive no-op | # Identity transformation should be an expensive no-op | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 12 lines changed or added |