public void implicitDoubleStep ( int x1 , int x2 ) { if ( printHumps ) System . out . println ( "Performing implicit double step" ) ; // compute the wilkinson shift double z11 = A . get ( x2 - 1 , x2 - 1 ) ; double z12 = A . get ( x2 - 1 , x2 ) ; double z21 = A . get ( x2 , x2 - 1 ) ; double z22 = A . get ( x2 , x2 ) ; double a11 = A . get ( x1 , x1 ) ; double a21 = A . get ( x1 + 1 , x1 ) ; double a12 = A . get ( x1 , x1 + 1 ) ; double a22 = A . get ( x1 + 1 , x1 + 1 ) ; double a32 = A . get ( x1 + 2 , x1 + 1 ) ; if ( normalize ) { temp [ 0 ] = a11 ; temp [ 1 ] = a21 ; temp [ 2 ] = a12 ; temp [ 3 ] = a22 ; temp [ 4 ] = a32 ; temp [ 5 ] = z11 ; temp [ 6 ] = z22 ; temp [ 7 ] = z12 ; temp [ 8 ] = z21 ; double max = Math . abs ( temp [ 0 ] ) ; for ( int j = 1 ; j < temp . length ; j ++ ) { if ( Math . abs ( temp [ j ] ) > max ) max = Math . abs ( temp [ j ] ) ; } a11 /= max ; a21 /= max ; a12 /= max ; a22 /= max ; a32 /= max ; z11 /= max ; z22 /= max ; z12 /= max ; z21 /= max ; } // these equations are derived when the eigenvalues are extracted from the lower right // 2 by 2 matrix. See page 388 of Fundamentals of Matrix Computations 2nd ed for details. double b11 , b21 , b31 ; if ( useStandardEq ) { b11 = ( ( a11 - z11 ) * ( a11 - z22 ) - z21 * z12 ) / a21 + a12 ; b21 = a11 + a22 - z11 - z22 ; b31 = a32 ; } else { // this is different from the version in the book and seems in my testing to be more resilient to // over flow issues b11 = ( ( a11 - z11 ) * ( a11 - z22 ) - z21 * z12 ) + a12 * a21 ; b21 = ( a11 + a22 - z11 - z22 ) * a21 ; b31 = a32 * a21 ; } performImplicitDoubleStep ( x1 , x2 , b11 , b21 , b31 ) ; }
Performs an implicit double step using the values contained in the lower right hand side of the submatrix for the estimated eigenvector values .