X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fcml%2Fquaternion%2Fquaternion_traits.h;fp=src%2Fcml%2Fquaternion%2Fquaternion_traits.h;h=fbf23cf2f3758e8c638e5287cbf08cd15146df75;hp=0000000000000000000000000000000000000000;hb=0fffd0097d7b496454413e57b398c903ecc252e4;hpb=79becf045222f385da5a1b9eb79081f6f5266c86 diff --git a/src/cml/quaternion/quaternion_traits.h b/src/cml/quaternion/quaternion_traits.h new file mode 100644 index 0000000..fbf23cf --- /dev/null +++ b/src/cml/quaternion/quaternion_traits.h @@ -0,0 +1,45 @@ +/* -*- 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 quaternion_traits_h +#define quaternion_traits_h + +#include + +namespace cml { +namespace et { + +/** Expression traits for a quaternion<> type. */ +template +struct ExprTraits< cml::quaternion > +{ + typedef typename cml::quaternion::expr_type 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& v, size_t i) const { return v[i]; } + size_t size(const expr_type& v) const { return 4; } +}; + +} // namespace et +} // namespace cml + +#endif + +// ------------------------------------------------------------------------- +// vim:ft=cpp