Debian Codegraph @

t/poly.t

raw symbols SCIP
1 use strictscip-perl cpan PDL-Fit 2.101 strict/;
2 use warningsscip-perl cpan PDL-Fit 2.101 warnings/;
3 use Test::Morescip-perl cpan PDL-Fit 2.101 Test/More/;
4 use PDL::LiteFscip-perl cpan PDL-Fit 2.101 PDL/LiteF/;
5 use PDL::Fit::Polynomialscip-perl cpan PDL-Fit 2.101 PDL/Fit/Polynomial/;
6
7 my $x = sequencescip-perl cpan PDL-Fit 2.101 main/sequence().(20)-10;
8 my $y = 30-2*$x+3*$x**2-2*$x**3;
9
10 # Random numbers, generated by grandom($y)*100
11 # Hard-wired to avoid OS seed variations barfing test
12
13 my $rand = pdl qw/65.735917 -40.510143 -122.07767 -19.591344 -139.76362
14 106.44639 -0.30094068 -5.3129683 49.815455 97.247868 -9.3130775
15 19.585472 8.5260268 -194.49596 73.822799 25.628967 133.36015 -2.6611465
16 9.0335632 -0.82946383/;
17
18 $y += $rand;
19
20 #points $x,$y;
21
22 my $yfit = fitpoly1dscip-perl cpan PDL-Fit 2.101 main/fitpoly1d().($x,$y,4);
23
24 #hold; line $x, $yfit;
25
26 okscip-perl cpan PDL-Fit 2.101 main/ok().(maxscip-perl cpan PDL-Fit 2.101 main/max().(absscip-perl cpan PDL-Fit 2.101 main/abs().($y-$yfit)) < 220); # need to add 10 for windows
27
28 done_testing;