예제 #1
0
 //-----------------------------------------------------------------
 //! 
 //! \brief get number of dimensions 
 //! 
 //! Returns the number of dimensions of the array. 
 //!
 //! \return number of dimensions
 //!
 size_t rank() const 
 { 
     return _imap.rank(); 
 }
예제 #2
0
 //----------------------------------------------------------------
 //! 
 //! \brief shape to container
 //! 
 //! This returns a container of type CTYPE with the number of
 //! elements stored in the array. 
 //! 
 //! \tparam CTYPE container type 
 //! \return instance of CTYPE with shape data
 //!
 template<typename CTYPE> CTYPE shape() const
 {
     auto c = container_utils<CTYPE>::create(_imap.rank());
     std::copy(_imap.begin(),_imap.end(),c.begin());
     return c;
 }