From 47d24efa2afca0d2bb82c092a956ddaf182f47f7 Mon Sep 17 00:00:00 2001 From: moisan Date: Tue, 6 Jan 2009 18:15:28 -0500 Subject: [PATCH] Add more documentation to MatrixComplex and put back a test --- pod/MatrixComplex.pod | 10 +++++++++- t/MatrixComplex.t | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pod/MatrixComplex.pod b/pod/MatrixComplex.pod index 7e05553..1a580b6 100644 --- a/pod/MatrixComplex.pod +++ b/pod/MatrixComplex.pod @@ -186,8 +186,12 @@ Math::GSL::MatrixComplex - Complex Matrices use Math::GSL::MatrixComplex qw/:all/; my $matrix1 = Math::GSL::MatrixComplex->new(5,5); # OO interface - my $matrix2 = gsl_matrix_complex_alloc(5,5); # standard interface + my $matrix3 = $matrix1 + $matrix1; + my $matrix4 = $matrix1 - $matrix1; + if($matrix1 == $matrix1) ... + if($matrix1 != $matrix1) ... + my $matrix2 = gsl_matrix_complex_alloc(5,5); # standard interface =head1 Objected Oriented Interface to GSL Math::GSL::MatrixComplex @@ -486,6 +490,10 @@ sub inverse($) =head2 is_hermitian() +Returns true if the matrix is hermitian, false otherwise + + my $test = $matrix->is_hermitian; + =cut sub is_hermitian() diff --git a/t/MatrixComplex.t b/t/MatrixComplex.t index 7605bb4..cc180d7 100755 --- a/t/MatrixComplex.t +++ b/t/MatrixComplex.t @@ -1,5 +1,5 @@ package Math::GSL::MatrixComplex::Test; -use Test::More tests => 37; +use Test::More tests => 38; use base q{Test::Class}; use strict; @@ -136,7 +136,7 @@ sub MATRIX_IS_HERMITIAN : Tests { my $C = Math::GSL::MatrixComplex->new(2,2) ->set_row(0, [3, 2+1*i] ) ->set_row(1, [2-1*i, 1] ); - # ok( $C->is_hermitian == 1, 'hermitian matrix '); + ok( $C->is_hermitian == 1, 'hermitian matrix '); } sub MATRIX_INVERSE : Tests(3) { -- 2.11.4.GIT