File tree 1 file changed +6
-13
lines changed
1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -3,22 +3,15 @@ use warnings;
3
3
use Test::More;
4
4
use PDL::LiteF;
5
5
use PDL::GSL::CDF;
6
+ use Test::PDL;
6
7
7
- sub tapprox {
8
- my ($a ,$b ) = @_ ;
9
- my $diff = abs($a -$b );
10
- # use max to make it perl scalar
11
- ref $diff eq ' PDL' and $diff = $diff -> max;
12
- return $diff < 1.0e-6;
13
- }
14
8
{
15
9
my $a = sequence 5;
16
- my $a_bad = sequence 6;
17
- $a_bad -> setbadat(-1);
18
- is( tapprox( $a -> gsl_cdf_tdist_P(1999)-> sum, 4.31706715604714 ), 1 );
19
- is( tapprox( $a_bad -> gsl_cdf_tdist_P(1999)-> sum, 4.31706715604714 ), 1 );
20
- is( tapprox( $a -> gsl_cdf_fdist_P(1,1999)-> sum, 3.39605941459337 ), 1 );
21
- is( tapprox( $a_bad -> gsl_cdf_fdist_P(1,1999)-> sum, 3.39605941459337 ), 1 );
10
+ my $a_bad = $a -> append(pdl ' BAD' );
11
+ is_pdl $a -> gsl_cdf_tdist_P(1999), my $texp = pdl(' 0.5 0.841284230695725 0.977182329566921 0.998633419750658 0.999967176033837' );
12
+ is_pdl $a_bad -> gsl_cdf_tdist_P(1999), $texp -> append(pdl ' BAD' );
13
+ is_pdl $a -> gsl_cdf_fdist_P(1,1999), my $fexp = pdl(' 0 0.682568461391451 0.842545068166059 0.916581225902023 0.95436465913384' );
14
+ is_pdl $a_bad -> gsl_cdf_fdist_P(1,1999), $fexp -> append(pdl ' BAD' );
22
15
}
23
16
{
24
17
my $x = pdl(' [0.185 0.242 0.385 0.528 0.671 0.814]' );
You can’t perform that action at this time.
0 commit comments