matrix_traits.h

Go to the documentation of this file.
00001 /* -*- C++ -*- ------------------------------------------------------------
00002  
00003 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
00004 
00005 The Configurable Math Library (CML) is distributed under the terms of the
00006 Boost Software License, v1.0 (see cml/LICENSE for details).
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 } // namespace et
00044 } // namespace cml
00045 
00046 #endif
00047 
00048 // -------------------------------------------------------------------------
00049 // vim:ft=cpp

Generated on Sat Jul 18 19:35:26 2009 for CML 1.0 by  doxygen 1.5.9