.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PDL::LinearAlgebra::Special 3pm" .TH PDL::LinearAlgebra::Special 3pm "2023-04-02" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDL::LinearAlgebra::Special \- Special matrices for PDL .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use PDL::LinearAlgebra::Special; \& \& $a = mhilb(5,5); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides some constructors of well known matrices. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "mhilb" .IX Subsection "mhilb" Construct Hilbert matrix from specifications list or template ndarray .PP .Vb 1 \& PDL(Hilbert) = mpart(PDL(template) | ARRAY(specification)) .Ve .PP .Vb 1 \& my $hilb = mhilb(float,5,5); .Ve .SS "mtri" .IX Subsection "mtri" Return zeroed matrix with upper or lower triangular part from another matrix. Return trapezoid matrix if entry matrix is not square. Supports threading. Uses tricpy or tricpy. .PP .Vb 2 \& PDL = mtri(PDL, SCALAR) \& SCALAR : UPPER = 0 | LOWER = 1, default = 0 .Ve .PP .Vb 2 \& my $a = random(10,10); \& my $b = mtri($a, 0); .Ve .SS "mvander" .IX Subsection "mvander" Return (primal) Vandermonde matrix from vector. .PP mvander(M,P) is a rectangular version of mvander(P) with M Columns. .SS "mpart" .IX Subsection "mpart" Return antisymmetric and symmetric part of a real or complex square matrix. .PP .Vb 2 \& ( PDL(antisymmetric), PDL(symmetric) ) = mpart(PDL, SCALAR(conj)) \& conj : if true Return AntiHermitian, Hermitian part. .Ve .PP .Vb 2 \& my $a = random(10,10); \& my ( $antisymmetric, $symmetric ) = mpart($a); .Ve .SS "mhankel" .IX Subsection "mhankel" Return Hankel matrix also known as persymmetric matrix. Handles complex data. .PP .Vb 4 \& mhankel(c,r), where c and r are vectors, returns matrix whose first column \& is c and whose last row is r. The last element of c prevails. \& mhankel(c) returns matrix with element below skew diagonal (anti\-diagonal) equals \& to zero. If c is a scalar number, make it from sequence beginning at one. .Ve .PP The elements are: .PP .Vb 3 \& H (i,j) = c (i+j), i+j+1 <= m; \& H (i,j) = r (i+j\-m+1), otherwise \& where m is the size of the vector. .Ve .PP If c is a scalar number, it's determinant can be computed by: .PP .Vb 2 \& floor(n/2) n \& Det(H(n)) = (\-1) * n .Ve .SS "mtoeplitz" .IX Subsection "mtoeplitz" Return toeplitz matrix. Handles complex data. .PP .Vb 3 \& mtoeplitz(c,r), where c and r are vectors, returns matrix whose first column \& is c and whose last row is r. The last element of c prevails. \& mtoeplitz(c) returns symmetric matrix. .Ve .SS "mpascal" .IX Subsection "mpascal" Return Pascal matrix (from Pascal's triangle) of order N. .PP .Vb 5 \& mpascal(N,uplo). \& uplo: \& 0 => upper triangular (Cholesky factor), \& 1 => lower triangular (Cholesky factor), \& 2 => symmetric. .Ve .PP This matrix is obtained by writing Pascal's triangle (whose elements are binomial coefficients from index and/or index sum) as a matrix and truncating appropriately. The symmetric Pascal is positive definite, it's inverse has integer entries. .PP Their determinants are all equal to one and: .PP .Vb 2 \& S = L * U \& where S, L, U are symmetric, lower and upper pascal matrix respectively. .Ve .SS "mcompanion" .IX Subsection "mcompanion" Return a matrix with characteristic polynomial equal to p if p is monic. If p is not monic the characteristic polynomial of A is equal to p/c where c is the coefficient of largest degree in p (here p is in descending order). .PP .Vb 4 \& mcompanion(PDL(p),SCALAR(charpol)). \& charpol: \& 0 => first row is \-P(1:n\-1)/P(0), \& 1 => last column is \-P(1:n\-1)/P(0), .Ve .SH "AUTHOR" .IX Header "AUTHOR" Copyright (C) Grégory Vanuxem 2005\-2007. .PP 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.