~ubuntu-branches/ubuntu/natty/libstatistics-basic-perl/natty

« back to all changes in this revision

Viewing changes to t/20_LSF.t

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur, Nathan Handler, Ryan Niebur
  • Date: 2009-07-01 20:22:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090701202206-0co1izn0pj047x4i
Tags: 1.6600-1
[ Nathan Handler ]
* debian/watch: Update to ignore development releases.

[ Ryan Niebur ]
* New upstream release
* Debian Policy 3.8.2
* enable author tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
use Test;
4
4
use Statistics::Basic;
5
5
 
6
 
plan tests => 8;
 
6
plan tests => 10;
7
7
 
8
8
my $lsf = new Statistics::Basic::LeastSquareFit([1 .. 10], [1 .. 10]);
9
9
 
10
 
ok $lsf->query->[0] == 0; # alpha
11
 
ok $lsf->query->[1] == 1; # beta
 
10
ok( $lsf->query->[0], 0); # alpha
 
11
ok( $lsf->query->[1], 1); # beta
12
12
   
13
13
   $lsf->set_vector([1 .. 10], [map((3 + $_ * 4), 1 .. 10)]);
14
14
 
15
 
ok $lsf->query->[0] == 3; # alpha
16
 
ok $lsf->query->[1] == 4; # beta
 
15
ok( $lsf->query->[0], 3); # alpha
 
16
ok( $lsf->query->[1], 4); # beta
17
17
 
18
18
my $j = new Statistics::Basic::LeastSquareFit;
19
19
   $j->set_vector([1 .. 10], [1 .. 10]);
20
 
ok $j->query->[0] == 0; # alpha
21
 
ok $j->query->[1] == 1; # beta
 
20
ok( $j->query->[0], 0); # alpha
 
21
ok( $j->query->[1], 1); # beta
22
22
 
23
23
my $k = new Statistics::Basic::LeastSquareFit;
 
24
my @v = ($k->query_vector1, $k->query_vector2);
24
25
 
25
26
my @a = (1 .. 10);
26
27
my @b = map(13 + $_*19, 1 .. 10);
28
29
    $k->ginsert($a[$i], $b[$i]);
29
30
}
30
31
 
31
 
ok $k->query->[0] == 13; # alpha
32
 
ok $k->query->[1] == 19; # beta
 
32
ok( $k->query->[0], 13); # alpha
 
33
ok( $k->query->[1], 19); # beta
 
34
 
 
35
# test overloads
 
36
my ($alpha, $beta) = $j->query;
 
37
ok( "$j", qr/.*alpha.*$alpha.*beta.*$beta/ );
 
38
ok( not eval { my $test = 0+$j; 1 } );