23#ifndef MORPHEUS_FORMAT_TRAITS_HPP
24#define MORPHEUS_FORMAT_TRAITS_HPP
27#include <Morpheus_TypeTraits.hpp>
28#include <Morpheus_SpaceTraits.hpp>
30#include <impl/Morpheus_MatrixTags.hpp>
31#include <impl/Morpheus_VectorTags.hpp>
65 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
91 U*,
typename std::enable_if<Impl::has_sparse_matrix_tag_v<U>>::type* =
98 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
123 U*,
typename std::enable_if<Impl::has_dense_matrix_tag_v<U>>::type* =
127 static no& test(...);
130 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
160 static no& test(...);
163 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
188 U*,
typename std::enable_if<is_matrix_container_v<U> ||
189 is_vector_container_v<U>>::type* =
nullptr);
192 static no& test(...);
195 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
226 static no& test(...);
229 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
248template <
class T1,
class T2>
253 template <
class U1,
class U2>
255 typename U1::tag*,
typename U2::tag*,
256 typename std::enable_if<
257 is_container_v<U1> && is_container_v<U2> &&
258 std::is_same<typename U1::tag, typename U2::tag>::value>::type* =
261 template <
class U1,
class U2>
262 static no& test(...);
265 static const bool value =
266 sizeof(test<T1, T2>(
nullptr,
nullptr)) ==
sizeof(yes);
275template <
typename T1,
typename T2>
285template <
class T1,
class T2>
290 template <
class U1,
class U2>
293 typename std::enable_if<has_same_memory_space_v<U1, U2> &&
294 has_same_layout_v<U1, U2> &&
295 has_same_value_type_v<U1, U2> &&
296 has_same_index_type_v<U1, U2>>::type* =
nullptr);
298 template <
class U1,
class U2>
299 static no& test(...);
302 static const bool value =
303 sizeof(test<T1, T2>(
nullptr,
nullptr)) ==
sizeof(yes);
312template <
typename T1,
typename T2>
322template <
class T1,
class T2>
327 template <
class U1,
class U2>
329 typename U1::tag*,
typename U2::tag*,
332 is_compatible_v<U1, U2>>::type* =
nullptr);
334 template <
class U1,
class U2>
335 static no& test(...);
338 static const bool value =
339 sizeof(test<T1, T2>(
nullptr,
nullptr)) ==
sizeof(yes);
348template <
typename T1,
typename T2>
359template <
typename T1,
typename T2>
361 : std::integral_constant<bool, has_same_format_v<T1, T2> &&
362 is_compatible_v<T1, T2>> {};
370template <
typename T1,
typename T2>
382template <
class T1,
class T2>
387 template <
class U1,
class U2>
390 typename std::enable_if<
391 !has_same_memory_space_v<U1, U2> && has_same_format_v<U1, U2> &&
392 has_same_layout_v<U1, U2> && has_same_value_type_v<U1, U2> &&
393 has_same_index_type_v<U1, U2>>::type* =
nullptr);
395 template <
class U1,
class U2>
396 static no& test(...);
399 static const bool value =
400 sizeof(test<T1, T2>(
nullptr,
nullptr)) ==
sizeof(yes);
Checks if the given type T has a valid Dynamic Matrix Tag i.e has a tag member trait that is a derive...
Definition: Morpheus_MatrixTags.hpp:277
Checks if the given type T has a tag trait of type MatrixTag.
Definition: Morpheus_MatrixTags.hpp:89
Checks if the given type T has a valid Vector Tag i.e has a tag member trait that is a derived class ...
Definition: Morpheus_VectorTags.hpp:86
Checks if the two types are compatible containers i.e are in the same memory space and have the same ...
Definition: Morpheus_FormatTraits.hpp:286
Checks if the given type T is a valid Morpheus Container i.e is either a valid matrix or a vector con...
Definition: Morpheus_FormatTraits.hpp:182
A valid Dense Matrix container is the one that has a valid Dense Matrix tag i.e satisfies the has_den...
Definition: Morpheus_FormatTraits.hpp:117
A valid Dynamic Matrix container is the one that has a valid Dynamic Matrix tag i....
Definition: Morpheus_FormatTraits.hpp:215
Checks if the two types are dynamically compatible containers i.e are compatible containers and at le...
Definition: Morpheus_FormatTraits.hpp:323
A valid Matrix container is the one that has a valid Matrix tag i.e satisfies the has_matrix_tag chec...
Definition: Morpheus_FormatTraits.hpp:52
A valid Sparse Matrix container is the one that has a valid Sparse Matrix tag i.e satisfies the has_s...
Definition: Morpheus_FormatTraits.hpp:85
A valid Vector container is the one that has a valid Vector tag i.e satisfies the has_vector_tag chec...
Definition: Morpheus_FormatTraits.hpp:150
Generic Morpheus interfaces.
Definition: dummy.cpp:24
constexpr bool is_container_v
Short-hand to is_container.
Definition: Morpheus_FormatTraits.hpp:204
constexpr bool is_vector_container_v
Short-hand to is_vector_container.
Definition: Morpheus_FormatTraits.hpp:172
constexpr bool is_compatible_v
Short-hand to is_compatible.
Definition: Morpheus_FormatTraits.hpp:313
constexpr bool is_dense_matrix_container_v
Short-hand to is_dense_matrix_container.
Definition: Morpheus_FormatTraits.hpp:139
constexpr bool is_format_compatible_v
Short-hand to is_format_compatible.
Definition: Morpheus_FormatTraits.hpp:371
constexpr bool has_same_format_v
Short-hand to has_same_format.
Definition: Morpheus_FormatTraits.hpp:276
constexpr bool is_matrix_container_v
Short-hand to is_matrix_container.
Definition: Morpheus_FormatTraits.hpp:74
constexpr bool is_dynamically_compatible_v
Short-hand to is_dynamically_compatible.
Definition: Morpheus_FormatTraits.hpp:349
constexpr bool is_dynamic_matrix_container_v
Short-hand to is_dynamic_matrix_container.
Definition: Morpheus_FormatTraits.hpp:238
constexpr bool is_sparse_matrix_container_v
Short-hand to is_sparse_matrix_container.
Definition: Morpheus_FormatTraits.hpp:107