6 use Math
::GSL
::Vector qw
/:all/;
7 use Math
::GSL
::Errno qw
/:all/;
8 use Math
::GSL
::RNG qw
/:all/;
9 use Math
::GSL
::BLAS qw
/:all/;
12 my $count = shift || 500_000
;
13 my $dim = shift || 10;
14 my $rng = Math
::GSL
::RNG
->new;
15 my @nums = map { $rng->get % 100 } (1..$dim);
17 my $x = Math
::GSL
::Vector
->new( \
@nums );
18 my $y = $x->copy + int(rand(100));
20 warn Dumper
[ $x->as_list ];
21 warn Dumper
[ $y->as_list ];
23 warn Dumper
[ pp_dot
($x,$y) ];
24 warn Dumper
[ gsl_dot
($x,$y) ];
28 'pp_dot ' => sub { pp_dot
($x,$y) },
29 'gsl_dot ' => sub { gsl_dot
($x,$y) },
30 'overload_dot ' => sub { $x * $y },
35 my ($status,$dot) = gsl_blas_ddot
($x->raw,$y->raw);
42 return Math
::GSL
::Vector
::dot_product_pp
($x,$y);