#ifndef __MIMASEXTERNALARRAYFUNC
#   error "Do not include this file directly."
#endif
#ifndef __MIMASINTERNALARRAYFUNC
#   error "Do not include this file directly."
#endif
#ifndef __MIMASFUNCTIONOBJECT
#   error "Do not include this file directly."
#endif

namespace mimas {

/** @addtogroup arrayOp
    @{ */
///
template <
  typename T, size_t NumDims, class Allocator,
  template< typename, size_t, class > class MultiArray
>
MultiArray< T, NumDims, Allocator > &__MIMASINTERNALARRAYFUNC( MultiArray< T, NumDims, Allocator > &a )
{
  return multi_apply( a, a, _multi_help1< T, T, __MIMASFUNCTIONOBJECT< T > >
                      ( __MIMASFUNCTIONOBJECT< T >() ) );
};

///
template <
  typename T, size_t NumDims, class Allocator,
  template< typename, size_t, class > class MultiArray
>
boost::multi_array< T, NumDims, Allocator > __MIMASEXTERNALARRAYFUNC( const MultiArray< T, NumDims, Allocator > &a )
{
  return multi_func< T >( a, __MIMASFUNCTIONOBJECT< T >() );
};

///@}
}

#undef __MIMASEXTERNALARRAYFUNC
#undef __MIMASINTERNALARRAYFUNC
#undef __MIMASFUNCTIONOBJECT