|
1 | | -#include <cassert> |
| 1 | +// Copyright (c) 2018 Henri Menke. All rights reserved. |
| 2 | + |
2 | 3 | #include <iostream> |
3 | 4 | #include <stdexcept> |
4 | 5 | #include <string> |
5 | | -#include <tuple> |
6 | 6 | #include <type_traits> |
7 | 7 |
|
8 | 8 | #ifdef __CUDACC__ |
@@ -183,7 +183,7 @@ class multi_array { |
183 | 183 | DEVICE_FUNC const_pointer data() const noexcept { return m_data; } |
184 | 184 |
|
185 | 185 | template <typename... Idx> |
186 | | - DEVICE_FUNC CXX14_CONSTEXPR reference operator()(Idx... idx) noexcept { |
| 186 | + DEVICE_FUNC CXX14_CONSTEXPR reference operator()(Idx... idx) { |
187 | 187 | static_assert(sizeof...(idx) == sizeof...(N), "dimension mismatch"); |
188 | 188 | static_assert( |
189 | 189 | meta::all<std::is_convertible<Idx, size_type>::value...>::value, |
@@ -196,7 +196,7 @@ class multi_array { |
196 | 196 | } |
197 | 197 |
|
198 | 198 | template <typename... Idx> |
199 | | - DEVICE_FUNC constexpr value_type operator()(Idx... idx) const noexcept { |
| 199 | + DEVICE_FUNC constexpr value_type operator()(Idx... idx) const { |
200 | 200 | static_assert(sizeof...(idx) == sizeof...(N), "dimension mismatch"); |
201 | 201 | static_assert( |
202 | 202 | meta::all<std::is_convertible<Idx, size_type>::value...>::value, |
@@ -209,15 +209,15 @@ class multi_array { |
209 | 209 | } |
210 | 210 |
|
211 | 211 | template <size_type... idx> |
212 | | - DEVICE_FUNC CXX14_CONSTEXPR reference get() noexcept { |
| 212 | + DEVICE_FUNC CXX14_CONSTEXPR reference get() { |
213 | 213 | static_assert(sizeof...(idx) == sizeof...(N), "dimension mismatch"); |
214 | 214 | static_assert(meta::all<size_less<idx, N>::value...>::value, |
215 | 215 | "index out of bounds"); |
216 | 216 | return this->operator()(idx...); |
217 | 217 | } |
218 | 218 |
|
219 | 219 | template <size_type... idx> |
220 | | - DEVICE_FUNC constexpr value_type get() const noexcept { |
| 220 | + DEVICE_FUNC constexpr value_type get() const { |
221 | 221 | static_assert(sizeof...(idx) == sizeof...(N), "dimension mismatch"); |
222 | 222 | static_assert(meta::all<size_less<idx, N>::value...>::value, |
223 | 223 | "index out of bounds"); |
@@ -233,6 +233,18 @@ class multi_array { |
233 | 233 | DEVICE_FUNC constexpr size_type size() const noexcept { |
234 | 234 | return size_product<N...>::value; |
235 | 235 | } |
| 236 | + |
| 237 | + // Maybe add these member functions |
| 238 | + // - at |
| 239 | + // - (c,r,cr)begin, (c,r,cr)end |
| 240 | + // - front, back (how useful are those?) |
| 241 | + // Maybe add these operators |
| 242 | + // - operator== |
| 243 | + // - operator!= |
| 244 | + // - operator< |
| 245 | + // - operator<= |
| 246 | + // - operator> |
| 247 | + // - operator>= |
236 | 248 | }; |
237 | 249 |
|
238 | 250 | } // namespace math |
|