7879808182838485868788
{ 1.0, 0.9, 0.7 }, { 0.9, 1.0, 0.3 }, { 0.7, 0.3, 1.0 } }, flags); final Matrix I = new Identity(3, flags); final Matrix M3 = new Matrix(new double[][] { { 1, 2, 3, 4 }, { 2, 0, 2, 1 }, { 0, 1, 0, 0 }
128129130131132133134135136137138
179180181182183184185186187188189
832833834835836837838839840841842
{ 1.0, 0.9, 0.7 }, { 0.9, 1.0, 0.3 }, { 0.7, 0.3, 1.0 } }, flags); final Matrix I = new Identity(3, flags); // from Higham - nearest correlation matrix final Matrix M5 = new Matrix(new double[][] { { 2, -1, 0, 0 }, { -1, 2, -1, 0 },
869870871872873874875876877878879
// System.out.println("I1 = "+I1.toString()); final Matrix I2 = A.mul(invA); // System.out.println("I2 = "+I2.toString()); final Matrix eins = new Identity(A.rows()); // System.out.println("eins = "+eins.toString()); final double d = norm(I1.sub(eins)); // System.out.println("d = "+String.valueOf(d));
15171518151915201521152215231524152515261527
} } // check normalization final Matrix m = eigenVectors.mul(eigenVectors.transpose()); final Identity ID = new Identity(N); final double tol = norm(m.sub(ID)); if (tol > 1.0e-15) { fail("Eigenvector not normalized"); } }
16391640164116421643164416451646164716481649