Skip to content

Instantly share code, notes, and snippets.

@JohanMabille
Created December 28, 2019 22:16
Show Gist options
  • Save JohanMabille/bd33d8a836e1e842e80e54783a8ba7c5 to your computer and use it in GitHub Desktop.
Save JohanMabille/bd33d8a836e1e842e80e54783a8ba7c5 to your computer and use it in GitHub Desktop.
template <class T, class A>
inline auto xarray<T, A>::size() const -> size_type
{
return std::accumulate(m_shape.cbegin(), m_shape.cend(), size_type(1), std::multiplies<size_type>());
}
template <class T, class A>
inline auto xarray<T, A>::dimension() const -> size_type
{
return m_shape.size();
}
template <class T, class A>
inline auto xarray<T, A>::shape() -> const shape&
{
return m_shape;
}
template <class T, class A>
inline auto xarray<T, A>::shape(size_type i) -> size_type
{
return m_shape[i];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment