1 #ifndef jb_detail_array_traits_hpp 2 #define jb_detail_array_traits_hpp 7 #include <boost/multi_array.hpp> 23 template <
typename container_type>
41 template <
typename value_type,
typename container_type>
54 template <
typename container_type>
67 template <
typename container_type>
68 inline std::size_t
nsamples(container_type
const& a) {
81 template <
typename container_type>
96 template <
typename T, std::
size_t K,
typename A>
99 using element_type =
typename boost::multi_array<T, K, A>::element;
114 template <
typename value_type,
typename T, std::
size_t K,
typename A>
130 template <
typename T, std::
size_t K,
typename A>
132 return a.num_elements();
146 template <
typename T, std::
size_t K,
typename A>
147 inline std::size_t
nsamples(boost::multi_array<T, K, A>
const& a) {
148 return a.shape()[a.num_dimensions() - 1];
162 template <
typename T, std::
size_t K,
typename A>
163 inline std::vector<std::size_t>
165 return std::vector<std::size_t>(a.shape(), a.shape() + a.dimensionality);
178 template <
typename T>
188 template <
typename T>
200 template <
typename T, std::
size_t K>
202 :
public std::true_type {};
207 #endif // jb_detail_array_traits_hpp typename jb::fftw::aligned_multi_array< value_type, K > array_type
Define the type of the elements in the container.
typename jb::fftw::aligned_vector< complex_type > array_type
std::vector< T, jb::fftw::allocator< T > > aligned_vector
Alias std::vector with properly allocated storage for FFTW3.
typename container_type::value_type element_type
Define the type of the elements in the container.
boost::multi_array< value_type, num_dims, jb::fftw::allocator< value_type > > aligned_multi_array
Alias boost::multi_array with properly allocated storage for FFTW3.
std::size_t array_shape(container_type const &a)
Return the shape of the container in a form suitable for construction of a vector-like container...
Alias array_type based on the container_type shape to store value_type.
std::size_t nsamples(container_type const &a)
Count the elements in the last dimension of a vector-like container.
Determine if a timeseries type guarantees alignment suitable for SIMD optimizations.
typename boost::multi_array< T, K, A >::element element_type
Define the type of the elements in the array.
std::size_t element_count(container_type const &a)
Count the number of elements for a vector-like container.
Alias element type stored on a container.
The top-level namespace for the JayBeams library.