complex.t (PDL-2.076) | : | complex.t (PDL-2.077) | ||
---|---|---|---|---|

skipping to change at line 15 | skipping to change at line 15 | |||

use PDL::Math; | use PDL::Math; | |||

use Test::More; | use Test::More; | |||

sub tapprox { | sub tapprox { | |||

my($x,$y) = @_; | my($x,$y) = @_; | |||

my $c = abs($x-$y); | my $c = abs($x-$y); | |||

my $d = PDL::max($c); | my $d = PDL::max($c); | |||

$d < 0.0001; | $d < 0.0001; | |||

} | } | |||

# capture error in PDL::LinearAlgebra | ||||

{ | ||||

my $info = bless pdl(1), 'PDL::Complex'; | ||||

eval { $info ? 1 : 0 }; | ||||

is $@, '', 'no error in comparison'; | ||||

} | ||||

#Type of cplx and cmplx | #Type of cplx and cmplx | |||

my $x=PDL->sequence(2); | my $x=PDL->sequence(2); | |||

my $y=$x->cplx; | my $y=$x->cplx; | |||

is(ref $y, 'PDL::Complex', 'type of cplx'); | is(ref $y, 'PDL::Complex', 'type of cplx'); | |||

is(ref $x, 'PDL', "cplx doesn't modify original pdl"); | is(ref $x, 'PDL', "cplx doesn't modify original pdl"); | |||

my $z=$y->real; | my $z=$y->real; | |||

is(ref $z, 'PDL', 'real returns type to pdl'); | is(ref $z, 'PDL', 'real returns type to pdl'); | |||

is(ref $y, 'PDL::Complex', "real doesn't change type of parent"); | is(ref $y, 'PDL::Complex', "real doesn't change type of parent"); | |||

#Should there be a real subroutine, such as complex, that does change | #Should there be a real subroutine, such as complex, that does change | |||

#the parent? | #the parent? | |||

End of changes. 1 change blocks. | ||||

0 lines changed or deleted | | 7 lines changed or added |