15 #ifndef PAAL_UBLAS_TRAITS_HPP
16 #define PAAL_UBLAS_TRAITS_HPP
20 #include <boost/numeric/bindings/traits/traits.hpp>
21 #include <boost/numeric/bindings/traits/ublas_matrix.hpp>
22 #include <boost/numeric/ublas/banded.hpp>
23 #include <boost/numeric/ublas/matrix_proxy.hpp>
24 #include <boost/numeric/ublas/traits.hpp>
25 #include <boost/numeric/ublas/vector.hpp>
28 namespace data_structures {
30 template <
typename RowType,
31 typename Enable =
void>
34 template <
typename RowType>
36 typename std::enable_if<
37 std::is_same<typename paal::decay_t<RowType>::container_type::storage_category,
38 boost::numeric::ublas::sparse_tag>::value>::type> :
39 public std::true_type {};
42 template <
typename Matrix>
48 using coordinate_t = T;
49 using matrix_row_t = boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<T>>;
50 using vector_t = boost::numeric::ublas::vector<T>;
51 using matrix_column_major_t = boost::numeric::ublas::matrix<T, boost::numeric::ublas::column_major>;
52 using matrix_diagonal_t = boost::numeric::ublas::banded_matrix<T>;
54 static std::size_t
num_rows (boost::numeric::ublas::matrix<T> &m) {
return m.size1(); }
56 static std::size_t
num_columns (boost::numeric::ublas::matrix<T> &m) {
return m.size2(); }
62 #endif // PAAL_UBLAS_TRAITS_HPP
static std::size_t num_columns(boost::numeric::ublas::matrix< T > &m)
Return the number of columns of the matrix.
Traits class for matrix related types.
static std::size_t num_rows(boost::numeric::ublas::matrix< T > &m)
Return the number of rows of the matrix.