public void _solveVectorInternal ( double [ ] vv ) { // Solve L*Y = B int ii = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int ip = indx [ i ] ; double sum = vv [ ip ] ; vv [ ip ] = vv [ i ] ; if ( ii != 0 ) { // for( int j = ii-1; j < i; j++ ) // sum -= dataLU[i* n +j]*vv[j]; int index = i * n + ii - 1 ; for ( int j = ii - 1 ; j < i ; j ++ ) sum -= dataLU [ index ++ ] * vv [ j ] ; } else if ( sum != 0.0 ) { ii = i + 1 ; } vv [ i ] = sum ; } // Solve U*X = Y; TriangularSolver_DDRM . solveU ( dataLU , vv , n ) ; }
a specialized version of solve that avoid additional checks that are not needed .