]> Dogcows Code - chaz/yoink/blob - src/moof/cml/matrix/matrix_traits.h
7574ff64d4a6ca763271101e70b26c0f40ad8005
[chaz/yoink] / src / moof / cml / matrix / matrix_traits.h
1 /* -*- C++ -*- ------------------------------------------------------------
2
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
4
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
7
8 *-----------------------------------------------------------------------*/
9 /** @file
10 * @brief
11 */
12
13 #ifndef matrix_traits_h
14 #define matrix_traits_h
15
16 #include <cml/et/traits.h>
17
18 namespace cml {
19 namespace et {
20
21 template<typename E, class AT, typename BO, typename L>
22 struct ExprTraits< cml::matrix<E,AT,BO,L> >
23 {
24 typedef typename cml::matrix<E,AT,BO,L> expr_type;
25 typedef typename expr_type::value_type value_type;
26 typedef typename expr_type::expr_reference reference;
27 typedef typename expr_type::expr_const_reference const_reference;
28 typedef typename expr_type::result_tag result_tag;
29 typedef typename expr_type::size_tag size_tag;
30 typedef typename expr_type::assignable_tag assignable_tag;
31 typedef expr_type result_type;
32 typedef expr_leaf_tag node_tag;
33
34 value_type get(const expr_type& m, size_t i, size_t j) const {
35 return m(i,j);
36 }
37
38 matrix_size size(const expr_type& e) const { return e.size(); }
39 size_t rows(const expr_type& m) const { return m.rows(); }
40 size_t cols(const expr_type& m) const { return m.cols(); }
41 };
42
43 } // namespace et
44 } // namespace cml
45
46 #endif
47
48 // -------------------------------------------------------------------------
49 // vim:ft=cpp
This page took 0.031749 seconds and 3 git commands to generate.