15 July 2013 09:22:28 PM JACOBI_EIGENVALUE_TEST C++ version Test the JACOBI_EIGENVALUE library. TEST01 For a symmetric matrix A, JACOBI_EIGENVALUE computes the eigenvalues D and eigenvectors V so that A * V = D * V. Input matrix A: Col: 0 1 2 3 Row 0: 4 -30 60 -35 1: -30 300 -675 420 2: 60 -675 1620 -1050 3: -35 420 -1050 700 Number of iterations = 11 Number of rotations = 21 Eigenvalues D: 0: 2585.25 1: 37.1015 2: 1.47805 3: 0.166643 Eigenvector matrix V: Col: 0 1 2 3 Row 0: 0.0291933 0.179186 0.582076 0.792608 1: -0.328712 -0.741918 -0.370502 0.451923 2: 0.791411 0.100228 -0.509579 0.322416 3: -0.514553 0.638283 -0.514048 0.252161 Frobenius norm error in eigensystem A*V-D*V = 1.20349e-12 TEST02 For a symmetric matrix A, JACOBI_EIGENVALUE computes the eigenvalues D and eigenvectors V so that A * V = D * V. As a sanity check, input a diagonal matrix. Input matrix A: Col: 0 1 2 3 Row 0: 4 0 0 0 1: 0 1 0 0 2: 0 0 3 0 3: 0 0 0 2 Number of iterations = 1 Number of rotations = 0 Eigenvalues D: 0: 4 1: 3 2: 2 3: 1 Eigenvector matrix V: Col: 0 1 2 3 Row 0: 1 0 0 0 1: 0 0 0 1 2: 0 1 0 0 3: 0 0 1 0 Frobenius norm error in eigensystem A*V-D*V = 0 TEST03 For a symmetric matrix A, JACOBI_EIGENVALUE computes the eigenvalues D and eigenvectors V so that A * V = D * V. Use the discretized second derivative matrix. Input matrix A: Col: 0 1 2 3 4 Row 0: -2 1 0 0 0 1: 1 -2 1 0 0 2: 0 1 -2 1 0 3: 0 0 1 -2 1 4: 0 0 0 1 -2 Number of iterations = 10 Number of rotations = 43 Eigenvalues D: 0: -0.267949 1: -1 2: -2 3: -3 4: -3.73205 Eigenvector matrix V: Col: 0 1 2 3 4 Row 0: 0.288675 -0.5 0.57735 0.5 0.288675 1: 0.5 -0.5 -4.44985e-17 -0.5 -0.5 2: 0.57735 -7.0576e-17 -0.57735 5.05017e-17 0.57735 3: 0.5 0.5 1.86451e-16 0.5 -0.5 4: 0.288675 0.5 0.57735 -0.5 0.288675 Frobenius norm error in eigensystem A*V-D*V = 9.40195e-16 JACOBI_EIGENVALUE_TEST Normal end of execution. 15 July 2013 09:22:28 PM