SVD_DEMO
Demonstration of the Singular Value Decomposition
SVD_DEMO is an executable C++ program,
using double precision arithmetic,
which demonstrates the computation of the singular value decomposition
and a few of its properties.
The singular value decomposition has uses in solving
overdetermined or underdetermined linear systems,
linear least squares problems, data compression,
the pseudoinverse matrix,
reduced order modeling, and
the accurate computation of matrix rank and null space,
Usage:
-
svd_demo m n [seed]
-
runs the program, generating a random matrix of order
M rows by N columns. If SEED is
provided on the command line, it is used as the random number
seed; otherwise, a seed is generated internally.
Related Data and Programs:
LAPACK
is a FORTRAN90 library of linear algebra routines,
which includes routines to carry out the singular value
decomposition.
LINPACK
is a C++ library of linear algebra routines,
which includes routines to carry out the singular value
decomposition.
SVD_BASIS
is an interactive executable FORTRAN90 program which computes
a reduced basis for a collection of data vectors using the SVD.
SVD_DEMO is also available in
a FORTRAN90 version and
a MATLAB version.
TOMS358
is a FORTRAN77 routine which computes the singular value decomposition
for a complex matrix.
Reference:
-
Edward Anderson, Zhaojun Bai, Christian Bischof, Susan Blackford,
James Demmel, Jack Dongarra, Jeremy Du Croz, Anne Greenbaum,
Sven Hammarling, Alan McKenney, Danny Sorensen,
LAPACK User's Guide,
Third Edition,
SIAM, 1999,
ISBN: 0898714478,
LC: QA76.73.F25L36
-
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,
LINPACK User's Guide,
SIAM, 1979,
ISBN13: 978-0-898711-72-1,
LC: QA214.L56.
-
Gene Golub, Charles VanLoan,
Matrix Computations,
Third Edition,
Johns Hopkins, 1996,
ISBN: 0-8018-4513-X,
LC: QA188.G65.
-
David Kahaner, Cleve Moler, Steven Nash,
Numerical Methods and Software,
Prentice Hall, 1989,
ISBN: 0-13-627258-4,
LC: TA345.K34.
-
Lloyd Trefethen, David Bau,
Numerical Linear Algebra,
SIAM, 1997,
ISBN: 0-89871-361-7,
LC: QA184.T74.
Source Code:
Examples and Tests:
List of Routines:
-
MAIN is the main program for SVD_DEMO.
-
GET_SEED returns a random seed for the random number generator.
-
GET_SVD_LINPACK gets the SVD of a matrix using a call to LINPACK.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
PSEUDO_INVERSE computes the pseudoinverse.
-
PSEUDO_LINEAR_SOLVE_TEST uses the pseudoinverse for linear systems.
-
PSEUDO_PRODUCT_TEST examines pseudoinverse products.
-
R4_ABS returns the absolute value of an R4.
-
R4_NINT returns the nearest integer to an R4.
-
R4_UNIFORM returns a scaled pseudorandom R4.
-
R4_UNIFORM_01 returns a unit pseudorandom R4.
-
R8_NINT returns the nearest integer to a double precision value.
-
R8MAT_DIF_FRO returns the Frobenius norm of the difference of R8MAT's.
-
R8MAT_NORM_FRO returns the Frobenius norm of a R8MAT.
-
R8MAT_PRINT prints an R8MAT
-
R8MAT_PRINT_SOME prints some of an R8MAT.
-
R8VEC_NORM_L2 returns the L2 norm of an R8VEC.
-
R8MAT_UNIFORM_01 returns a unit pseudorandom R8MAT.
-
R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
-
RANK_ONE_PRINT_TEST prints the sums of rank one matrices.
-
RANK_ONE_TEST compares A to the sum of rank one matrices.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
SVD_PRODUCT_TEST tests that A = U * S * V'.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the C++ source codes.
Last revised on 15 September 2006.