Jacob C. Kesinger > Math-MatrixSparse-0.01 > Math::MatrixSparse

Download:
Math-MatrixSparse-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Math::MatrixSparse - Perl extension for sparse matrices.

SYNOPSIS ^

Math::MatrixSparse is a module implementing naive sparse matrices. Its syntax is designed to partially overlap with Math::MatrixReal where possible and reasonable.

Basic matrix operations are present, including addition, subtraction, scalar multiplication, matrix multiplication, transposition, and exponentiation.

Three methods of solving systems iteratively are available, including Jacobi, Gauss-Seidel, and Symmetric Over-Relaxation.

Real-valued matrices can be read from files in the Matrix Market and Harwell Boeing formats, and written in the Matrix Market format. In addition, they can be read from a given string.

Certain special types of matrices are understood, but not optimized for, such as upper and lower triangular, diagonal, symmetric, skew-symmetric, positive, negative, and pattern. Methods are available to determine the properties of a given matrix.

Individual rows, columns, and diagonals of matrices can be obtained, as can the upper and lower triangular, symmetric, skew symmetric, positive and negative portions.

DESCRIPTION ^

CREATION AND INPUT-OUTPUT METHODS

INTERFACE METHODS

GENERAL METHODS

DECOMPOSITIONAL METHODS

INFORMATIONAL METHODS

BOOLEAN INFORMATIONAL METHODS

The following is_xxx() methods use the special flags if they are present. If more than one will be called for a given matrix, consider calling $matrix->diagnose() to set the flags.

ARITHMETIC METHODS

PROBABILISTIC METHODS

SOLUTION OF SYSTEMS METHODS

SORTING METHODS

IN-LINE METHODS

The following are as described above, except that they modify their calling object instead of a copy thereof.

_each

_mask

_insert

_cull

_threshold

_sizetofit

_negate

_multiplyscalar

_terminvert

_symmetrify

_skewsymmetrify

_normalize()

_normalizerows()

_normalizecolumns()

_diagpart()

_nondiagpart()

_upperpart()

_nonupperpart()

_lowerpart()

_nonlowerpart()

_positivepart()

_negativepart()

_symmetricpart()

_skewsymmetricpart()

In addition to these, the following methods modify the calling object.

name()

assign()

assignspecial()

assignkey()

row() (if called with the optional second argument)

column() (if called with the optional second argument)

diagnose()

delete()

deletekey()

clearspecials()

OVERLOADED OPERATORS

+ add()

- subtract()

* quickmultiply()

x kronecker()

** exponential()

~ transpose()

& matrixand()

| matrixor()

"" print()

Unary - negate()

SPECIAL MATRIX FLAGS

Certain information is stored about the matrix, and is updated when necessary. See also $matrix->diagnose(). All flags can also be undef. These should not be accessed directly--use the boolean is_whatever() methods instead.

structure

The symmetry of the matrix. Can be symmetric or skewsymmetric.

shape

The shape of the matrix. Can be diagonal, lower (triangular), upper, strictlower or strictupper.

sign

The sign of all the elemetns of a matrix. Can be positive, negative, nonpostive, nonnegative, or zero.

pattern

Indicates whether the matrix should be treated as a pattern. Is non-zero if so.

bandwidth

Calculates the bandwidth of $matrix, i.e. the maximum value of abs($i-$j) for all elements at ($i,$j) in $matrix.

field

The underlying field of the elements of the matrix. Currently, can only be real.

INTERFACING

The user should not attempt to access the pieces of a Math::MatrixReal object directly, but instead use the routines provided. Certain methods, such as the sorters, return keys to the elements of the matrix, and these should be fed into splitkey() to obtain row-column indices.

EXPORT ^

None.

EXPORT_OK ^

&splitkey() and &makekey().

BUGS ^

Horribly, hideously inefficient.

No checks are made to be sure that values are of a proper type, or even that indices are integers. It is entirely possible to assign() a value that is, say, another Math::MatrixSparse. However, because of the lack of these checks, indices can start at zero, or even negative values, if an algorithm calls for it.

Harwell Boeing support is not robust, and output is not implemented.

Complex matrices in Harwell Boeing and Matrix Market are not supported. In Matrix Market format, only the real part is read--the imaginary part is discarded.

Many methods do not modify their calling object, but instead return a new object. This can be inefficent and a waste of resources, especially when it will be assigned to the new object anyway. Use the analogous methods listed in IN-LINE METHODS instead if this is an issue.

AUTHOR ^

Jacob C. Kesinger, <kesinger@math.ttu.edu>

SEE ALSO ^

perl, Math::MatrixReal.

syntax highlighting: