Adding some tests for gsl_complex_vector function and one fail, in link with the...
[Math-GSL.git] / lib / Math / GSL / CBLAS / Test.pm
blob8f06304e1985c9551734907650855d9ef02b814f
1 package Math::GSL::CBLAS::Test;
2 use base q{Test::Class};
3 use Test::More;
4 use Math::GSL::CBLAS qw/:all/;
5 use Math::GSL qw/:all/;
6 use Data::Dumper;
7 use Math::GSL::Errno qw/:all/;
8 use strict;
10 sub make_fixture : Test(setup) {
13 sub teardown : Test(teardown) {
16 #sub TEST_CBLAS : Tests {
18 # my $A = [ 0.11, 0.12, 0.13,
19 # 0.21, 0.22, 0.23 ];
20 # my $lda = 3;
22 # my $B = [ 1011, 1012,
23 # 1021, 1022,
24 # 1031, 1032 ];
25 # my $ldb = 2;
28 # my $C = [0.00, 0.00,
29 # 0.00, 0.00 ];
30 # my $ldc = 2;
32 # # Compute C = A * B
33 # # C = [ 367.76 368.12 ]
34 # # [ 674.06 674.72 ]
35 # local $TODO = "need typemap for float const *";
36 # cblas_sgemm ($CblasRowMajor,
37 # $CblasNoTrans, $CblasNoTrans, 2, 2, 3,
38 # 1.0, $A, $lda, $B, $ldb, 0.0, $C, $ldc);
39 # print Dumper [ $C ];
42 sub CBLAS_IDAMAX : Tests {
43 my $N = 1;
44 my $X = 0.247;
45 my $incX = -1;
46 my $expected = 0;
47 my $k;
48 $k = cblas_idamax($N, $X, $incX);
49 is($k, $expected);
52 sub CBLAS_ISAMAX : Tests {
53 my $N = 1;
54 my $X = -0.388;
55 my $incX = -1;
56 my $expected = 0;
57 my $k = cblas_isamax($N, $X, $incX);
58 is($k, $expected);
61 sub CBLAS_SASUM : Tests {
62 my $N = 1;
63 my $X = 0.239;
64 my $incX = -1;
65 my $expected = 0.0;
66 my $f = cblas_sasum($N, $X, $incX);
67 is($f, $expected);
71 sub CBLAS_DASUM : Tests {
72 my $N = 1;
73 my $X = -0.413;
74 my $incX = -1;
75 my $expected = 0;
76 my $f = cblas_dasum($N, $X, $incX);
77 is($f, $expected);