X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2Fcml%2Fmatrix%2Fmatrix_traits.h;fp=src%2FMoof%2Fcml%2Fmatrix%2Fmatrix_traits.h;h=7574ff64d4a6ca763271101e70b26c0f40ad8005;hp=0000000000000000000000000000000000000000;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/Moof/cml/matrix/matrix_traits.h b/src/Moof/cml/matrix/matrix_traits.h new file mode 100644 index 0000000..7574ff6 --- /dev/null +++ b/src/Moof/cml/matrix/matrix_traits.h @@ -0,0 +1,49 @@ +/* -*- C++ -*- ------------------------------------------------------------ + +Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/ + +The Configurable Math Library (CML) is distributed under the terms of the +Boost Software License, v1.0 (see cml/LICENSE for details). + + *-----------------------------------------------------------------------*/ +/** @file + * @brief + */ + +#ifndef matrix_traits_h +#define matrix_traits_h + +#include + +namespace cml { +namespace et { + +template +struct ExprTraits< cml::matrix > +{ + typedef typename cml::matrix expr_type; + typedef typename expr_type::value_type value_type; + typedef typename expr_type::expr_reference reference; + typedef typename expr_type::expr_const_reference const_reference; + typedef typename expr_type::result_tag result_tag; + typedef typename expr_type::size_tag size_tag; + typedef typename expr_type::assignable_tag assignable_tag; + typedef expr_type result_type; + typedef expr_leaf_tag node_tag; + + value_type get(const expr_type& m, size_t i, size_t j) const { + return m(i,j); + } + + matrix_size size(const expr_type& e) const { return e.size(); } + size_t rows(const expr_type& m) const { return m.rows(); } + size_t cols(const expr_type& m) const { return m.cols(); } +}; + +} // namespace et +} // namespace cml + +#endif + +// ------------------------------------------------------------------------- +// vim:ft=cpp