18 template <
typename MatrixType>
22 for (
size_t row = 0; row < matrix.size1(); ++row)
24 size_t target_row = p(row);
26 p.
rswap(row, target_row);
38 template <
typename MatrixType>
49 template <
typename MatrixType,
typename Less>
79 typename MatrixType::value_type va =
matrix_(a, column);
80 typename MatrixType::value_type vb =
matrix_(b, column);
84 else if (
less_(vb, va))
109 template <
typename MatrixType,
typename ElementLess>
110 inline void matrix_reorder_rows(
const MatrixType& matrix,
size_t row_first,
size_t row_beyond,
size_t column_first,
size_t column_beyond,
111 ElementLess element_less,
permutation& result_permutation)
113 result_permutation.
reset(matrix.size1());
115 sort(result_permutation, row_first, row_beyond, less);
130 template <
typename MatrixType,
typename ElementLess>
131 inline void matrix_reorder_columns(
const MatrixType& matrix,
size_t row_first,
size_t row_beyond,
size_t column_first,
size_t column_beyond,
132 ElementLess element_less,
permutation& result_permutation)
135 matrix_reorder_rows(transposed, column_first, column_beyond, row_first, row_beyond, element_less, result_permutation);
149 template <
typename MatrixType,
typename ElementLess>
150 inline void matrix_reorder_rows(MatrixType& matrix,
size_t row_first,
size_t row_beyond,
size_t column_first,
size_t column_beyond,
151 ElementLess element_less)
154 matrix_reorder_rows(matrix, row_first, row_beyond, column_first, column_beyond, element_less, perm);
169 template <
typename MatrixType,
typename ElementLess>
170 inline void matrix_reorder_columns(MatrixType& matrix,
size_t row_first,
size_t row_beyond,
size_t column_first,
size_t column_beyond,
171 ElementLess element_less)
174 matrix_reorder_rows(matrix, column_first, column_beyond, row_first, row_beyond, element_less);
Definition: matrix_transposed.hpp:47
Definition: matroid_transposed.hpp:14
Definition: permutations.hpp:44
void reset(size_t new_size)
Definition: permutations.hpp:111
void rswap(value_type a, value_type b)
Definition: permutations.hpp:199
Definition: algorithm.hpp:14
void sort(permutation &permutation, size_t first, size_t beyond, Less &less)
Definition: permutations.hpp:583
void matrix_permute1(MatrixType &matrix, size_t index1, size_t index2)
Definition: matrix.hpp:1723
void matrix_reorder_columns(const MatrixType &matrix, size_t row_first, size_t row_beyond, size_t column_first, size_t column_beyond, ElementLess element_less, permutation &result_permutation)
Definition: matrix_reorder.hpp:131
void matrix_reorder_rows(const MatrixType &matrix, size_t row_first, size_t row_beyond, size_t column_first, size_t column_beyond, ElementLess element_less, permutation &result_permutation)
Definition: matrix_reorder.hpp:110
void matrix_apply_column_permutation(MatrixType &matrix, const permutation &perm)
Definition: matrix_reorder.hpp:39
void matrix_apply_row_permutation(MatrixType &matrix, const permutation &perm)
Definition: matrix_reorder.hpp:19
Definition: matrix_reorder.hpp:51
bool operator()(size_t a, size_t b)
Definition: matrix_reorder.hpp:75
const MatrixType & matrix_
Definition: matrix_reorder.hpp:91
size_t column_first_
Definition: matrix_reorder.hpp:92
Less less_
Definition: matrix_reorder.hpp:94
size_t column_beyond_
Definition: matrix_reorder.hpp:93
matrix_reorder_row_less(const MatrixType &matrix, size_t column_first, size_t column_beyond, Less less)
Definition: matrix_reorder.hpp:61