Refactorization of matrices computations