//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_QVM_209A50EE407836FD124932F69E7D49DC #define BOOST_QVM_209A50EE407836FD124932F69E7D49DC //This file was generated by a program. Do not edit manually. #include #include #include #include #include #include #include #include #include namespace boost { namespace qvm { template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, deduce_vec2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; vec_traits::template write_element<0>(r)=vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b); vec_traits::template write_element<1>(r)=vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b); vec_traits::template write_element<2>(r)=vec_traits::template read_element<2>(a)+vec_traits::template read_element<2>(b); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_vv_defined; template <> struct plus_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, deduce_vec2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; vec_traits::template write_element<0>(r)=vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b); vec_traits::template write_element<1>(r)=vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b); vec_traits::template write_element<2>(r)=vec_traits::template read_element<2>(a)-vec_traits::template read_element<2>(b); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_vv_defined; template <> struct minus_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type operator+=( A & a, B const & b ) { vec_traits::template write_element<0>(a)+=vec_traits::template read_element<0>(b); vec_traits::template write_element<1>(a)+=vec_traits::template read_element<1>(b); vec_traits::template write_element<2>(a)+=vec_traits::template read_element<2>(b); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_vv_defined; template <> struct plus_eq_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type operator-=( A & a, B const & b ) { vec_traits::template write_element<0>(a)-=vec_traits::template read_element<0>(b); vec_traits::template write_element<1>(a)-=vec_traits::template read_element<1>(b); vec_traits::template write_element<2>(a)-=vec_traits::template read_element<2>(b); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_vv_defined; template <> struct minus_eq_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && is_scalar::value, deduce_vec >::type operator*( A const & a, B b ) { typedef typename deduce_vec::type R; R r; vec_traits::template write_element<0>(r)=vec_traits::template read_element<0>(a)*b; vec_traits::template write_element<1>(r)=vec_traits::template read_element<1>(a)*b; vec_traits::template write_element<2>(r)=vec_traits::template read_element<2>(a)*b; return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vs_defined; template <> struct mul_vs_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && is_scalar::value, A &>::type operator*=( A & a, B b ) { vec_traits::template write_element<0>(a)*=b; vec_traits::template write_element<1>(a)*=b; vec_traits::template write_element<2>(a)*=b; return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_vs_defined; template <> struct mul_eq_vs_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && is_scalar::value, deduce_vec >::type operator/( A const & a, B b ) { typedef typename deduce_vec::type R; R r; vec_traits::template write_element<0>(r)=vec_traits::template read_element<0>(a)/b; vec_traits::template write_element<1>(r)=vec_traits::template read_element<1>(a)/b; vec_traits::template write_element<2>(r)=vec_traits::template read_element<2>(a)/b; return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_vs_defined; template <> struct div_vs_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && is_scalar::value, A &>::type operator/=( A & a, B b ) { vec_traits::template write_element<0>(a)/=b; vec_traits::template write_element<1>(a)/=b; vec_traits::template write_element<2>(a)/=b; return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_vs_defined; template <> struct div_eq_vs_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type assign( A & a, B const & b ) { vec_traits::template write_element<0>(a)=vec_traits::template read_element<0>(b); vec_traits::template write_element<1>(a)=vec_traits::template read_element<1>(b); vec_traits::template write_element<2>(a)=vec_traits::template read_element<2>(b); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_vv_defined; template <> struct assign_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==3 && vec_traits::dim==3, R>::type convert_to( A const & a ) { R r; vec_traits::template write_element<0>(r)=vec_traits::template read_element<0>(a); vec_traits::template write_element<1>(r)=vec_traits::template read_element<1>(a); vec_traits::template write_element<2>(r)=vec_traits::template read_element<2>(a); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_v_defined; template <> struct convert_to_v_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, bool>::type operator==( A const & a, B const & b ) { return vec_traits::template read_element<0>(a)==vec_traits::template read_element<0>(b) && vec_traits::template read_element<1>(a)==vec_traits::template read_element<1>(b) && vec_traits::template read_element<2>(a)==vec_traits::template read_element<2>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_vv_defined; template <> struct eq_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, bool>::type operator!=( A const & a, B const & b ) { return !(vec_traits::template read_element<0>(a)==vec_traits::template read_element<0>(b)) || !(vec_traits::template read_element<1>(a)==vec_traits::template read_element<1>(b)) || !(vec_traits::template read_element<2>(a)==vec_traits::template read_element<2>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_vv_defined; template <> struct neq_vv_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3, deduce_vec >::type operator-( A const & a ) { typedef typename deduce_vec::type R; R r; vec_traits::template write_element<0>(r)=-vec_traits::template read_element<0>(a); vec_traits::template write_element<1>(r)=-vec_traits::template read_element<1>(a); vec_traits::template write_element<2>(r)=-vec_traits::template read_element<2>(a); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_v_defined; template <> struct minus_v_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==3, typename vec_traits::scalar_type>::type mag( A const & a ) { typedef typename vec_traits::scalar_type T; T const a0=vec_traits::template read_element<0>(a); T const a1=vec_traits::template read_element<1>(a); T const a2=vec_traits::template read_element<2>(a); T const m2=a0*a0+a1*a1+a2*a2; T const mag=sqrt(m2); return mag; } namespace sfinae { using ::boost::qvm::mag; } namespace qvm_detail { template struct mag_v_defined; template <> struct mag_v_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==3, typename vec_traits::scalar_type>::type mag_sqr( A const & a ) { typedef typename vec_traits::scalar_type T; T const a0=vec_traits::template read_element<0>(a); T const a1=vec_traits::template read_element<1>(a); T const a2=vec_traits::template read_element<2>(a); T const m2=a0*a0+a1*a1+a2*a2; return m2; } namespace sfinae { using ::boost::qvm::mag_sqr; } namespace qvm_detail { template struct mag_sqr_v_defined; template <> struct mag_sqr_v_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3, deduce_vec >::type normalized( A const & a ) { typedef typename vec_traits::scalar_type T; T const a0=vec_traits::template read_element<0>(a); T const a1=vec_traits::template read_element<1>(a); T const a2=vec_traits::template read_element<2>(a); T const m2=a0*a0+a1*a1+a2*a2; if( m2==scalar_traits::scalar_type>::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const rm=scalar_traits::value(1)/sqrt(m2); typedef typename deduce_vec::type R; R r; vec_traits::template write_element<0>(r)=a0*rm; vec_traits::template write_element<1>(r)=a1*rm; vec_traits::template write_element<2>(r)=a2*rm; return r; } namespace sfinae { using ::boost::qvm::normalized; } template BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3, void>::type normalize( A & a ) { typedef typename vec_traits::scalar_type T; T const a0=vec_traits::template read_element<0>(a); T const a1=vec_traits::template read_element<1>(a); T const a2=vec_traits::template read_element<2>(a); T const m2=a0*a0+a1*a1+a2*a2; if( m2==scalar_traits::scalar_type>::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const rm=scalar_traits::value(1)/sqrt(m2); vec_traits::template write_element<0>(a)*=rm; vec_traits::template write_element<1>(a)*=rm; vec_traits::template write_element<2>(a)*=rm; } namespace sfinae { using ::boost::qvm::normalize; } namespace qvm_detail { template struct normalize_v_defined; template <> struct normalize_v_defined<3> { static bool const value=true; }; } template BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, deduce_scalar::scalar_type,typename vec_traits::scalar_type> >::type dot( A const & a, B const & b ) { typedef typename vec_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; typedef typename deduce_scalar::type Tr; Ta const a0=vec_traits::template read_element<0>(a); Ta const a1=vec_traits::template read_element<1>(a); Ta const a2=vec_traits::template read_element<2>(a); Tb const b0=vec_traits::template read_element<0>(b); Tb const b1=vec_traits::template read_element<1>(b); Tb const b2=vec_traits::template read_element<2>(b); Tr const dot=a0*b0+a1*b1+a2*b2; return dot; } namespace sfinae { using ::boost::qvm::dot; } namespace qvm_detail { template struct dot_vv_defined; template <> struct dot_vv_defined<3> { static bool const value=true; }; } } } #endif