#ifndef LU_APPLY_PERM_INV_H #define LU_APPLY_PERM_INV_H 1 #include namespace flens { // Compute A = P^{-1}*A = P^T*A template void apply_perm_inv(const DenseVector &p, GeMatrix &A) { typedef typename GeMatrix::IndexType IndexType; const Underscore _; const IndexType m = p.length(); // apply row interchanges for (IndexType i=1; i<=m; ++i) { if (i!=p(i)) { blas::swap(A(i,_), A(p(i),_)); } } } } // namespace flens #endif // LU_APPLY_PERM_INV_H