Finally got @EXPORT_OK/%EXPORT_TAGS to work, initially implemented on the PowInt...
[Math-GSL.git] / t / Poly.t
blob82aec3876672c5e8a7f8ca9c47cc31007e7c3685
1 use Test::More 'no_plan';
2 use Math::GSL;
3 use Math::GSL::Errno;
4 use Math::GSL::Poly;
5 use Data::Dumper;
6 use strict;
7 use warnings;
11     my $z = Math::GSL::Poly::gsl_complex->new;
12    
13     ok( defined $z && $z->isa('Math::GSL::Poly'), 'gsl_complex->new returns correct object');
17     my $gsl = Math::GSL->new;
19     my $vals = Math::GSL::Poly::new_doubleArray(3);
21     #fugly
22     Math::GSL::Poly::doubleArray_setitem($vals, 0, 3.14);
23     Math::GSL::Poly::doubleArray_setitem($vals, 1, 2.72);
24     Math::GSL::Poly::doubleArray_setitem($vals, 2, 5.55);
26     my $y = Math::GSL::Poly::gsl_poly_eval( $vals , 3, 1.0);
28     ok( abs($y - (3.14+2.72+5.55) ) < 1e-8, 'gsl_poly_eval' );