matrix_traits.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00013 #ifndef matrix_traits_h
00014 #define matrix_traits_h
00015
00016 #include <cml/et/traits.h>
00017
00018 namespace cml {
00019 namespace et {
00020
00021 template<typename E, class AT, typename BO, typename L>
00022 struct ExprTraits< cml::matrix<E,AT,BO,L> >
00023 {
00024 typedef typename cml::matrix<E,AT,BO,L> expr_type;
00025 typedef typename expr_type::value_type value_type;
00026 typedef typename expr_type::expr_reference reference;
00027 typedef typename expr_type::expr_const_reference const_reference;
00028 typedef typename expr_type::result_tag result_tag;
00029 typedef typename expr_type::size_tag size_tag;
00030 typedef typename expr_type::assignable_tag assignable_tag;
00031 typedef expr_type result_type;
00032 typedef expr_leaf_tag node_tag;
00033
00034 value_type get(const expr_type& m, size_t i, size_t j) const {
00035 return m(i,j);
00036 }
00037
00038 matrix_size size(const expr_type& e) const { return e.size(); }
00039 size_t rows(const expr_type& m) const { return m.rows(); }
00040 size_t cols(const expr_type& m) const { return m.cols(); }
00041 };
00042
00043 }
00044 }
00045
00046 #endif
00047
00048
00049