Scythe-1.0.3
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2>
Matrix<T,RO,RS> scythe::row_interchange ( Matrix< T, PO1, PS1 >  A,
const Matrix< unsigned int, PO2, PS2 > &  p 
)

Interchange the rows of a Matrix according to a permutation vector.

This function permutes the rows of Matrix A according to perm_vec. Each element i of perm_vec contains a row-number, r. For each row, i, in A, A[i] is interchanged with A[r].

Parameters:
AThe matrix to permute.
pThe column vector describing the permutations to perform on A.
See also:
lu_decomp(Matrix<T,PO1,PS1>, Matrix<T,PO2,Concrete>&, Matrix<T,PO3,Concrete>&, Matrix<unsigned int, PO4, Concrete>&)
Exceptions:
scythe_dimension_error(Level 1)
scythe_conformation_error(Level 1)

References scythe::Matrix< T_type, ORDER, STYLE >::begin_f(), scythe::Matrix< T_type, ORDER, STYLE >::end_f(), scythe::Matrix_base< ORDER, STYLE >::isColVector(), scythe::Matrix_base< ORDER, STYLE >::isScalar(), scythe::Matrix_base< ORDER, STYLE >::rows(), and SCYTHE_CHECK_10.

Referenced by inv(), and lu_solve().