Provided by: libpdl-linearalgebra-perl_0.08-1build1_amd64
NAME
PDL::LinearAlgebra::Trans - Linear Algebra based transcendental functions for PDL
SYNOPSIS
use PDL::LinearAlgebra::Trans; $a = random (100,100); $sqrt = msqrt($a);
DESCRIPTION
This module provides some transcendental functions for matrices. Moreover it provides sec, asec, sech, asech, cot, acot, acoth, coth, csc, acsc, csch, acsch. Beware, importing this module will overwrite the hidden PDL routine sec. If you need to call it specify its origin module : PDL::Basic::sec(args)
FUNCTIONS
geexp Signature: ([io,phys]A(n,n);int deg();scale();[io]trace();int [o]ns();int [o]info()) Computes exp(t*A), the matrix exponential of a general matrix, using the irreducible rational Pade approximation to the exponential function exp(x) = r(x) = (+/-)( I + 2*(q(x)/p(x)) ), combined with scaling-and-squaring and optionaly normalization of the trace. The algorithm is described in Roger B. Sidje (rbs.uq.edu.au) "EXPOKIT: Software Package for Computing Matrix Exponentials". ACM - Transactions On Mathematical Software, 24(1):130-156, 1998 A: On input argument matrix. On output exp(t*A). Use Fortran storage type. deg: the degre of the diagonal Pade to be used. a value of 6 is generally satisfactory. scale: time-scale (can be < 0). trace: on input, boolean value indicating whether or not perform a trace normalization. On output value used. ns: on output number of scaling-squaring used. info: exit flag. 0 - no problem > 0 - Singularity in LU factorization when solving Pade approximation = random(5,5); = pdl(1); ->xchg(0,1)->geexp(6,1,, ( = null), ( = null)); geexp does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. cgeexp Signature: ([io,phys]A(2,n,n);int deg();scale();int trace();int [o]ns();int [o]info()) Complex version of geexp. The value used for trace normalization is not returned. The algorithm is described in Roger B. Sidje (rbs@maths.uq.edu.au) "EXPOKIT: Software Package for Computing Matrix Exponentials". ACM - Transactions On Mathematical Software, 24(1):130-156, 1998 cgeexp does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ctrsqrt Signature: ([io,phys]A(2,n,n);int uplo();[phys,o] B(2,n,n);int [o]info()) Root square of complex triangular matrix. Uses a recurrence of Bjoerck and Hammarling. (See Nicholas J. Higham. A new sqrtm for MATLAB. Numerical Analysis Report No. 336, Manchester Centre for Computational Mathematics, Manchester, England, January 1999. It's available at http://www.ma.man.ac.uk/~higham/pap-mf.html) If uplo is true, A is lower triangular. ctrsqrt does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. ctrfun Signature: ([io,phys]A(2,n,n);int uplo();[phys,o] B(2,n,n);int [o]info(); SV* func) Apply an arbitrary function to a complex triangular matrix. Uses a recurrence of Parlett. If uplo is true, A is lower triangular. ctrfun does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. mlog Return matrix logarithm of a square matrix. PDL = mlog(PDL(A)) my $a = random(10,10); my $log = mlog($a); msqrt Return matrix square root (principal) of a square matrix. PDL = msqrt(PDL(A)) my $a = random(10,10); my $sqrt = msqrt($a); mexp Return matrix exponential of a square matrix. PDL = mexp(PDL(A)) my $a = random(10,10); my $exp = mexp($a); mpow Return matrix power of a square matrix. PDL = mpow(PDL(A), SCALAR(exponent)) my $a = random(10,10); my $powered = mpow($a,2.5); mcos Return matrix cosine of a square matrix. PDL = mcos(PDL(A)) my $a = random(10,10); my $cos = mcos($a); macos Return matrix inverse cosine of a square matrix. PDL = macos(PDL(A)) my $a = random(10,10); my $acos = macos($a); msin Return matrix sine of a square matrix. PDL = msin(PDL(A)) my $a = random(10,10); my $sin = msin($a); masin Return matrix inverse sine of a square matrix. PDL = masin(PDL(A)) my $a = random(10,10); my $asin = masin($a); mtan Return matrix tangent of a square matrix. PDL = mtan(PDL(A)) my $a = random(10,10); my $tan = mtan($a); matan Return matrix inverse tangent of a square matrix. PDL = matan(PDL(A)) my $a = random(10,10); my $atan = matan($a); mcot Return matrix cotangent of a square matrix. PDL = mcot(PDL(A)) my $a = random(10,10); my $cot = mcot($a); macot Return matrix inverse cotangent of a square matrix. PDL = macot(PDL(A)) my $a = random(10,10); my $acot = macot($a); msec Return matrix secant of a square matrix. PDL = msec(PDL(A)) my $a = random(10,10); my $sec = msec($a); masec Return matrix inverse secant of a square matrix. PDL = masec(PDL(A)) my $a = random(10,10); my $asec = masec($a); mcsc Return matrix cosecant of a square matrix. PDL = mcsc(PDL(A)) my $a = random(10,10); my $csc = mcsc($a); macsc Return matrix inverse cosecant of a square matrix. PDL = macsc(PDL(A)) my $a = random(10,10); my $acsc = macsc($a); mcosh Return matrix hyperbolic cosine of a square matrix. PDL = mcosh(PDL(A)) my $a = random(10,10); my $cos = mcosh($a); macosh Return matrix hyperbolic inverse cosine of a square matrix. PDL = macosh(PDL(A)) my $a = random(10,10); my $acos = macosh($a); msinh Return matrix hyperbolic sine of a square matrix. PDL = msinh(PDL(A)) my $a = random(10,10); my $sinh = msinh($a); masinh Return matrix hyperbolic inverse sine of a square matrix. PDL = masinh(PDL(A)) my $a = random(10,10); my $asinh = masinh($a); mtanh Return matrix hyperbolic tangent of a square matrix. PDL = mtanh(PDL(A)) my $a = random(10,10); my $tanh = mtanh($a); matanh Return matrix hyperbolic inverse tangent of a square matrix. PDL = matanh(PDL(A)) my $a = random(10,10); my $atanh = matanh($a); mcoth Return matrix hyperbolic cotangent of a square matrix. PDL = mcoth(PDL(A)) my $a = random(10,10); my $coth = mcoth($a); macoth Return matrix hyperbolic inverse cotangent of a square matrix. PDL = macoth(PDL(A)) my $a = random(10,10); my $acoth = macoth($a); msech Return matrix hyperbolic secant of a square matrix. PDL = msech(PDL(A)) my $a = random(10,10); my $sech = msech($a); masech Return matrix hyperbolic inverse secant of a square matrix. PDL = masech(PDL(A)) my $a = random(10,10); my $asech = masech($a); mcsch Return matrix hyperbolic cosecant of a square matrix. PDL = mcsch(PDL(A)) my $a = random(10,10); my $csch = mcsch($a); macsch Return matrix hyperbolic inverse cosecant of a square matrix. PDL = macsch(PDL(A)) my $a = random(10,10); my $acsch = macsch($a); mfun Return matrix function of second argument of a square matrix. Function will be applied on a PDL::Complex object. PDL = mfun(PDL(A),'cos') my $a = random(10,10); my $fun = mfun($a,'cos'); sub sinbycos2{ $_[0]->set_inplace(0); $_[0] .= $_[0]->Csin/$_[0]->Ccos**2; } # Try diagonalization $fun = mfun($a, \&sinbycos2,1); # Now try Schur/Parlett $fun = mfun($a, \&sinbycos2); # Now with function. scalar msolve($a->mcos->mpow(2), $a->msin);
TODO
Improve error return and check singularity. Improve (msqrt,mlog) / r2C
AUTHOR
Copyright (C) Gregory Vanuxem 2005-2007. This library is free software; you can redistribute it and/or modify it under the terms of the artistic license as specified in the Artistic file.