void eta_matrix<T, X>::conjugate_by_permutation(permutation_matrix<T, X> & p) { // this = p * this * p(-1) #ifdef LEAN_DEBUG // auto rev = p.get_reverse(); // auto deb = ((*this) * rev); // deb = p * deb; #endif m_column_index = p.get_rev(m_column_index); for (auto & pair : m_column_vector.m_data) { pair.first = p.get_rev(pair.first); } #ifdef LEAN_DEBUG // lean_assert(deb == *this); #endif }
void row_eta_matrix<T, X>::conjugate_by_permutation(permutation_matrix<T, X> & p) { // this = p * this * p(-1) #ifdef LEAN_DEBUG // auto rev = p.get_reverse(); // auto deb = ((*this) * rev); // deb = p * deb; #endif m_row = p.apply_reverse(m_row); // copy aside the column indices std::vector<unsigned> columns; for (auto & it : m_row_vector.m_data) columns.push_back(it.first); for (unsigned i = columns.size(); i-- > 0;) m_row_vector.m_data[i].first = p.get_rev(columns[i]); #ifdef LEAN_DEBUG // lean_assert(deb == *this); #endif }