int determinant_sign(const bnu::permutation_matrix<std ::size_t>& pm) { int pm_sign=1; std::size_t size = pm.size(); for (std::size_t i = 0; i < size; ++i) if (i != pm(i)) pm_sign *= -1.0; // swap_rows would swap a pair of rows here, so we change sign return pm_sign; }
static void resize( const boost::numeric::ublas::vector< T_V , A_V > &v, boost::numeric::ublas::permutation_matrix< T , A > &m ) { m.resize( v.size() , v.size() ); }
static bool same_size( const boost::numeric::ublas::permutation_matrix< T , A > &m , const boost::numeric::ublas::vector< T_V , A_V > &v ) { return ( m.size() == v.size() ); // && ( m.size2() == v.size() ) ); }