blib/script/gsl_cpp_manual.pl untested

filter: Statementstmt 0.0% 0 / 41 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 45 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2  
3 use Data::Dumper;
4 use perlgsl; # give us Math::GSL::Matrix
5  
6 # does not seem to be necessary to trigger -D__CPP__TYPES
7 #use perltypes;
8 #perltypes::types_enable('CPP');
9  
10 use Perl::Structure::GSLMatrix qw(gsl_matrix_typetest0 gsl_matrix_typetest1 gsl_matrix_typetest99);
11  
12 use Perl::Structure::GSLMatrix_cpp;
13 #Perl::Structure::GSLMatrix_cpp::cpp_load();
14  
15  
16  
17  
18  
19 print "#=" x 30, "\n";
20 print "#=" x 30, "\n";
21 print "\n\n";
22  
23 print 'have main::Perl__Structure__GSLMatrix__MODE_ID() = ', main::Perl__Structure__GSLMatrix__MODE_ID(), "\n";
24 print 'have main::gsl_matrix_typetest99() = ', main::gsl_matrix_typetest99(), "\n";
25  
26 my gsl_matrix $m_typetest0 = gsl_matrix_typetest0();
27 print 'have $m_typetest0 = ', Dumper($m_typetest0);
28 print 'have gsl_matrix_get($m_typetest0, 0, 0) = ', gsl_matrix_get($m_typetest0, 0, 0), "\n";
29 print "\n\n";
30  
31 my gsl_matrix $m_typetest1a = gsl_matrix_alloc(2, 2);
32 gsl_matrix_set($m_typetest1a, 0, 0, 10);
33 gsl_matrix_set($m_typetest1a, 0, 1, 15);
34 gsl_matrix_set($m_typetest1a, 1, 0, 20);
35 gsl_matrix_set($m_typetest1a, 1, 1, 25);
36 print 'have pre-call gsl_matrix_get($m_typetest1a, 0, 0) = ', gsl_matrix_get($m_typetest1a, 0, 0), "\n";
37 print 'have pre-call gsl_matrix_to_string($m_typetest1a) = ', "\n", gsl_matrix_to_string($m_typetest1a), "\n";
38 $m_typetest1a = gsl_matrix_typetest1($m_typetest1a);
39 print 'have post-call gsl_matrix_get($m_typetest1a, 0, 0) = ', gsl_matrix_get($m_typetest1a, 0, 0), "\n";
40 print 'have post-call gsl_matrix_to_string($m_typetest1a) = ', "\n", gsl_matrix_to_string($m_typetest1a), "\n";
41 print "\n\n";
42  
43 my gsl_matrix $m_typetest1b = number_arrayref_to_gsl_matrix([20, 40, 60, 80], 2, 2);
44 print 'have pre-call gsl_matrix_to_string($m_typetest1b) = ', "\n", gsl_matrix_to_string($m_typetest1b), "\n";
45 $m_typetest1b = gsl_matrix_typetest1($m_typetest1b);
46 print 'have post-call gsl_matrix_to_string($m_typetest1b) = ', "\n", gsl_matrix_to_string($m_typetest1b), "\n";
47  
48  
49 print "\n\n";
50 print "#=" x 30, "\n";
51 print "#=" x 30, "\n";
52  
53  
54 __END__