Skip to content

Commit

Permalink
Use of ArrayIterator::ordinal() changed to ArrayIterator::index()
Browse files Browse the repository at this point in the history
… to allow rank-1 array handling.
  • Loading branch information
bimalgaudel committed May 21, 2024
1 parent 4b3f39f commit c94488e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TiledArray/conversions/dense_to_sparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ to_sparse(DistArray<Tile, ArgPolicy> const &dense_array) {
const auto begin = dense_array.begin();
for (auto it = begin; it != end; ++it) {
// write the norm of each local tile to the tensor
norm(it->get(), tile_norms[it.ordinal()]);
norm(it->get(), tile_norms[it.index()]);
}

// Construct a sparse shape the constructor will handle communicating the
Expand All @@ -40,9 +40,9 @@ to_sparse(DistArray<Tile, ArgPolicy> const &dense_array) {
// sparse_array set the sparse array tile with a clone so as not to hold
// a pointer to the original tile.
for (auto it = begin; it != end; ++it) {
const auto ord = it.ordinal();
if (!sparse_array.is_zero(ord)) {
sparse_array.set(ord, it->get().clone());
const auto ix = it.index();
if (!sparse_array.is_zero(ix)) {
sparse_array.set(ix, it->get().clone());
}
}

Expand Down

0 comments on commit c94488e

Please sign in to comment.