1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00
This commit is contained in:
Michael Marshall 2019-03-25 18:16:04 +00:00
parent bce2766fef
commit 625a97a466

View File

@ -78,7 +78,7 @@ namespace Grid {
} }
inline bool operator!=(const TensorIterator_raw<ETensor, bConst> &r) inline bool operator!=(const TensorIterator_raw<ETensor, bConst> &r)
{ return pET == nullptr || pET != r.pET || position != r.position; } { return pET == nullptr || pET != r.pET || position != r.position; }
// These functions aren't rerquired for iterators, but they make using them easier // These functions aren't required for iterators, but they make using them easier
inline bool AtEnd() { return position == end; } inline bool AtEnd() { return position == end; }
inline void DumpIndex(void) { inline void DumpIndex(void) {
for( auto dim : indexPos ) for( auto dim : indexPos )
@ -251,23 +251,11 @@ namespace Grid {
for( int i = 0 ; i < rank; i++ ) std::cout << "[" << dims[i] << "]"; for( int i = 0 ; i < rank; i++ ) std::cout << "[" << dims[i] << "]";
for( int i = 0 ; i < Traits::Rank; i++ ) std::cout << "(" << Traits::Dimension(i) << ")"; for( int i = 0 ; i < Traits::Rank; i++ ) std::cout << "(" << Traits::Dimension(i) << ")";
std::cout << " in memory order:" << std::endl; std::cout << " in memory order:" << std::endl;
#ifdef OLD_DEFINITION
for_all( t, [&](scalar_type &c, Index n, const std::array<Index, rank> &TensorIndex,
const std::array<int, Traits::Rank> &ScalarIndex ){
std::cout << " ";
for( auto dim : TensorIndex )
std::cout << "[" << dim << "]";
for( auto dim : ScalarIndex )
std::cout << "(" << dim << ")";
std::cout << " = " << c << std::endl;
} );
#else
for( auto it = begin(t); !it.AtEnd(); ++it ) { for( auto it = begin(t); !it.AtEnd(); ++it ) {
std::cout << " "; std::cout << " ";
it.DumpIndex(); it.DumpIndex();
std::cout << " = " << (const typename T::Scalar)(*it) << std::endl; std::cout << " = " << (const typename T::Scalar)(*it) << std::endl;
} }
#endif
std::cout << "========================================" << std::endl; std::cout << "========================================" << std::endl;
} }