# test_matrix

test_matrix, a Fortran77 code which defines test matrices for which the condition number, determinant, eigenvalues, eigenvectors, inverse, null vectors, P*L*U factorization or linear system solution are known. Examples include the Fibonacci, Hilbert, Redheffer, Vandermonde, Wathen and Wilkinson matrices.

A wide range of matrix dimensions, forms and properties are available. These matrices may be useful in testing an algorithm for correctness on a variety of problems.

Many of the matrices can be rectangular, with the user specifying the number of rows and columns. Almost all the matrices can be made of arbitrary size, with the user specifying the dimension.

Many different matrix zero structures are available, including diagonal, bidiagonal, tridiagonal, pentadiagonal, banded, upper and lower triangular, and Hessenberg.

Many different matrix symmetry patterns are available, including symmetric, antisymmetric, persymmetric, circulant, Toeplitz, and Hankel.

Matrices are available with known inverses, condition numbers, determinants, rank, eigenvalues, and characteristic polynomials. Other matrix properties include positive definiteness, positivity, zero/one, and adjacency matrices.

Many of the matrices come from a MATLAB M file collection developed by Nicholas Higham, Department of Mathematics, University of Manchester.

An earlier version of the collection is available, again as MATLAB M files, in ACM TOMS Algorithm 694, in the TOMS directory of the NETLIB web site.

Many of these matrices, and many other matrices, are available at https://math.nist.gov, the Matrix Market web site.

### Languages:

test_matrix is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

### Related Data and Programs:

cg, a Fortran77 library which implements a simple version of the conjugate gradient (CG) method for solving a system of linear equations of the form A*x=b, suitable for situations in which the matrix A is positive definite (only real, positive eigenvalues) and symmetric.

eispack, a Fortran77 code which carries out eigenvalue computations;

expokit, a Fortran77 code which solves various forms of the matrix exponential problem, by Roger Sidje.

jacobi_eigenvalue, a Fortran77 code which implements the Jacobi iteration for the iterative determination of the eigenvalues and eigenvectors of a real symmetric matrix.

lapack_examples, a Fortran77 code which demonstrates the use of the LAPACK linear algebra library.

linpack_d, a Fortran77 code which factors and solves systems of linear equations in a variety of formats and arithmetic types.

polynomial_conversion, a Fortran77 code which converts representations of a polynomial between monomial, Bernstein, Chebyshev, Hermite, Lagrange, Laguerre and other forms.

test_eigen, a Fortran77 code which implements test matrices for eigenvalue analysis.

wathen_matrix, a Fortran77 code which compares storage schemes (full, banded, sparse triplet) and solution strategies (Linpack full, Linpack banded, conjugate gradient (CG)) for linear systems involving the Wathen matrix, which can arise when solving a problem using the finite element method (FEM).

### Source Code:

Last revised on 09 December 2023.