mgcpp
A C++ Math Library Based on CUDA
trans_expr.hpp
Go to the documentation of this file.
1 // Copyright RedPortal, mujjingun 2017 - 2018.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef _MGCPP_TYPE_TRAITS_TRANS_EXPR_HPP_
7 #define _MGCPP_TYPE_TRAITS_TRANS_EXPR_HPP_
8 
9 #include <type_traits>
10 
11 #include <mgcpp/gpu/forward.hpp>
12 #include <mgcpp/system/concept.hpp>
13 #include <mgcpp/type_traits/gpu_mat.hpp>
14 #include <mgcpp/type_traits/recursive_eval.hpp>
15 
16 namespace mgcpp {
17 template <typename Expr>
18 struct is_mat_trans_expr : std::false_type {};
19 
20 template <typename Expr,
21  typename GpuMat,
22  MGCPP_CONCEPT(assert_gpu_matrix<GpuMat>)>
23 struct is_mat_trans_expr<trans<GpuMat>> : std::true_type {};
24 
25 template <typename... VariadicExpr>
27  using result = typename std::enable_if<
28  fold_or<is_mat_trans_expr, VariadicExpr...>::value>::type;
29 };
30 
31 template <typename T, typename... VariadicExpr>
33  using result = typename std::
34  enable_if<fold_or<is_mat_trans_expr, VariadicExpr...>::value, T>::type;
35 };
36 
37 template <typename Expr>
38 struct assert_mat_trans_expr {
39  using result =
40  typename std::enable_if<is_mat_trans_expr<Expr>::value>> ::type;
41 };
42 
43 } // namespace mgcpp
44 
45 #endif
Definition: adapter_base.hpp:12
typename std::enable_if< fold_or< is_mat_trans_expr, VariadicExpr... >::value, T >::type result
Definition: trans_expr.hpp:34
Definition: trans_expr.hpp:18
Definition: trans_expr.hpp:32
Definition: trans_expr.hpp:26
dmat_trans_expr< Expr > trans(dmat_expr< Expr > const &expr) noexcept
#define MGCPP_CONCEPT(...)
Definition: concept.hpp:10
typename std::enable_if< fold_or< is_mat_trans_expr, VariadicExpr... >::value >::type result
Definition: trans_expr.hpp:28