Loading src/TNL/Containers/Array.h +26 −0 Original line number Diff line number Diff line Loading @@ -109,14 +109,40 @@ class Array : public Object template< typename ArrayT > void setLike( const ArrayT& array ); /** * \brief Binds \e _data with this array. * * Releases old data and binds this array with new \e _data. Also sets new * \e _size of this array. * @param _data Pointer to new data. * @param _size Size of new _data. Number of elements. */ void bind( Value* _data, const Index _size ); /** * \brief Binds this array with another \e array. * * Releases old data and binds this array with new \e array starting at * position \e begin. Also sets new \e size of this array. * \tparam ArrayT Type of array. * \param array Reference to a new array. * \param begin Starting index position. * \param size Size of new array. Number of elements. */ template< typename ArrayT > void bind( const ArrayT& array, const IndexType& begin = 0, const IndexType& size = 0 ); /** * \brief Binds this array with a static array of size \e Size. * * Releases old data and binds this array with a static array of size \e * Size. * \tparam Size Size of array. * \param array Reference to a static array. */ template< int Size > void bind( StaticArray< Size, Value >& array ); Loading src/TNL/Containers/StaticArray.h +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ class StaticArray __cuda_callable__ inline StaticArray(); /** * \brief Constructor that sets all array components (with the number of \e Size) to value \e v. */ // Note: the template avoids ambiguity of overloaded functions with literal 0 and pointer // reference: https://stackoverflow.com/q/4610503 template< typename _unused = void > Loading @@ -39,7 +42,7 @@ class StaticArray inline StaticArray( const Value v[ Size ] ); /** * \brief Constructor that sets all vector components to value \e v. * \brief Constructor that sets all array components to value \e v. */ __cuda_callable__ inline StaticArray( const Value& v ); Loading Loading
src/TNL/Containers/Array.h +26 −0 Original line number Diff line number Diff line Loading @@ -109,14 +109,40 @@ class Array : public Object template< typename ArrayT > void setLike( const ArrayT& array ); /** * \brief Binds \e _data with this array. * * Releases old data and binds this array with new \e _data. Also sets new * \e _size of this array. * @param _data Pointer to new data. * @param _size Size of new _data. Number of elements. */ void bind( Value* _data, const Index _size ); /** * \brief Binds this array with another \e array. * * Releases old data and binds this array with new \e array starting at * position \e begin. Also sets new \e size of this array. * \tparam ArrayT Type of array. * \param array Reference to a new array. * \param begin Starting index position. * \param size Size of new array. Number of elements. */ template< typename ArrayT > void bind( const ArrayT& array, const IndexType& begin = 0, const IndexType& size = 0 ); /** * \brief Binds this array with a static array of size \e Size. * * Releases old data and binds this array with a static array of size \e * Size. * \tparam Size Size of array. * \param array Reference to a static array. */ template< int Size > void bind( StaticArray< Size, Value >& array ); Loading
src/TNL/Containers/StaticArray.h +4 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ class StaticArray __cuda_callable__ inline StaticArray(); /** * \brief Constructor that sets all array components (with the number of \e Size) to value \e v. */ // Note: the template avoids ambiguity of overloaded functions with literal 0 and pointer // reference: https://stackoverflow.com/q/4610503 template< typename _unused = void > Loading @@ -39,7 +42,7 @@ class StaticArray inline StaticArray( const Value v[ Size ] ); /** * \brief Constructor that sets all vector components to value \e v. * \brief Constructor that sets all array components to value \e v. */ __cuda_callable__ inline StaticArray( const Value& v ); Loading