1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-19 00:07:05 +01:00

Tweak to initialisation example

This commit is contained in:
2019-02-16 17:08:22 +00:00
parent b6803a070a
commit 00e9416e0a
2 changed files with 14 additions and 8 deletions

View File

@ -187,10 +187,10 @@ namespace Grid {
for( std::size_t j = 0; j < NumScalars; j++ ) {
// if constexpr is C++ 17 ... but otherwise need two specialisations (Container vs Scalar)
if constexpr ( InnerRank == 0 ) {
lambda( * pScalar, Seq++, &MyIndex[0] );
lambda( * pScalar, Seq++, MyIndex );
} else {
for( typename Scalar::scalar_type &Source : * pScalar ) {
lambda(Source, Seq++, &MyIndex[0] );
lambda(Source, Seq++, MyIndex );
// Now increment SubIndex
for( auto i = rank + InnerRank - 1; i != rank - 1 && ++MyIndex[i] == Dims[i]; i-- )
MyIndex[i] = 0;