Fixed the Linalg test. The only problem was that the gsl_permutation header file...
[Math-GSL.git] / lib / Math / GSL / Linalg / Test.pm
bloba2774a59a825e9c6754253398b74d7cb3a53ff44
1 package Math::GSL::Linalg::Test;
2 use base q{Test::Class};
3 use Test::More;
4 use Math::GSL::Linalg qw/:all/;
5 use Math::GSL::Matrix qw/:all/;
6 use Math::GSL::Permutation qw/:all/;
7 use Math::GSL qw/:all/;
8 use Data::Dumper;
9 use Math::GSL::Errno qw/:all/;
10 use strict;
12 sub make_fixture : Test(setup) {
13 my $self = shift;
14 $self->{matrix} = gsl_matrix_alloc(5, 5);
17 sub teardown : Test(teardown) {
18 unlink 'linalg' if -f 'linalg';
21 sub GSL_LINALG_LU_DECOMP : Tests {
22 my $self = shift;
24 for my $row (0..4) {
25 map { gsl_matrix_set($self->{matrix}, $row, $_, $_) } (0..4);
28 my $permutation = gsl_permutation_alloc(5);
29 gsl_permutation_init($permutation);
30 my ($result, $signum) = gsl_linalg_LU_decomp($self->{matrix}, $permutation);
31 is_deeply( [ $result, $signum ], [ 0, 1] );