Math::MatrixReal::Aug

Math::MatrixReal::Aug Perl module contains additional methods for Math::MatrixReal.
Download

Math::MatrixReal::Aug Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jacob C. Kesinger
  • Publisher web site:
  • http://search.cpan.org/~kesinger/Math-MatrixReal-Aug-0.02/Aug.pm

Math::MatrixReal::Aug Tags


Math::MatrixReal::Aug Description

Math::MatrixReal::Aug Perl module contains additional methods for Math::MatrixReal. SYNOPSIS use Math::MatrixReal; use Math::MatrixReal::Aug;These are certain extra methods for Math::MatrixReal, in the tradition of Math::MatrixReal::Ext1;$matrix1->augmentright($matrix2); Creates a new matrix of the form . $matrix1 and $matrix2 must have the same number of rows.Example: $A = Math::MatrixReal->new_from_cols(]); $B = Math::MatrixReal->new_from_cols(,]); $C = $A / $B print $C; $matrix1->augmentbelow($matrix2); Creates a new matrix of the form . $matrix1 and $matrix2 must have the same number of columns.Example: $A = Math::MatrixReal->new_from_cols(,]); $B = Math::MatrixReal->new_from_cols(,]); $C = $A / $B print $C; $matrix->applyfunction($coderef) Applies &$coderef to each element of $matrix, and returns the result. $coderef should be a reference to a subroutine that takes four parameters: ($matrix, $matrix->element($i,$j), $i, $j) where $i and $j are the row and column indices of the current element.Example: sub increment { my ($matrix,$element, $i,$j)=@_; return $element+1; } $A = Math::MatrixReal->new_from_cols(,]); $E=$A->applyfunction(&increment); print $E; $matrix->largeexponential($exponent) Finds $matrix^$exponent using the square-and-multiply method. $matrix must be square and $exponent must be a positive integer. Much more efficient for large $exponent than $matrix->$exponential($exponent) in that approximately log2($exponent) multiplications are required instead of approximately $exponent.$matrix->fill($const); Sets all elements of $matrix equal to $const.Example: $A = new Math::MatrixReal(3,3); $A->fill(4); print $A; $new_matrix = $some_matrix->newfill($rows,$columns,$const); $new_matrix = Math::MatrixReal->newfill($rows,$columns,$const); Creates a new matrix of the specified size, all the elements of which are $const.Example: $A = Math::MatrixReal->newfill(3,3,4); print $A; Requirements:· Perl Requirements: · Perl


Math::MatrixReal::Aug Related Software