688 const std::vector<size_type> &col_block_sizes);
698 const MPI_Comm communicator = MPI_COMM_WORLD);
712 const std::vector<IndexSet> &row_parallel_partitioning,
713 const std::vector<IndexSet> &column_parallel_partitioning,
714 const std::vector<IndexSet> &writeable_rows,
715 const MPI_Comm communicator = MPI_COMM_WORLD);
727 reinit(
const std::vector<size_type> &row_block_sizes,
728 const std::vector<size_type> &col_block_sizes);
735 reinit(
const std::vector<IndexSet> ¶llel_partitioning,
736 const MPI_Comm communicator = MPI_COMM_WORLD);
744 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
745 const std::vector<IndexSet> &column_parallel_partitioning,
746 const MPI_Comm communicator = MPI_COMM_WORLD);
757 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
758 const std::vector<IndexSet> &column_parallel_partitioning,
759 const std::vector<IndexSet> &writeable_rows,
760 const MPI_Comm communicator = MPI_COMM_WORLD);
844 ForwardIterator begin,
846 const bool indices_are_sorted)
850 Assert(n_rows() == compute_n_rows(), ExcNeedsCollectSizes());
851 Assert(n_cols() == compute_n_cols(), ExcNeedsCollectSizes());
855 if (indices_are_sorted && n_cols > 0)
857 block_column_indices[0].resize(0);
859 const std::pair<size_type, size_type> row_index =
860 this->row_indices.global_to_local(row);
861 const auto n_blocks = column_indices.size();
866 size_type current_start_index = column_indices.block_start(current_block);
868 current_block == n_blocks - 1 ?
870 column_indices.block_start(current_block + 1);
872 for (
auto it = begin; it < end; ++it)
877 if (*it >= next_start_index)
881 sub_objects[row_index.first][current_block]->add_entries(
883 block_column_indices[0].begin(),
884 block_column_indices[0].end(),
886 block_column_indices[0].clear();
888 auto block_and_col = column_indices.global_to_local(*it);
889 current_block = block_and_col.first;
890 current_start_index = column_indices.block_start(current_block);
892 current_block == n_blocks - 1 ?
894 column_indices.block_start(current_block + 1);
896 const size_type local_index = *it - current_start_index;
897 block_column_indices[0].push_back(local_index);
902 auto check_block_and_col = column_indices.global_to_local(*it);
903 Assert(current_block == check_block_and_col.first,
905 Assert(local_index == check_block_and_col.second,
911 sub_objects[row_index.first][current_block]->add_entries(
913 block_column_indices[0].begin(),
914 block_column_indices[0].end(),
931 if (block_column_indices[0].size() < n_cols)
932 for (
size_type i = 0; i < this->n_block_cols(); ++i)
933 block_column_indices[i].resize(n_cols);
937 for (
size_type i = 0; i < this->n_block_cols(); ++i)
938 counter_within_block[i] = 0;
949 for (ForwardIterator it = begin; it != end; ++it)
953 const std::pair<size_type, size_type> col_index =
954 this->column_indices.global_to_local(col);
956 const size_type local_index = counter_within_block[col_index.first]++;
958 block_column_indices[col_index.first][local_index] = col_index.second;
966 const std::pair<size_type, size_type> row_index =
967 this->row_indices.global_to_local(row);
968 for (
size_type block_col = 0; block_col < n_block_cols(); ++block_col)
970 if (counter_within_block[block_col] == 0)
972 sub_objects[row_index.first][block_col]->add_entries(
974 block_column_indices[block_col].begin(),
975 block_column_indices[block_col].begin() +
976 counter_within_block[block_col],