View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Grégory Vanuxem > PDL-LinearAlgebra-0.06 > PDL::LinearAlgebra::Special



Annotate this POD


New  2
Open  1
View/Report Bugs
Module Version: 0.03   Source   Latest Release: PDL-LinearAlgebra-0.12


PDL::LinearAlgebra::Special - Special matrices for PDL


 use PDL::LinearAlgebra::Mtype;

 $a = mhilb(5,5);


This module provides some constructors of well known matrices.



Contruct Hilbert matrix from specifications list or template piddle

 PDL(Hilbert)  = mpart(PDL(template) | ARRAY(specification))
 my $hilb   = mhilb(float,5,5);


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.

 PDL = mtri(PDL, SCALAR)
 SCALAR : UPPER = 0 | LOWER = 1, default = 0
 my $a = random(10,10);
 my $b = mtri($a, 0);


Return (primal) Vandermonde matrix from vector.

mvander(M,P) is a rectangular version of mvander(P) with M Columns.


Return antisymmetric and symmetric part of a real or complex square matrix.

 ( PDL(antisymmetric), PDL(symmetric) )  = mpart(PDL, SCALAR(conj))
 conj : if true Return AntiHermitian, Hermitian part.
 my $a = random(10,10);
 my ( $antisymmetric, $symmetric )  = mpart($a);


Return Hankel matrix also known as persymmetric matrix. For complex, needs object of type PDL::Complex.

 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 whith element below skew diagonal (anti-diagonal) equals
 to zero. If c is a scalar number, make it from sequence beginning at one.

The elements are:

        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.

If c is a scalar number, it's determinant can be computed by:

                        floor(n/2)    n
        Det(H(n)) = (-1)      *      n


Return toeplitz matrix. For complex need object of type PDL::Complex.

 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.


Return Pascal matrix (from Pascal's triangle) of order N.

        0 => upper triangular (Cholesky factor),
        1 => lower triangular (Cholesky factor),
        2 => symmetric.

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.

Their determinants are all equal to one and:

        S = L * U
        where S, L, U are symmetric, lower and upper pascal matrix respectively.


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).

        0 => first row is -P(1:n-1)/P(0),
        1 => last column is -P(1:n-1)/P(0),


Copyright (C) Grégory 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.

syntax highlighting: