mgcpp
A C++ Math Library Based on CUDA
blaze.hpp
Go to the documentation of this file.
1 
2 // Copyright RedPortal, mujjingun 2017 - 2018.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef _MGCPP_ADAPTERS_BLAZE_HPP_
8 #define _MGCPP_ADAPTERS_BLAZE_HPP_
9 
10 #include <cstdlib>
12 
13 namespace blaze {
14 template <typename Type, bool SO>
16 
17 template <typename Type, bool TF>
19 } // namespace blaze
20 
21 namespace mgcpp {
22 template <typename Type, bool SO>
23 struct adapter<blaze::DynamicMatrix<Type, SO>> : std::true_type {
25  Type** out_p,
26  size_t* m,
27  size_t* n) {
28  *out_p = mat.data();
29  if (SO) {
30  *m = mat.rows();
31  } else {
32  *n = mat.rows();
33  }
34  }
35 };
36 
37 template <typename Type, bool TF>
38 struct adapter<blaze::DynamicVector<Type, TF>> : std::true_type {
40  Type** out_p,
41  size_t* size) {
42  *out_p = mat.data();
43  *size = mat.size();
44  }
45 };
46 } // namespace mgcpp
47 
48 #endif
Definition: adapter_base.hpp:14
Definition: adapter_base.hpp:12
Definition: blaze.hpp:18
Definition: blaze.hpp:15
void operator()(blaze::DynamicMatrix< Type, TF > const &mat, Type **out_p, size_t *size)
Definition: blaze.hpp:39
Definition: blaze.hpp:13
void operator()(blaze::DynamicMatrix< Type, SO > const &mat, Type **out_p, size_t *m, size_t *n)
Definition: blaze.hpp:24