1use Test::More tests => 5;
2use PDL::LiteF;
3use PDL::Reduce;
4
5use strict;
6use warnings;
7
8my $pa = sequence 5,5;
9my $pb = $pa->reduce('add',0);
10
11ok(all $pb == $pa->sumover);
12ok(all $pa->reduce('add',1) == $pa->mv(1,0)->sumover);
13ok(all $pa->reduce('mult',1) == $pa->mv(1,0)->prodover);
14# test the new reduce features
15ok($pa->reduce('+',0,1) == sum $pa); # reduce over list of dims
16ok(all $pa->reduce(\&PDL::sumover) == $pa->sumover); # use code refs
17