27 template <
typename MatrixType,
typename VectorType>
28 inline void copy_partial_row(
const MatrixType& matrix, VectorType& vector,
size_t row,
size_t first_column,
size_t beyond_column)
31 for (
size_t i = first_column; i < beyond_column; ++i, ++j)
33 vector[j] = matrix(row, i);
47 template <
typename MatrixType,
typename VectorType>
48 inline void copy_partial_column(
const MatrixType& matrix, VectorType& vector,
size_t column,
size_t first_row,
size_t beyond_row)
75 template <
typename MatrixType>
77 size_t& bottom_right_height,
size_t& bottom_right_width)
79 const size_t height = matrix.
size1();
80 size_t free_rows_first = top_left_height;
81 size_t free_rows_beyond = height - bottom_right_height;
83 const size_t width = matrix.
size2();
84 size_t free_columns_first = top_left_width;
85 size_t free_columns_beyond = width - bottom_right_width;
95 std::vector <bool> bottom_left_row(top_left_width);
97 for (
size_t row = free_rows_beyond; row < height; ++row)
105 std::vector <bool> top_right_row(bottom_right_width);
107 for (
size_t row = 0; row < top_left_height; ++row)
119 for (
size_t row = free_rows_first; row < free_rows_beyond; ++row)
122 if (!top_right_row_space.
is_spanned(top_right_row))
125 if (!bottom_left_row_space.
is_spanned(bottom_left_row))
128 ++bottom_right_height;
138 std::vector <bool> top_right_column(top_left_height);
140 for (
size_t column = free_columns_beyond; column < width; ++column)
148 std::vector <bool> bottom_left_column(bottom_right_height);
150 for (
size_t column = 0; column < top_left_width; ++column)
160 for (
size_t column = free_columns_first; column < free_columns_beyond; ++column)
163 if (!bottom_left_column_space.
is_spanned(bottom_left_column))
166 if (!top_right_column_space.
is_spanned(top_right_column))
169 ++bottom_right_width;
170 --free_columns_beyond;
177 switch (bottom_left_column_space.
dimension())
193 top_left_height = height - bottom_right_height;
194 top_left_width = width - bottom_right_width;
Definition: binary_linear_space.hpp:16
bool insert_checked(const vector_type &vector)
Definition: binary_linear_space.hpp:96
bool is_spanned(const vector_type &vector) const
Definition: binary_linear_space.hpp:162
size_t dimension() const
Definition: binary_linear_space.hpp:83
Definition: matrix_permuted.hpp:17
size_type size2() const
Definition: matrix_permuted.hpp:65
size_type size1() const
Definition: matrix_permuted.hpp:56
Definition: matrix_transposed.hpp:47
void copy_partial_column(const MatrixType &matrix, VectorType &vector, size_t column, size_t first_row, size_t beyond_row)
Definition: partition.hpp:48
void copy_partial_row(const MatrixType &matrix, VectorType &vector, size_t row, size_t first_column, size_t beyond_column)
Definition: partition.hpp:28
Definition: algorithm.hpp:14
std::pair< size_t, size_t > size_pair_t
Definition: partition.hpp:12
rank_distribution
Definition: partition.hpp:59
@ RANK_TOO_HIGH
Definition: partition.hpp:60
@ RANK_BL_1_TR_1
Definition: partition.hpp:60
@ RANK_BL_2_TR_0
Definition: partition.hpp:60
@ RANK_BL_0_TR_2
Definition: partition.hpp:60
void matrix_permute1(MatrixType &matrix, size_t index1, size_t index2)
Definition: matrix.hpp:1723
rank_distribution partition(matrix_permuted< const MatrixType > &matrix, size_t &top_left_height, size_t &top_left_width, size_t &bottom_right_height, size_t &bottom_right_width)
Definition: partition.hpp:76
void matrix_permute2(MatrixType &matrix, size_t index1, size_t index2)
Definition: matrix.hpp:1740