SVDTestImpl.mesa
Copyright Ó 1989, 1992 by Xerox Corporation. All rights reserved.
Ken Shoemake, April 27, 1989 5:48:34 am PDT
DIRECTORY
LinearSystem, RealFns, Rope, SVD;
GLmpArray: TYPE ~ SVD.ColumnN;
GLnpArray: TYPE ~ SVD.ColumnN;
GLmpXnp: TYPE ~ SVD.MatrixN;
GLnpXnp: TYPE ~ SVD.MatrixN;
mp, np: INT ¬ 3;
matrixA: GLmpXnp ¬ LinearSystem.Create[np, np];
matrixU: GLmpXnp ¬ LinearSystem.Create[np, np];
matrixV: GLnpXnp ¬ LinearSystem.Create[np, np];
vectorW: GLnpArray ¬ NEW[LinearSystem.VecSeq[np]];
TestSVD:
PROC
~ {
m, n: INT ~ 3;
FOR i:
INT
IN [0..n)
DO
FOR j:
INT
IN (i..n)
DO
matrixA[j][i] ¬ matrixA[i][j] ¬ 0;
ENDLOOP;
ENDLOOP;
matrixA[0][0] ¬ -1;
matrixA[1][1] ¬ 2;
matrixA[2][2] ¬ -2;
matrixU ¬ LinearSystem.Copy[matrixA];
SVD.SVDecomp[matrixU, m, n, vectorW, matrixV];
RETURN;
};