complex.t (PDL-2.077) | : | complex.t (PDL-2.078) | ||
---|---|---|---|---|
skipping to change at line 129 | skipping to change at line 129 | |||
# $x->re*$y->im+$x->im*$y->re)), 'Value of Cmul'); | # $x->re*$y->im+$x->im*$y->re)), 'Value of Cmul'); | |||
is(ref Cscale($x,$a), 'PDL::Complex', 'Type of Cscale with scalar'); | is(ref Cscale($x,$a), 'PDL::Complex', 'Type of Cscale with scalar'); | |||
ok(tapprox(Cscale($x,$a)->real, $x->real*$a), 'Value of Cscale with scalar'); | ok(tapprox(Cscale($x,$a)->real, $x->real*$a), 'Value of Cscale with scalar'); | |||
is(ref Cscale($x,$pa), 'PDL::Complex', 'Type of Cscale with pdl'); | is(ref Cscale($x,$pa), 'PDL::Complex', 'Type of Cscale with pdl'); | |||
ok(tapprox(Cscale($x,$pa)->real, $x->real*$pa), 'Value of Cscale with pdl'); | ok(tapprox(Cscale($x,$pa)->real, $x->real*$pa), 'Value of Cscale with pdl'); | |||
#is(ref Cdiv($x,$y), 'PDL::Complex', 'Type of Cdiv'); | #is(ref Cdiv($x,$y), 'PDL::Complex', 'Type of Cdiv'); | |||
#ok(tapprox(Cdiv($x,$y)->real, | #ok(tapprox(Cdiv($x,$y)->real, | |||
# Cscale(Cmul($x,$y->Cconj), 1/$y->Cabs2)->real), 'Value of Cdiv'); | # Cscale(Cmul($x,$y->Cconj), 1/$y->Cabs2)->real), 'Value of Cdiv'); | |||
# to test Cabs, Cabs2, Carg (ref PDL) | # to test Cabs, Cabs2, Carg (ref PDL) | |||
ok(tapprox($x->Cconj->im, -2), 'Cconj works'); | ||||
ok(tapprox($x->conj->im, -2), 'conj works'); | ||||
$x = cplx($ref); | $x = cplx($ref); | |||
my $cabs = sqrt($x->re**2+$x->im**2); | my $cabs = sqrt($x->re**2+$x->im**2); | |||
is(ref Cabs $x, 'PDL', 'Cabs type'); | is(ref Cabs $x, 'PDL', 'Cabs type'); | |||
is(ref Cabs2 $x, 'PDL', 'Cabs2 type'); | is(ref Cabs2 $x, 'PDL', 'Cabs2 type'); | |||
is(ref Carg $x, 'PDL', 'Carg type'); | is(ref Carg $x, 'PDL', 'Carg type'); | |||
ok(tapprox($cabs, Cabs $x), 'Cabs value'); | ok(tapprox($cabs, Cabs $x), 'Cabs value'); | |||
ok(tapprox($cabs**2, Cabs2 $x), 'Cabs2 value'); | ok(tapprox($cabs**2, Cabs2 $x), 'Cabs2 value'); | |||
ok(tapprox(atan2($x->im, $x->re), Carg $x), 'Carg value'); | ok(tapprox(atan2($x->im, $x->re), Carg $x), 'Carg value'); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added |