Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Xewar313 committed Jan 20, 2025
1 parent 359c4a1 commit c08620c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/example8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ int main() {
rowInd[i] = i * 2; // two elements per row
}
for (auto i = 0; i < nnz; i++) {
colInd[i] = (i % 2) * (std::max(i / 2, 1)); // column on 0 and diagonal (with additional entry in first row)
colInd[i] =
(i % 2) * (std::max(i / 2, 1)); // column on 0 and diagonal (with
// additional entry in first row)
values[i] = unif(re);
}

local_data = dr::views::csr_matrix_view<V, I>(values, rowInd, colInd, {size, size}, nnz, root);
local_data = dr::views::csr_matrix_view<V, I>(values, rowInd, colInd,
{size, size}, nnz, root);
}

dr::mp::distributed_sparse_matrix<
Expand All @@ -51,8 +54,10 @@ int main() {
gemv(root, res, matrix, broadcasted_b);

if (root == dr::mp::rank()) {
fmt::print("Matrix with {} x {} and number of non-zero entries equal to {} and entries:\n", matrix.shape().first, matrix.shape().second, matrix.size());
for (auto [i, v]: matrix) {
fmt::print("Matrix with {} x {} and number of non-zero entries equal to {} "
"and entries:\n",
matrix.shape().first, matrix.shape().second, matrix.size());
for (auto [i, v] : matrix) {
auto [n, m] = i;
fmt::print("Matrix entry <{}, {}, {}>\n", n, m, v);
}
Expand Down

0 comments on commit c08620c

Please sign in to comment.