quaternion_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 quaternion_traits_h
00014 #define quaternion_traits_h
00015 
00016 #include <cml/et/traits.h>
00017 
00018 namespace cml {
00019 namespace et {
00020 
00022 template<typename E, class AT, class OT, class CT>
00023 struct ExprTraits< cml::quaternion<E,AT,OT,CT> >
00024 {
00025     typedef typename cml::quaternion<E,AT,OT,CT>::expr_type expr_type;
00026     typedef typename expr_type::value_type value_type;
00027     typedef typename expr_type::expr_reference reference;
00028     typedef typename expr_type::expr_const_reference const_reference;
00029     typedef typename expr_type::result_tag result_tag;
00030     typedef typename expr_type::size_tag size_tag;
00031     typedef typename expr_type::assignable_tag assignable_tag;
00032     typedef expr_type result_type;
00033     typedef expr_leaf_tag node_tag;
00034 
00035     value_type get(const expr_type& v, size_t i) const { return v[i]; }
00036     size_t size(const expr_type& v) const { return 4; }
00037 };
00038 
00039 } // namespace et
00040 } // namespace cml
00041 
00042 #endif
00043 
00044 // -------------------------------------------------------------------------
00045 // vim:ft=cpp

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