Loading src/TNL/Containers/Array.h +12 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,18 @@ class Array const Index begin = 0, Index end = -1 ); /** * \brief Sets the array elements using given lambda function. * * Sets all the array values to \e v. * * \param v Reference to a value. */ template< typename Function > void evaluate( const Function& f, const Index begin = 0, Index end = -1 ); /** * \brief Checks if there is an element with value \e v. * Loading src/TNL/Containers/Array.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -612,6 +612,18 @@ void Array< Value, Device, Index >::setValue( const ValueType& e, Algorithms::ArrayOperations< Device >::setMemory( &this->getData()[ begin ], e, end - begin ); } template< typename Value, typename Device, typename Index > template< typename Function > void Array< Value, Device, Index >::evaluate( const Function& f, const Index begin, Index end ) { TNL_ASSERT_TRUE( this->getData(), "Attempted to set a value of an empty array." ); this->getView().evaluate( f, begin, end ); } template< typename Value, typename Device, typename Index > Loading src/TNL/Containers/ArrayView.h +3 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,9 @@ public: * * \param v Reference to a value. */ void setValue( Value value ); void setValue( Value value, const Index begin = 0, Index end = -1 ); /** * \brief Sets the array elements using given lambda function. Loading src/TNL/Containers/ArrayView.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -299,10 +299,12 @@ template< typename Value, typename Index > void ArrayView< Value, Device, Index >:: setValue( Value value ) setValue( Value value, const Index begin, Index end ) { TNL_ASSERT_GT( size, 0, "Attempted to set value to an empty array view." ); Algorithms::ArrayOperations< Device >::setMemory( getData(), value, getSize() ); if( end == -1 ) end = this->getSize(); Algorithms::ArrayOperations< Device >::setMemory( &getData()[ begin ], value, end - begin ); } template< typename Value, Loading Loading
src/TNL/Containers/Array.h +12 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,18 @@ class Array const Index begin = 0, Index end = -1 ); /** * \brief Sets the array elements using given lambda function. * * Sets all the array values to \e v. * * \param v Reference to a value. */ template< typename Function > void evaluate( const Function& f, const Index begin = 0, Index end = -1 ); /** * \brief Checks if there is an element with value \e v. * Loading
src/TNL/Containers/Array.hpp +12 −0 Original line number Diff line number Diff line Loading @@ -612,6 +612,18 @@ void Array< Value, Device, Index >::setValue( const ValueType& e, Algorithms::ArrayOperations< Device >::setMemory( &this->getData()[ begin ], e, end - begin ); } template< typename Value, typename Device, typename Index > template< typename Function > void Array< Value, Device, Index >::evaluate( const Function& f, const Index begin, Index end ) { TNL_ASSERT_TRUE( this->getData(), "Attempted to set a value of an empty array." ); this->getView().evaluate( f, begin, end ); } template< typename Value, typename Device, typename Index > Loading
src/TNL/Containers/ArrayView.h +3 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,9 @@ public: * * \param v Reference to a value. */ void setValue( Value value ); void setValue( Value value, const Index begin = 0, Index end = -1 ); /** * \brief Sets the array elements using given lambda function. Loading
src/TNL/Containers/ArrayView.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -299,10 +299,12 @@ template< typename Value, typename Index > void ArrayView< Value, Device, Index >:: setValue( Value value ) setValue( Value value, const Index begin, Index end ) { TNL_ASSERT_GT( size, 0, "Attempted to set value to an empty array view." ); Algorithms::ArrayOperations< Device >::setMemory( getData(), value, getSize() ); if( end == -1 ) end = this->getSize(); Algorithms::ArrayOperations< Device >::setMemory( &getData()[ begin ], value, end - begin ); } template< typename Value, Loading