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