TEST_MAT
Test Matrices
TEST_MAT
is a Python library which
defines test matrices for which some of the determinant, eigenvalues,
inverse, null vectors, P*L*U factorization or linear system solution
are already known, including the Vandermonde and Wathen matrix.
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
http://math.nist.gov,
the Matrix Market web site.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
TEST_MAT is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
CG,
a Python 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.
JACOBI,
a Python library which
implements the Jacobi iteration for solving symmetric positive definite
(SPD) systems of linear equations.
WATHEN,
a Python library which
compares storage schemes (full, banded, sparse triplet, sparse) and
solution strategies (A\x, Linpack, conjugate gradient) for linear systems
involving the Wathen matrix, which can arise when solving a
problem using the finite element method (FEM).
Source Code:
-
a123.py
the A123 matrix.
-
aegerter.py
the AEGERTER matrix.
-
archimedes.py
the ARCHIMEDES matrix.
-
bab.py
the BAB matrix.
-
bauer.py
the BAUER matrix.
-
bernstein.py,
the BERNSTEIN matrix.
-
bis.py
the BIS matrix.
-
biw.py
the BIW matrix.
-
bodewig.py
the BODEWIG matrix.
-
boothroyd.py
the BOOTHROYD matrix.
-
borderband.py
the BORDERBAND matrix.
-
carry.py
the CARRY matrix.
-
cauchy.py
the CAUCHY matrix.
-
cheby_diff1.py
the CHEBY_DIFF1 matrix.
-
cheby_t.py
the CHEBY_T matrix.
-
cheby_u.py
the CHEBY_U matrix.
-
cheby_van1.py
the CHEBY_VAN1 matrix.
-
cheby_van2.py
the CHEBY_VAN2 matrix.
-
cheby_van3.py
the CHEBY_VAN3 matrix.
-
chow.py
the CHOW matrix.
-
clement1.py
the CLEMENT1 matrix.
-
clement2.py
the CLEMENT2 matrix.
-
colleague.py
the COLLEAGUE matrix.
-
combin.py
the COMBIN matrix.
-
companion.py
the COMPANION matrix.
-
complex_i.py
the COMPLEX_I matrix.
-
conex1.py
the CONEX1 matrix.
-
conex2.py
the CONEX2 matrix.
-
conex3.py
the CONEX3 matrix.
-
conex4.py
the CONEX4 matrix.
-
conference.py
the CONFERENCE matrix.
-
creation.py
the CREATION matrix.
-
daub2.py
the DAUB2 matrix.
-
daub4.py
the DAUB4 matrix.
-
daub6.py
the DAUB6 matrix.
-
daub8.py
the DAUB8 matrix.
-
daub10.py
the DAUB10 matrix.
-
daub12.py
the DAUB12 matrix.
-
diagonal.py
the DIAGONAL matrix.
-
dif1.py
the DIF1 matrix.
-
dif1cyclic.py
the DIF1CYCLIC matrix.
-
dif2.py
the DIF2 matrix.
-
dif2cyclic.py
the DIF2FCYCLIC matrix.
-
dorr.py
the DORR matrix.
-
downshift.py
the DOWNSHIFT matrix.
-
eberlein.py
the EBERLEIN matrix.
-
eulerian.py
the EULERIAN matrix.
-
exchange.py
the EXCHANGE matrix.
-
fibonacci1.py
the FIBONACCI1 matrix.
-
fibonacci2.py
the FIBONACCI2 matrix.
-
fibonacci3.py
the FIBONACCI3 matrix.
-
fiedler.py
the FIEDLER matrix.
-
forsythe.py
the FORSYTHE matrix.
-
fourier_cosine.py
the FOURIER COSINE matrix.
-
fourier_sine.py
the FOURIER_SINE matrix.
-
frank.py
the FRANK matrix.
-
gear.py
the GEAR matrix.
-
gfpp.py
the GFPP matrix.
-
givens.py
the GIVENS matrix.
-
gk316.py
the GK316 matrix.
-
gk323.py
the GK323 matrix.
-
gk324.py
the GK324 matrix.
-
hamming.py
the HAMMING matrix.
-
hankel_n.py
the HANKEL_N matrix.
-
hanowa.py
the HANOWA matrix.
-
harman.py
the HARMAN matrix.
-
hartley.py
the HARTLEY matrix.
-
helmert.py
the HELMERT matrix.
-
helmert2.py
the HELMERT2 matrix.
-
hermite.py
the HERMITE matrix.
-
herndon.py
the HERNDON matrix.
-
hess4.py
the HESS4 matrix.
-
hess5.py
the HESS5 matrix.
-
hilbert.py
the HILBERT matrix.
-
householder.py
the HOUSEHOLDER matrix.
-
idem_random.py
the IDEM_RANDOM matrix.
-
identity.py
the IDENTITY matrix.
-
ijfact1.py
the IJFACT1 matrix.
-
ijfact2.py
the IFJACT2 matrix.
-
ill3.py
the ILL3 matrix.
-
integration.py
the INTEGRATION matrix.
-
invol.py
the INVOL matrix.
-
jacobi.py
the JACOBI matrix.
-
jordan.py
the JORDAN matrix.
-
kahan.py
the KAHAN matrix.
-
kershaw.py
the KERSHAW matrix.
-
kershawtri.py
the KERSHAWTRI matrix.
-
kms.py
the KMS matrix.
-
laguerre.py
the LAGUERRE matrix.
-
lauchli.py
the LAUCHLI matrix.
-
legendre.py
the LEGENDRE matrix.
-
lehmer.py
the LEHMER matrix.
-
leslie.py
the LESLIE matrix.
-
lesp.py
the LESP matrix.
-
lietzke.py
the LIETZKE matrix.
-
line_adj.py
the LINE_ADJ matrix.
-
line_loop_adj.py
the LINE_LOOP_ADJ matrix.
-
lotkin.py
the LOTKIN matrix.
-
maxij.py
the MAXIJ matrix.
-
milnes.py
the MILNES matrix.
-
minij.py
the MINIJ matrix.
-
moler1.py
the MOLER1 matrix.
-
moler2.py
the MOLER2 matrix.
-
moler3.py
the MOLER3 matrix.
-
moler4.py
the MOLER4 matrix.
-
neumann.py
the NEUMANN matrix.
-
one.py
the ONE matrix.
-
ortega.py
the ORTEGA matrix.
-
orth_random.py
the ORTH_RANDOM matrix.
-
orth_symm.py
the ORTH_SYMM matrix.
-
oto.py
the OTO matrix.
-
parter.py
the PARTER matrix.
-
pascal1.py
the PASCAL1 matrix.
-
pascal2.py
the PASCAL2 matrix.
-
pascal3.py
the PASCAL3 matrix.
-
pds_random.py
the PDS_RANDOM matrix.
-
pei.py
the PEI matrix.
-
permutation_random.py
the PERMUTATION_RANDOM matrix.
-
poisson.py
the POISSON matrix.
-
redheffer.py,
the REDHEFFER matrix.
-
ring_adj.py,
the RING_ADJ matrix.
-
ris.py,
the RIS matrix.
-
rodman.py,
the RODMAN matrix.
-
rosser1.py,
the ROSSER1 matrix.
-
routh.py,
the ROUTH matrix.
-
rutis1.py,
the RUTIS1 matrix.
-
rutis2.py,
the RUTIS2 matrix.
-
rutis3.py,
the RUTIS3 matrix.
-
rutis5.py,
the RUTIS5 matrix.
-
schur_block.py
the SCHUR_BLOCK matrix.
-
spline.py
the SPLINE matrix.
-
stirling.py
the STIRLING matrix.
-
summation.py
the SUMMATION matrix.
-
sweet1.py
the SWEET1 matrix.
-
sweet2.py
the SWEET2 matrix.
-
sweet3.py
the SWEET3 matrix.
-
sweet4.py
the SWEET4 matrix.
-
sylvester_kac.py
the SYLVESTER_KAC matrix.
-
symm_random.py
the SYMM_RANDOM matrix.
-
tri_upper.py
the TRI_UPPER matrix.
-
tris.py
the TRIS matrix.
-
triv.py
the TRIV matrix.
-
triw.py
the TRIW matrix.
-
upshift.py
the UPSHIFT matrix.
-
vand1.py
the VAND1 matrix.
-
vand2.py
the VAND2 matrix.
-
wilk03.py
the WILK03 matrix.
-
wilk04.py
the WILK04 matrix.
-
wilk05.py
the WILK05 matrix.
-
wilk12.py
the WILK12 matrix.
-
wilk21.py
the WILK21 matrix.
-
wilson.py
the WILSON matrix.
-
zero.py
the ZERO matrix.
Utilities:
-
bvec_next_grlex.py
returns the next binary vector in GRLEX order.
-
c8_i.py
returns the value of the imaginary unit, i.
-
c8_normal_01.py
returns a unit pseudonormal C8.
-
c8_uniform_01.py
returns a unit pseudorandom C8.
-
c8mat_identity.py
sets the square matrix A to the identity.
-
c8mat_indicator.py,
returns the C8MAT indicator matrix.
-
c8mat_uniform_01.py
returns a unit pseudorandom C8MAT.
-
c8vec_print.py
prints a complex vector, with an optional title.
-
c8vec_uniform_01.py
returns a unit pseudorandom C8VEC.
-
c8vec_unity.py
returns the N roots of unity.
-
cheby_u_polynomial.py
evaluates the Chebyshev polynomials of the second kind.
-
complete_symmetric_poly.py,
evaluates the complete symmetric polynomial tau(n,r).
-
i4_factor.py
factors an integer into prime factors.
-
i4_log_10.py
returns the integer part of the logarithm base 10 of abs ( X ).
-
i4_is_even.py
returns TRUE if I is even.
-
i4_is_odd.py
returns TRUE if I is odd.
-
i4_is_prime.py
reports whether an integer is prime.
-
i4_modp.py
returns the nonnegative remainder of integer division.
-
i4_rise.py
computes the integer rising factorial function.
-
i4_rise_values.py
returns selected values of the integer rising factorial function.
-
i4_sign.py
returns the sign of an I4.
-
i4_uniform_ab.py
returns a scaled pseudorandom I4.
-
i4_wrap.py,
forces an I4 to lie between given limits by wrapping.
-
i4mat_print.py
prints an I4MAT.
-
i4mat_print_some.py
prints some of an I4MAT.
-
i4vec_print.py
prints an integer vector, with an optional title.
-
legendre_symbol.py,
evaluates the Legendre symbol (Q/P);
-
legendre_zeros.py
computes the zeros of the Legendre polynomial.
-
mertens.py
evaluates the Mertens function.
-
mertens_values.py
returns some values of the Mertens function.
-
moebius.py
returns the value of MU(N), the Moebius function of N.
-
moebius_values.py
returns some values of the Moebius function.
-
prime.py
returns any of the first PRIME_MAX prime numbers.
-
r8_choose.py,
returns Choose(N,K) as an R8;
-
r8_factorial.py,
evaluates the factorial function.
-
r8_factorial_values.py
returns values of the real factorial function.
-
r8_gamma_log.py,
returns the logarithm of the gamma function of an R8.
-
r8_mop.py,
returns a minus-one-power as an R8;
-
r8_normal_01.py,
returns a unit pseudonormal R8;
-
r8_rise.py,
returns the rising factorial function as an R8.
-
r8_rise_values.py,
returns selected values of the rising factorial function.
-
r8_sign.py,
returns the sign of an R8.
-
r8_uniform_01.py,
returns a unit pseudorandom R8;
-
r8_uniform_ab.py,
returns a scaled pseudorandom R8;
-
r8col_swap.py,
swaps two columns of an R8COL;
-
r8mat_house_form.py,
constructs a Householder matrix from its compact form;
-
r8mat_indicator.py,
returns the indicator matrix as an R8MAT.
-
r8mat_is_adjacency.py,
True if an RMAT is an adjacency matrix.
-
r8mat_is_anticirculant.py,
True if an RMAT is an anticirculant matrix.
-
r8mat_is_antisymmetric.py,
True if an RMAT is an antisymmetric matrix.
-
r8mat_is_eigen_left.py,
determines the error in a left eigen system ||A'*X-X*LAMBDA||.
-
r8mat_is_eigen_right.py,
determines the error in a right eigen system ||A*X-X*LAMBDA||.
-
r8mat_is_identity.py,
returns the error in an identity matrix, ||A-I||.
-
r8mat_is_integer.py,
returns True if an R8MAT is an integer matrix.
-
r8mat_is_inverse.py,
returns the error in an inverse, ||A*B-I|| + ||B*A-I||.
-
r8mat_is_llt.py,
returns True if A is the L*L' factor of a matrix.
-
r8mat_is_null_left.py,
returns the error in a left null vector ||A'*x||.
-
r8mat_is_null_right.py,
returns the error in a right null vector ||A'*x||.
-
r8mat_is_orthogonal.py,
returns the Frobenius norm of A'*A-I for square matrix A.
-
r8mat_is_orthogonal_column.py,
returns the Frobenius norm of A'*A-Inn.
-
r8mat_is_orthogonal_row.py,
returns the Frobenius norm of A*A'-Imm.
-
r8mat_is_permutation.py,
returns True if A is a permutation matrix.
-
r8mat_is_plu.py,
returns the Frobenius norm of the error in a PLU factorization A=P*L*U.
-
r8mat_is_solution.py,
returns the Frobenius norm of the error of the equation A*X=B.
-
r8mat_is_sparse.py,
returns the sparseness of an R8MAT.
-
r8mat_is_square.py,
returns True if A is square.
-
r8mat_is_symmetric.py,
returns True if A is symmetric.
-
r8mat_is_zero_one.py,
returns True if A is a zero/one matrix.
-
r8mat_mm.py,
computes a matrix-matrix product.
-
r8mat_mmt.py,
computes a matrix-transpose(matrix) product.
-
r8mat_mtm.py,
computes a (transposed matrix)-matrix product.
-
r8mat_mv.py,
computes a matrix-vector product.
-
r8mat_norm_fro.py,
computes the Frobenius norm of a R8MAT;
-
r8mat_norm_l1.py,
returns the L1 norm of an R8MAT.
-
r8mat_print.py,
prints an R8MAT.
-
r8mat_print_some.py,
prints some of an R8MAT.
-
r8mat_sub.py,
subtracts one R8MAT from another.
-
r8mat_transpose.py,
transposes an R8MAT.
-
r8mat_uniform_01.py,
returns a unit pseudorandom R8MAT.
-
r8mat_uniform_ab.py,
returns a scaled pseudorandom R8MAT.
-
r8poly_print.py,
prints a polynomial;
-
r8vec_asum.py,
sums the absolute values of the entries in an R8VEC.
-
r8vec_house_column.py,
defines a Householder premultiplier that packs a column.
-
r8vec_nint.py,
rounds the entries of an R8VEC.
-
r8vec_norm_l2.py,
returns the L2 norm of a R8VEC.
-
r8vec_print.py,
prints an R8VEC.
-
r8vec_uniform_01.py,
returns a unit pseudorandom R8VEC.
-
r8vec_uniform_ab.py,
returns a scaled pseudorandom R8VEC.
-
timestamp.py
returns the YMDHMS date as a timestamp.
Examples and Tests:
-
test_mat_test.py,
calls the tests.
-
test_mat_test.sh,
runs the tests.
-
test_mat_test.txt,
the output file.
-
test_condition.py,
tests L1 condition numbers.
-
test_determinant.py,
tests determinants.
-
test_inverse.py,
tests matrix inverses.
-
test_llt.py,
tests lower triangular Cholesky factorizations.
-
test_null_left.py,
tests left null vectors by evaluating ||x'*A||.
-
test_null_right.py,
tests right null vectors by evaluating ||A*x||.
-
test_plu.py,
tests P*L*U factorizations.
-
test_solution.py,
tests linear solutions.
You can go up one level to
the Python source codes.
Last revised on 12 March 2018.