private ColumnVector _backSubstitution ( final ColumnVector y ) throws MatrixException { final ColumnVector x = new ColumnVector ( m_nRows ) ; // Do back substitution. for ( int r = m_nRows - 1 ; r >= 0 ; -- r ) { final int pr = m_aPermutation [ r ] ; // permuted row index float dot = 0 ; for ( int c = r + 1 ; c < m_nRows ; ++ c ) { dot += m_aLU . at ( pr , c ) * x . at ( c ) ; } x . set ( r , ( y . at ( r ) - dot ) / m_aLU . at ( pr , r ) ) ; } return x ; }
Solve Ux = y for x by back substitution .