Loading src/TNL/Containers/NDArray.h +0 −9 Original line number Diff line number Diff line Loading @@ -167,9 +167,6 @@ public: operator()( IndexTypes&&... indices ) { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading @@ -179,9 +176,6 @@ public: operator()( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading Loading @@ -294,9 +288,6 @@ public: getElement( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array.getElement( getStorageIndex( std::forward< IndexTypes >( indices )... ) ); } Loading src/TNL/Containers/NDArrayIndexer.h +13 −4 Original line number Diff line number Diff line Loading @@ -91,10 +91,19 @@ public: getStorageIndex( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == SizesHolder::getDimension(), "got wrong number of indices" ); return Base::template getStorageIndex< Permutation, Overlaps > __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); const IndexType result = Base::template getStorageIndex< Permutation, Overlaps > ( sizes, static_cast< const StridesHolder& >( *this ), std::forward< IndexTypes >( indices )... ); TNL_ASSERT_GE( result, (IndexType) 0, "storage index out of bounds - either input error or a bug in the indexer" ); // upper bound can be checked only for contiguous arrays/views if( StridesHolder::isContiguous() ) { TNL_ASSERT_LT( result, getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); } return result; } protected: Loading src/TNL/Containers/NDArrayView.h +0 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ public: operator()( IndexTypes&&... indices ) { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading @@ -233,7 +232,6 @@ public: operator()( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading Loading
src/TNL/Containers/NDArray.h +0 −9 Original line number Diff line number Diff line Loading @@ -167,9 +167,6 @@ public: operator()( IndexTypes&&... indices ) { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading @@ -179,9 +176,6 @@ public: operator()( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading Loading @@ -294,9 +288,6 @@ public: getElement( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); TNL_ASSERT_LT( getStorageIndex( std::forward< IndexTypes >( indices )... ), getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); return array.getElement( getStorageIndex( std::forward< IndexTypes >( indices )... ) ); } Loading
src/TNL/Containers/NDArrayIndexer.h +13 −4 Original line number Diff line number Diff line Loading @@ -91,10 +91,19 @@ public: getStorageIndex( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == SizesHolder::getDimension(), "got wrong number of indices" ); return Base::template getStorageIndex< Permutation, Overlaps > __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); const IndexType result = Base::template getStorageIndex< Permutation, Overlaps > ( sizes, static_cast< const StridesHolder& >( *this ), std::forward< IndexTypes >( indices )... ); TNL_ASSERT_GE( result, (IndexType) 0, "storage index out of bounds - either input error or a bug in the indexer" ); // upper bound can be checked only for contiguous arrays/views if( StridesHolder::isContiguous() ) { TNL_ASSERT_LT( result, getStorageSize(), "storage index out of bounds - either input error or a bug in the indexer" ); } return result; } protected: Loading
src/TNL/Containers/NDArrayView.h +0 −2 Original line number Diff line number Diff line Loading @@ -223,7 +223,6 @@ public: operator()( IndexTypes&&... indices ) { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading @@ -233,7 +232,6 @@ public: operator()( IndexTypes&&... indices ) const { static_assert( sizeof...( indices ) == getDimension(), "got wrong number of indices" ); __ndarray_impl::assertIndicesInBounds( getSizes(), OverlapsType{}, std::forward< IndexTypes >( indices )... ); return array[ getStorageIndex( std::forward< IndexTypes >( indices )... ) ]; } Loading