From c94488edbf930456ccd489ff5dc8823530a134ed Mon Sep 17 00:00:00 2001 From: Bimal Gaudel Date: Tue, 21 May 2024 12:57:25 -0400 Subject: [PATCH] Use of `ArrayIterator::ordinal()` changed to `ArrayIterator::index()` to allow rank-1 array handling. --- src/TiledArray/conversions/dense_to_sparse.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TiledArray/conversions/dense_to_sparse.h b/src/TiledArray/conversions/dense_to_sparse.h index e5c23cf5ba..6147c01a56 100644 --- a/src/TiledArray/conversions/dense_to_sparse.h +++ b/src/TiledArray/conversions/dense_to_sparse.h @@ -27,7 +27,7 @@ to_sparse(DistArray 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 @@ -40,9 +40,9 @@ to_sparse(DistArray 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()); } }