17 August 2018 11:19:25 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: 0.166643 1: 1.47805 2: 37.1015 3: 2585.25 Eigenvector matrix V: Col: 0 1 2 3 Row 0: 0.792608 0.582076 0.179186 0.0291933 1: 0.451923 -0.370502 -0.741918 -0.328712 2: 0.322416 -0.509579 0.100228 0.791411 3: 0.252161 -0.514048 0.638283 -0.514553 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: 1 1: 2 2: 3 3: 4 Eigenvector matrix V: Col: 0 1 2 3 Row 0: 0 0 0 1 1: 1 0 0 0 2: 0 0 1 0 3: 0 1 0 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: -3.73205 1: -3 2: -2 3: -1 4: -0.267949 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 5.05017e-17 -0.57735 -7.0576e-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. 17 August 2018 11:19:25 PM