// QVM single header distribution. Do not edit. // Generated on 02/27/2024 from https://github.com/boostorg/qvm/tree/68f960d. // Latest versions: // https://raw.githubusercontent.com/boostorg/qvm/gh-pages/qvm.hpp // https://raw.githubusercontent.com/boostorg/qvm/gh-pages/qvm_lite.hpp #ifndef BOOST_QVM_LITE_HPP_INCLUDED #define BOOST_QVM_LITE_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/lite.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/error.hpp" #ifndef BOOST_QVM_ERROR_HPP_INCLUDED #define BOOST_QVM_ERROR_HPP_INCLUDED // Copyright 2008-2022 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) #include namespace boost { namespace qvm { struct error: std::exception { char const * what() const throw() { return "Boost QVM error"; } ~error() throw() { } }; struct zero_determinant_error: error { }; struct zero_magnitude_error: error { }; } } #endif // <<< #include #line 7 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/to_string.hpp" #ifndef BOOST_QVM_TO_STRING_HPP_INCLUDED #define BOOST_QVM_TO_STRING_HPP_INCLUDED // Copyright 2008-2022 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) #include #if __cplusplus >= 201103L namespace boost { namespace qvm { namespace qvm_to_string_detail { using std::to_string; } } } #else #include namespace boost { namespace qvm { namespace qvm_to_string_detail { template std::string to_string( T const & x ) { std::stringstream s; s << x; return s.str(); } } } } #endif #endif // <<< #include #line 8 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/mat_operations.hpp" #ifndef BOOST_QVM_MAT_OPERATIONS_HPP_INCLUDED #define BOOST_QVM_MAT_OPERATIONS_HPP_INCLUDED // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2019 agate-pris // 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) // >>> #include #line 1 "boost/qvm/detail/mat_assign.hpp" #ifndef BOOST_QVM_DETAIL_MAT_ASSIGN_HPP_INCLUDED #define BOOST_QVM_DETAIL_MAT_ASSIGN_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/mat_assign2.hpp" #ifndef BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_ASSIGN2_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // >>> #include #line 1 "boost/qvm/config.hpp" // Copyright 2008-2022 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_CONFIG_HPP_INCLUDED #define BOOST_QVM_CONFIG_HPP_INCLUDED #if defined( BOOST_STRICT_CONFIG ) || defined( BOOST_QVM_NO_WORKAROUNDS ) # define BOOST_QVM_WORKAROUND( symbol, test ) 0 #else # define BOOST_QVM_WORKAROUND( symbol, test ) ((symbol) != 0 && ((symbol) test)) #endif #define BOOST_QVM_CLANG 0 #if defined(__clang__) # undef BOOST_QVM_CLANG # define BOOST_QVM_CLANG (__clang_major__ * 100 + __clang_minor__) #endif #if BOOST_QVM_WORKAROUND( BOOST_QVM_CLANG, < 304 ) # define BOOST_QVM_DEPRECATED(msg) #elif defined(__GNUC__) || defined(__clang__) # define BOOST_QVM_DEPRECATED(msg) __attribute__((deprecated(msg))) #elif defined(_MSC_VER) && _MSC_VER >= 1900 # define BOOST_QVM_DEPRECATED(msg) [[deprecated(msg)]] #else # define BOOST_QVM_DEPRECATED(msg) #endif #ifndef BOOST_QVM_FORCEINLINE # if defined(_MSC_VER) # define BOOST_QVM_FORCEINLINE __forceinline # elif defined(__GNUC__) && __GNUC__>3 # define BOOST_QVM_FORCEINLINE inline __attribute__ ((always_inline)) # else # define BOOST_QVM_FORCEINLINE inline # endif #endif #ifndef BOOST_QVM_INLINE # define BOOST_QVM_INLINE inline #endif #ifndef BOOST_QVM_INLINE_TRIVIAL # define BOOST_QVM_INLINE_TRIVIAL BOOST_QVM_FORCEINLINE #endif #ifndef BOOST_QVM_INLINE_CRITICAL # define BOOST_QVM_INLINE_CRITICAL BOOST_QVM_FORCEINLINE #endif #ifndef BOOST_QVM_INLINE_OPERATIONS # define BOOST_QVM_INLINE_OPERATIONS BOOST_QVM_INLINE #endif #ifndef BOOST_QVM_INLINE_RECURSION # define BOOST_QVM_INLINE_RECURSION BOOST_QVM_INLINE_OPERATIONS #endif #ifndef BOOST_QVM_CONSTEXPR # if __cplusplus >= 201703L # define BOOST_QVM_CONSTEXPR constexpr # else # define BOOST_QVM_CONSTEXPR # endif #endif #endif // <<< #include #line 12 "boost/qvm/gen/mat_assign2.hpp" // >>> #include #line 1 "boost/qvm/enable_if.hpp" #ifndef BOOST_QVM_ENABLE_IF_HPP_INCLUDED #define BOOST_QVM_ENABLE_IF_HPP_INCLUDED // Copyright 2008-2022 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) // Boost enable_if library // Copyright 2003 (c) The Trustees of Indiana University. // Authors: Jaakko Jarvi (jajarvi at osl.iu.edu) // Jeremiah Willcock (jewillco at osl.iu.edu) // Andrew Lumsdaine (lums at osl.iu.edu) namespace boost { namespace qvm { template struct enable_if_has_type { typedef R type; }; template struct enable_if_c { typedef T type; }; template struct enable_if_c {}; template struct enable_if : public enable_if_c {}; template struct lazy_enable_if_c { typedef typename T::type type; }; template struct lazy_enable_if_c {}; template struct lazy_enable_if : public lazy_enable_if_c {}; template struct disable_if_c { typedef T type; }; template struct disable_if_c {}; template struct disable_if : public disable_if_c {}; template struct lazy_disable_if_c { typedef typename T::type type; }; template struct lazy_disable_if_c {}; template struct lazy_disable_if : public lazy_disable_if_c {}; //////////////////////////////////////////////// // The types below are a copy of the original types above, to workaround MSVC-12 bugs. template struct enable_if_has_type2 { typedef R type; }; template struct enable_if_c2 { typedef T type; }; template struct enable_if_c2 {}; template struct enable_if2 : public enable_if_c2 {}; template struct lazy_enable_if_c2 { typedef typename T::type type; }; template struct lazy_enable_if_c2 {}; template struct lazy_enable_if2 : public lazy_enable_if_c2 {}; template struct disable_if_c2 { typedef T type; }; template struct disable_if_c2 {}; template struct disable_if2 : public disable_if_c2 {}; template struct lazy_disable_if_c2 { typedef typename T::type type; }; template struct lazy_disable_if_c2 {}; template struct lazy_disable_if2 : public lazy_disable_if_c2 {}; } } #endif // <<< #include #line 13 "boost/qvm/gen/mat_assign2.hpp" // >>> #include #line 1 "boost/qvm/mat_traits.hpp" #ifndef BOOST_QVM_TRAITS_HPP_INCLUDED #define BOOST_QVM_TRAITS_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/is_scalar.hpp" #ifndef BOOST_QVM_IS_SCALAR_HPP_INCLUDED #define BOOST_QVM_IS_SCALAR_HPP_INCLUDED // Copyright 2008-2022 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) namespace boost { namespace qvm { template struct is_scalar { static bool const value=false; }; template struct is_scalar: is_scalar { }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; template <> struct is_scalar { static bool const value=true; }; } } #endif // <<< #include #line 10 "boost/qvm/mat_traits.hpp" // Expanded at line 218: #include // Expanded at line 145: #include namespace boost { namespace qvm { template struct mat_traits { static int const rows=0; static int const cols=0; typedef void scalar_type; }; template struct is_mat { static bool const value = is_scalar::scalar_type>::value && mat_traits::rows>0 && mat_traits::cols>0; }; namespace qvm_detail { template struct mtr_dispatch_yes { char x, y; }; } template class mat_write_element_ref { template static qvm_detail::mtr_dispatch_yes::scalar_type & (*)( U & ), &mat_traits::template write_element<0,0> > check(int); template static char check(long); public: static bool const value = sizeof(check(0)) > 1; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< mat_write_element_ref::value, void>::type write_mat_element( M & m, typename mat_traits::scalar_type s ) { mat_traits::template write_element(m) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !mat_write_element_ref::value, void>::type write_mat_element( M & m, typename mat_traits::scalar_type s ) { mat_traits::template write_element(m, s); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< mat_write_element_ref::value, void>::type write_mat_element_idx( int r, int c, M & m, typename mat_traits::scalar_type s ) { mat_traits::write_element_idx(r, c, m) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !mat_write_element_ref::value, void>::type write_mat_element_idx( int r, int c, M & m, typename mat_traits::scalar_type s ) { mat_traits::write_element_idx(r, c, m, s); } } } #endif // <<< #include #line 14 "boost/qvm/gen/mat_assign2.hpp" namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<1,2> { static bool const value=true; }; } } } #endif // <<< #include #line 10 "boost/qvm/detail/mat_assign.hpp" // >>> #include #line 1 "boost/qvm/gen/mat_assign3.hpp" #ifndef BOOST_QVM_GEN_MAT_ASSIGN3_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_ASSIGN3_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 349: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<1,3> { static bool const value=true; }; } } } #endif // <<< #include #line 11 "boost/qvm/detail/mat_assign.hpp" // >>> #include #line 1 "boost/qvm/gen/mat_assign4.hpp" #ifndef BOOST_QVM_GEN_MAT_ASSIGN4_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_ASSIGN4_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 349: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(a,mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(a,mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(a,mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(a,mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(a,mat_traits::template read_element<3,3>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type assign( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_mm_defined; template <> struct assign_mm_defined<1,4> { static bool const value=true; }; } } } #endif // <<< #include #line 12 "boost/qvm/detail/mat_assign.hpp" namespace boost { namespace qvm { namespace qvm_detail { template struct assign_mm_defined { static bool const value=false; }; template struct copy_matrix_elements { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< mat_write_element_ref::value, void>::type f( A & a, B const & b ) { mat_traits::template write_element::cols,I%mat_traits::cols>(a) = mat_traits::template read_element::cols,I%mat_traits::cols>(b); copy_matrix_elements::f(a,b); } template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !mat_write_element_ref::value, void>::type f( A & a, B const & b ) { mat_traits::template write_element::cols,I%mat_traits::cols>(a, mat_traits::template read_element::cols,I%mat_traits::cols>(b)); copy_matrix_elements::f(a,b); } }; template struct copy_matrix_elements { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void f( A &, B const & ) { } }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::assign_mm_defined::rows,mat_traits::cols>::value, A &>::type assign( A & a, B const & b ) { qvm_detail::copy_matrix_elements<0,mat_traits::rows*mat_traits::cols>::f(a,b); return a; } } } #endif // <<< #include #line 11 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/mat_operations2.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/mat_operations2.hpp" #ifndef BOOST_QVM_GEN_MAT_OPERATIONS2_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_OPERATIONS2_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // >>> #include #line 1 "boost/qvm/assert.hpp" // Copyright 2008-2022 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_ASSERT # ifdef BOOST_ASSERT # define BOOST_QVM_ASSERT BOOST_ASSERT # else # include # define BOOST_QVM_ASSERT assert # endif #endif // <<< #include #line 12 "boost/qvm/gen/mat_operations2.hpp" // >>> #include #line 1 "boost/qvm/deduce_mat.hpp" #ifndef BOOST_QVM_DEDUCE_MAT_HPP_INCLUDED #define BOOST_QVM_DEDUCE_MAT_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/deduce_scalar.hpp" #ifndef BOOST_QVM_DEDUCE_SCALAR_HPP_INCLUDED #define BOOST_QVM_DEDUCE_SCALAR_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/scalar_traits.hpp" #ifndef BOOST_QVM_SCALAR_TRAITS_HPP_INCLUDED #define BOOST_QVM_SCALAR_TRAITS_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/quat_traits.hpp" #ifndef BOOST_QVM_QUAT_TRAITS #define BOOST_QVM_QUAT_TRAITS // Copyright 2008-2022 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) // Expanded at line 359: #include // Expanded at line 218: #include // Expanded at line 145: #include namespace boost { namespace qvm { template struct quat_traits { typedef void scalar_type; }; template struct is_quat { static bool const value = is_scalar::scalar_type>::value; }; namespace qvm_detail { template struct qtr_dispatch_yes { char x, y; }; } template class quat_write_element_ref { template static qvm_detail::qtr_dispatch_yes::scalar_type & (*)( U & ), &quat_traits::template write_element<0> > check(int); template static char check(long); public: static bool const value = sizeof(check(0)) > 1; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< quat_write_element_ref::value, void>::type write_quat_element( Q & q, typename quat_traits::scalar_type s ) { quat_traits::template write_element(q) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !quat_write_element_ref::value, void>::type write_quat_element( Q & q, typename quat_traits::scalar_type s ) { quat_traits::template write_element(q, s); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< quat_write_element_ref::value, void>::type write_quat_element_idx( int i, Q & q, typename quat_traits::scalar_type s ) { quat_traits::template write_element_idx(i, q) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !quat_write_element_ref::value, void>::type write_vec_element_idx( int i, Q & q, typename quat_traits::scalar_type s ) { quat_traits::template write_element_idx(i, q, s); } } } #endif // <<< #include #line 10 "boost/qvm/scalar_traits.hpp" // >>> #include #line 1 "boost/qvm/vec_traits.hpp" // Copyright 2008-2022 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_VEC_TRAITS_HPP_INCLUDED #define BOOST_QVM_VEC_TRAITS_HPP_INCLUDED // Expanded at line 359: #include // Expanded at line 218: #include // Expanded at line 145: #include namespace boost { namespace qvm { template struct vec_traits { static int const dim=0; typedef void scalar_type; }; template struct is_vec { static bool const value = is_scalar::scalar_type>::value && vec_traits::dim>0; }; namespace qvm_detail { template struct vtr_dispatch_yes { char x, y; }; } template class vec_write_element_ref { template static qvm_detail::vtr_dispatch_yes::scalar_type & (*)( U & ), &vec_traits::template write_element<0> > check(int); template static char check(long); public: static bool const value = sizeof(check(0)) > 1; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< vec_write_element_ref::value, void>::type write_vec_element( V & v, typename vec_traits::scalar_type s ) { vec_traits::template write_element(v) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !vec_write_element_ref::value, void>::type write_vec_element( V & v, typename vec_traits::scalar_type s ) { vec_traits::template write_element(v, s); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< vec_write_element_ref::value, void>::type write_vec_element_idx( int i, V & v, typename vec_traits::scalar_type s ) { vec_traits::write_element_idx(i, v) = s; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !vec_write_element_ref::value, void>::type write_vec_element_idx( int i, V & v, typename vec_traits::scalar_type s ) { vec_traits::write_element_idx(i, v, s); } } } #endif // <<< #include #line 11 "boost/qvm/scalar_traits.hpp" // Expanded at line 349: #include // Expanded at line 145: #include namespace boost { namespace qvm { template struct scalar_traits { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL Scalar value( int v ) { return Scalar(v); } }; namespace qvm_detail { template ::value, bool IsV=is_vec::value, bool IsM=is_mat::value, bool IsS=is_scalar::value> struct scalar_impl { typedef void type; }; template struct scalar_impl { typedef A type; }; template struct scalar_impl { typedef typename mat_traits::scalar_type type; }; template struct scalar_impl { typedef typename vec_traits::scalar_type type; }; template struct scalar_impl { typedef typename quat_traits::scalar_type type; }; } template struct scalar { typedef typename qvm_detail::scalar_impl::type type; }; } } #endif // <<< #include #line 10 "boost/qvm/deduce_scalar.hpp" // >>> #include #line 1 "boost/qvm/static_assert.hpp" // Copyright 2008-2022 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_STATIC_ASSERT # if __cplusplus >= 201103L # include # define BOOST_QVM_STATIC_ASSERT(condition) static_assert(condition, "Boost QVM static assertion failure") # else # ifdef __GNUC__ # define BOOST_QVM_ATTRIBUTE_UNUSED __attribute__((unused)) # else # define BOOST_QVM_ATTRIBUTE_UNUSED # endif # define BOOST_QVM_TOKEN_PASTE(x, y) x ## y # define BOOST_QVM_TOKEN_PASTE2(x, y) BOOST_QVM_TOKEN_PASTE(x, y) # define BOOST_QVM_STATIC_ASSERT(condition) typedef char BOOST_QVM_TOKEN_PASTE2(boost_qvm_static_assert_failure_,__LINE__)[(condition)?1:-1] BOOST_QVM_ATTRIBUTE_UNUSED # endif #endif // <<< #include #line 11 "boost/qvm/deduce_scalar.hpp" // >>> #include #line 1 "boost/qvm/detail/remove_const.hpp" #ifndef BOOST_QVM_DETAIL_REMOVE_CONST_HPP_INCLUDED #define BOOST_QVM_DETAIL_REMOVE_CONST_HPP_INCLUDED // Copyright 2008-2022 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) namespace boost { namespace qvm { namespace qvm_detail { template struct remove_const { typedef T type; }; template struct remove_const { typedef T type; }; } } } #endif // <<< #include #line 12 "boost/qvm/deduce_scalar.hpp" namespace boost { namespace qvm { namespace deduce_scalar_detail { template struct deduce_scalar_impl { typedef void type; }; template struct deduce_scalar_impl { typedef T type; }; template <> struct deduce_scalar_impl { typedef unsigned char type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed short type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed short type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned char type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed short type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed short type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned short type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed int type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned int type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef signed long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef unsigned long type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef float type; }; template <> struct deduce_scalar_impl { typedef double type; }; template <> struct deduce_scalar_impl { typedef double type; }; } template struct deduce_scalar { typedef typename deduce_scalar_detail::deduce_scalar_impl::type,typename qvm_detail::remove_const::type>::type type; }; } } #endif // <<< #include #line 10 "boost/qvm/deduce_mat.hpp" // Expanded at line 349: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct mat; namespace qvm_detail { template ::rows, int MC=mat_traits::cols, class MS=typename mat_traits::scalar_type> struct deduce_m_default { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef mat::scalar_type,R,C> type; }; template struct deduce_m_default { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef M type; }; } template ::rows,int C=mat_traits::cols,class S=typename mat_traits::scalar_type> struct deduce_mat { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef typename qvm_detail::deduce_m_default::type type; }; namespace qvm_detail { template ::value, bool IsScalarB=is_scalar::value> struct deduce_m2_default { typedef mat type; }; template struct deduce_m2_default { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef M type; }; template struct deduce_m2_default { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef typename deduce_mat::type type; }; template struct deduce_m2_default { BOOST_QVM_STATIC_ASSERT(is_mat::value); typedef typename deduce_mat::type type; }; } template ::type,typename scalar::type>::type> struct deduce_mat2 { BOOST_QVM_STATIC_ASSERT(is_mat::value || is_mat::value); typedef typename qvm_detail::deduce_m2_default::type type; }; } } #endif // <<< #include #line 13 "boost/qvm/gen/mat_operations2.hpp" // >>> #include #line 1 "boost/qvm/deduce_vec.hpp" #ifndef BOOST_QVM_DEDUCE_VEC_HPP_INCLUDED #define BOOST_QVM_DEDUCE_VEC_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 996: #include // Expanded at line 1117: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct vec; namespace qvm_detail { template ::dim, class VS=typename vec_traits::scalar_type> struct deduce_v_default { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef vec::scalar_type,D> type; }; template struct deduce_v_default { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef V type; }; } template ::dim,class S=typename vec_traits::scalar_type> struct deduce_vec { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef typename qvm_detail::deduce_v_default::type type; }; namespace qvm_detail { template ::value, bool IsScalarB=is_scalar::value> struct deduce_v2_default { typedef vec type; }; template struct deduce_v2_default { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef V type; }; template struct deduce_v2_default { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef typename deduce_vec::type type; }; template struct deduce_v2_default { BOOST_QVM_STATIC_ASSERT(is_vec::value); typedef typename deduce_vec::type type; }; } template ::type,typename scalar::type>::type> struct deduce_vec2 { BOOST_QVM_STATIC_ASSERT(is_vec::value || is_vec::value); typedef typename qvm_detail::deduce_v2_default::type type; }; } } #endif // <<< #include #line 14 "boost/qvm/gen/mat_operations2.hpp" // Expanded at line 25: #include // Expanded at line 133: #include // >>> #include #line 1 "boost/qvm/throw_exception.hpp" // Copyright 2008-2022 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_THROW_EXCEPTION # define BOOST_QVM_THROW_EXCEPTION ::boost::qvm::throw_exception # include # ifndef BOOST_QVM_NO_EXCEPTIONS # if defined(__clang__) && !defined(__ibmxl__) // Clang C++ emulates GCC, so it has to appear early. # if !__has_feature(cxx_exceptions) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__DMC__) // Digital Mars C++ # if !defined(_CPPUNWIND) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__GNUC__) && !defined(__ibmxl__) // GNU C++: # if !defined(__EXCEPTIONS) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__KCC) // Kai C++ # if !defined(_EXCEPTIONS) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__CODEGEARC__) // CodeGear - must be checked for before Borland # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__BORLANDC__) // Borland # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__MWERKS__) // Metrowerks CodeWarrior # if !__option(exceptions) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__) // IBM z/OS XL C/C++ # if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(__ibmxl__) // IBM XL C/C++ for Linux (Little Endian) # if !__has_feature(cxx_exceptions) # define BOOST_QVM_NO_EXCEPTIONS # endif # elif defined(_MSC_VER) // Microsoft Visual C++ // Must remain the last #elif since some other vendors (Metrowerks, for // example) also #define _MSC_VER # if !defined(_CPPUNWIND) # define BOOST_QVM_NO_EXCEPTIONS # endif # endif # endif //////////////////////////////////////// # ifdef BOOST_NORETURN # define BOOST_QVM_NORETURN BOOST_NORETURN # else # if defined(_MSC_VER) # define BOOST_QVM_NORETURN __declspec(noreturn) # elif defined(__GNUC__) # define BOOST_QVM_NORETURN __attribute__ ((__noreturn__)) # elif defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130) # if __has_attribute(noreturn) # define BOOST_QVM_NORETURN [[noreturn]] # endif # elif defined(__has_cpp_attribute) # if __has_cpp_attribute(noreturn) # define BOOST_QVM_NORETURN [[noreturn]] # endif # endif # endif # if !defined(BOOST_QVM_NORETURN) # define BOOST_QVM_NORETURN # endif //////////////////////////////////////// # ifdef BOOST_QVM_NO_EXCEPTIONS namespace boost { BOOST_QVM_NORETURN void throw_exception( std::exception const & ); // user defined } namespace boost { namespace qvm { template BOOST_QVM_NORETURN void throw_exception( T const & e ) { ::boost::throw_exception(e); } } } # else namespace boost { namespace qvm { template BOOST_QVM_NORETURN void throw_exception( T const & e ) { throw e; } } } # endif #endif // <<< #include #line 17 "boost/qvm/gen/mat_operations2.hpp" namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==2 && mat_traits::cols==2, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a*mat_traits::template read_element<1,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==2 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==2 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==1 && mat_traits::cols==2, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::cols==1 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==2 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==2 && mat_traits::cols==2, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a/mat_traits::template read_element<0,1>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a/mat_traits::template read_element<1,1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==2 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==2 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::cols==1 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==2 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b) && mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)) || !(mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==2 && mat_traits::cols==2, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,-mat_traits::template read_element<1,1>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==1, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==2, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<1,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::cols==2, typename mat_traits::scalar_type>::type determinant( A const & a ) { typedef typename mat_traits::scalar_type T; T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T det=(a00*a11-a01*a10); return det; } namespace sfinae { using ::boost::qvm::determinant; } namespace qvm_detail { template struct determinant_defined; template <> struct determinant_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type inverse( A const & a, B det ) { typedef typename mat_traits::scalar_type T; BOOST_QVM_ASSERT(det!=scalar_traits::value(0)); T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T const f=scalar_traits::value(1)/det; typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r, f*a11); write_mat_element<0,1>(r,-f*a01); write_mat_element<1,0>(r,-f*a10); write_mat_element<1,1>(r, f*a00); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2, deduce_mat >::type inverse( A const & a ) { typedef typename mat_traits::scalar_type T; T det=determinant(a); if( det==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_determinant_error()); return inverse(a,det); } namespace sfinae { using ::boost::qvm::inverse; } namespace qvm_detail { template struct inverse_m_defined; template <> struct inverse_m_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,a00*b00+a01*b10); write_mat_element<0,1>(r,a00*b01+a01*b11); write_mat_element<1,0>(r,a10*b00+a11*b10); write_mat_element<1,1>(r,a10*b01+a11*b11); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<2,2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, A &>::type operator*=( A & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); write_mat_element<0,0>(a,a00*b00+a01*b10); write_mat_element<0,1>(a,a00*b01+a01*b11); write_mat_element<1,0>(a,a10*b00+a11*b10); write_mat_element<1,1>(a,a10*b01+a11*b11); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_mm_defined; template <> struct mul_eq_mm_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==1, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==2); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,a00*b00+a01*b10); write_mat_element<1,0>(r,a10*b00+a11*b10); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<2,2,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==2 && mat_traits::cols==2 && mat_traits::cols==2, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==2); R r; write_mat_element<0,0>(r,a00*b00+a01*b10); write_mat_element<0,1>(r,a00*b01+a01*b11); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<1,2,2> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/mat_operations2.hpp" // <<< #include #line 12 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/mat_operations3.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/mat_operations3.hpp" #ifndef BOOST_QVM_GEN_MAT_OPERATIONS3_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_OPERATIONS3_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 969: #include // Expanded at line 986: #include // Expanded at line 1572: #include // Expanded at line 25: #include // Expanded at line 602: #include // Expanded at line 1016: #include // Expanded at line 1006: #include // Expanded at line 1673: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)+mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)+mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)+mat_traits::template read_element<2,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)-mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)-mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)-mat_traits::template read_element<2,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)+mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)+mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)+mat_traits::template read_element<2,2>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)-mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)-mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)-mat_traits::template read_element<2,2>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)*b); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)*b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)*b); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)*b); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==3 && mat_traits::cols==3, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a*mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a*mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,a*mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(r,a*mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,a*mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,a*mat_traits::template read_element<2,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==3 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,a*mat_traits::template read_element<2,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==3 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==1 && mat_traits::cols==3, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a*mat_traits::template read_element<0,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)*b); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)*b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)*b); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)*b); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::cols==1 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==3 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)/b); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)/b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)/b); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)/b); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==3 && mat_traits::cols==3, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a/mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a/mat_traits::template read_element<0,2>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a/mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,a/mat_traits::template read_element<1,2>(b)); write_mat_element<2,0>(r,a/mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,a/mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,a/mat_traits::template read_element<2,2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==3 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,a/mat_traits::template read_element<2,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==3 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)/b); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)/b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)/b); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)/b); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::cols==1 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==3 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE typename enable_if_c< is_mat::value && is_quat::value && mat_traits::rows==3 && mat_traits::cols==3, R>::type convert_to( A const & q ) { typedef typename mat_traits::scalar_type T; T const a=quat_traits::template read_element<0>(q); T const b=quat_traits::template read_element<1>(q); T const c=quat_traits::template read_element<2>(q); T const d=quat_traits::template read_element<3>(q); T const bb = b*b; T const cc = c*c; T const dd = d*d; T const bc = b*c; T const bd = b*d; T const cd = c*d; T const ab = a*b; T const ac = a*c; T const ad = a*d; T const one = scalar_traits::value(1); T const two = one+one; R r; write_mat_element<0,0>(r,one - two*(cc+dd)); write_mat_element<0,1>(r,two*(bc-ad)); write_mat_element<0,2>(r,two*(bd+ac)); write_mat_element<1,0>(r,two*(bc+ad)); write_mat_element<1,1>(r,one - two*(bb+dd)); write_mat_element<1,2>(r,two*(cd-ab)); write_mat_element<2,0>(r,two*(bd-ac)); write_mat_element<2,1>(r,two*(cd+ab)); write_mat_element<2,2>(r,one - two*(bb+cc)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b) && mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b) && mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b) && mat_traits::template read_element<1,2>(a)==mat_traits::template read_element<1,2>(b) && mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b) && mat_traits::template read_element<2,1>(a)==mat_traits::template read_element<2,1>(b) && mat_traits::template read_element<2,2>(a)==mat_traits::template read_element<2,2>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b) && mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b) && mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)) || !(mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)) || !(mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b)) || !(mat_traits::template read_element<1,2>(a)==mat_traits::template read_element<1,2>(b)) || !(mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b)) || !(mat_traits::template read_element<2,1>(a)==mat_traits::template read_element<2,1>(b)) || !(mat_traits::template read_element<2,2>(a)==mat_traits::template read_element<2,2>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)) || !(mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==3 && mat_traits::cols==3, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)) || !(mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,-mat_traits::template read_element<0,2>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,-mat_traits::template read_element<1,1>(a)); write_mat_element<1,2>(r,-mat_traits::template read_element<1,2>(a)); write_mat_element<2,0>(r,-mat_traits::template read_element<2,0>(a)); write_mat_element<2,1>(r,-mat_traits::template read_element<2,1>(a)); write_mat_element<2,2>(r,-mat_traits::template read_element<2,2>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==1, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); write_mat_element<2,0>(r,-mat_traits::template read_element<2,0>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==3, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,-mat_traits::template read_element<0,2>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<1,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::cols==3, typename mat_traits::scalar_type>::type determinant( A const & a ) { typedef typename mat_traits::scalar_type T; T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a02=mat_traits::template read_element<0,2>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T const a12=mat_traits::template read_element<1,2>(a); T const a20=mat_traits::template read_element<2,0>(a); T const a21=mat_traits::template read_element<2,1>(a); T const a22=mat_traits::template read_element<2,2>(a); T det=(a00*(a11*a22-a12*a21)-a01*(a10*a22-a12*a20)+a02*(a10*a21-a11*a20)); return det; } namespace sfinae { using ::boost::qvm::determinant; } namespace qvm_detail { template struct determinant_defined; template <> struct determinant_defined<3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type inverse( A const & a, B det ) { typedef typename mat_traits::scalar_type T; BOOST_QVM_ASSERT(det!=scalar_traits::value(0)); T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a02=mat_traits::template read_element<0,2>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T const a12=mat_traits::template read_element<1,2>(a); T const a20=mat_traits::template read_element<2,0>(a); T const a21=mat_traits::template read_element<2,1>(a); T const a22=mat_traits::template read_element<2,2>(a); T const f=scalar_traits::value(1)/det; typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r, f*(a11*a22-a12*a21)); write_mat_element<0,1>(r,-f*(a01*a22-a02*a21)); write_mat_element<0,2>(r, f*(a01*a12-a02*a11)); write_mat_element<1,0>(r,-f*(a10*a22-a12*a20)); write_mat_element<1,1>(r, f*(a00*a22-a02*a20)); write_mat_element<1,2>(r,-f*(a00*a12-a02*a10)); write_mat_element<2,0>(r, f*(a10*a21-a11*a20)); write_mat_element<2,1>(r,-f*(a00*a21-a01*a20)); write_mat_element<2,2>(r, f*(a00*a11-a01*a10)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3, deduce_mat >::type inverse( A const & a ) { typedef typename mat_traits::scalar_type T; T det=determinant(a); if( det==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_determinant_error()); return inverse(a,det); } namespace sfinae { using ::boost::qvm::inverse; } namespace qvm_detail { template struct inverse_m_defined; template <> struct inverse_m_defined<3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20); write_mat_element<0,1>(r,a00*b01+a01*b11+a02*b21); write_mat_element<0,2>(r,a00*b02+a01*b12+a02*b22); write_mat_element<1,0>(r,a10*b00+a11*b10+a12*b20); write_mat_element<1,1>(r,a10*b01+a11*b11+a12*b21); write_mat_element<1,2>(r,a10*b02+a11*b12+a12*b22); write_mat_element<2,0>(r,a20*b00+a21*b10+a22*b20); write_mat_element<2,1>(r,a20*b01+a21*b11+a22*b21); write_mat_element<2,2>(r,a20*b02+a21*b12+a22*b22); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<3,3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, A &>::type operator*=( A & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); write_mat_element<0,0>(a,a00*b00+a01*b10+a02*b20); write_mat_element<0,1>(a,a00*b01+a01*b11+a02*b21); write_mat_element<0,2>(a,a00*b02+a01*b12+a02*b22); write_mat_element<1,0>(a,a10*b00+a11*b10+a12*b20); write_mat_element<1,1>(a,a10*b01+a11*b11+a12*b21); write_mat_element<1,2>(a,a10*b02+a11*b12+a12*b22); write_mat_element<2,0>(a,a20*b00+a21*b10+a22*b20); write_mat_element<2,1>(a,a20*b01+a21*b11+a22*b21); write_mat_element<2,2>(a,a20*b02+a21*b12+a22*b22); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_mm_defined; template <> struct mul_eq_mm_defined<3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==1, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==3); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20); write_mat_element<1,0>(r,a10*b00+a11*b10+a12*b20); write_mat_element<2,0>(r,a20*b00+a21*b10+a22*b20); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<3,3,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==3 && mat_traits::cols==3 && mat_traits::cols==3, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==3); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20); write_mat_element<0,1>(r,a00*b01+a01*b11+a02*b21); write_mat_element<0,2>(r,a00*b02+a01*b12+a02*b22); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<1,3,3> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/mat_operations3.hpp" // <<< #include #line 13 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/mat_operations4.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/mat_operations4.hpp" #ifndef BOOST_QVM_GEN_MAT_OPERATIONS4_HPP_INCLUDED #define BOOST_QVM_GEN_MAT_OPERATIONS4_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 969: #include // Expanded at line 986: #include // Expanded at line 1572: #include // Expanded at line 25: #include // Expanded at line 733: #include // Expanded at line 1016: #include // Expanded at line 1006: #include // Expanded at line 1673: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)+mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)+mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(r,mat_traits::template read_element<1,3>(a)+mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)+mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)+mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(r,mat_traits::template read_element<2,3>(a)+mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)+mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(r,mat_traits::template read_element<3,1>(a)+mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(r,mat_traits::template read_element<3,2>(a)+mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(r,mat_traits::template read_element<3,3>(a)+mat_traits::template read_element<3,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)+mat_traits::template read_element<3,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)+mat_traits::template read_element<0,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_mm_defined; template <> struct plus_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)-mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)-mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(r,mat_traits::template read_element<1,3>(a)-mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)-mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)-mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(r,mat_traits::template read_element<2,3>(a)-mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)-mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(r,mat_traits::template read_element<3,1>(a)-mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(r,mat_traits::template read_element<3,2>(a)-mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(r,mat_traits::template read_element<3,3>(a)-mat_traits::template read_element<3,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)-mat_traits::template read_element<3,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)-mat_traits::template read_element<0,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_mm_defined; template <> struct minus_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)+mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)+mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)+mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(a,mat_traits::template read_element<1,3>(a)+mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)+mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)+mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(a,mat_traits::template read_element<2,3>(a)+mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)+mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(a,mat_traits::template read_element<3,1>(a)+mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(a,mat_traits::template read_element<3,2>(a)+mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(a,mat_traits::template read_element<3,3>(a)+mat_traits::template read_element<3,3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)+mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)+mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)+mat_traits::template read_element<3,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type operator+=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)+mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)+mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)+mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)+mat_traits::template read_element<0,3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_mm_defined; template <> struct plus_eq_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)-mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)-mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)-mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(a,mat_traits::template read_element<1,3>(a)-mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)-mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)-mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(a,mat_traits::template read_element<2,3>(a)-mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)-mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(a,mat_traits::template read_element<3,1>(a)-mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(a,mat_traits::template read_element<3,2>(a)-mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(a,mat_traits::template read_element<3,3>(a)-mat_traits::template read_element<3,3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)-mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)-mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)-mat_traits::template read_element<3,0>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type operator-=( A & a, B const & b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)-mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)-mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)-mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)-mat_traits::template read_element<0,3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_mm_defined; template <> struct minus_eq_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)*b); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)*b); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)*b); write_mat_element<1,3>(r,mat_traits::template read_element<1,3>(a)*b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)*b); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)*b); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)*b); write_mat_element<2,3>(r,mat_traits::template read_element<2,3>(a)*b); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)*b); write_mat_element<3,1>(r,mat_traits::template read_element<3,1>(a)*b); write_mat_element<3,2>(r,mat_traits::template read_element<3,2>(a)*b); write_mat_element<3,3>(r,mat_traits::template read_element<3,3>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==4 && mat_traits::cols==4, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a*mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,a*mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a*mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,a*mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(r,a*mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(r,a*mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,a*mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,a*mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(r,a*mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(r,a*mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(r,a*mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(r,a*mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(r,a*mat_traits::template read_element<3,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)*b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)*b); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==4 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a*mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,a*mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(r,a*mat_traits::template read_element<3,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==4 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)*b); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_ms_defined; template <> struct mul_ms_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==1 && mat_traits::cols==4, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a*mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a*mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a*mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,a*mat_traits::template read_element<0,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sm_defined; template <> struct mul_sm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)*b); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)*b); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)*b); write_mat_element<1,3>(a,mat_traits::template read_element<1,3>(a)*b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)*b); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)*b); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)*b); write_mat_element<2,3>(a,mat_traits::template read_element<2,3>(a)*b); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)*b); write_mat_element<3,1>(a,mat_traits::template read_element<3,1>(a)*b); write_mat_element<3,2>(a,mat_traits::template read_element<3,2>(a)*b); write_mat_element<3,3>(a,mat_traits::template read_element<3,3>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::cols==1 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)*b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)*b); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==4 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)*b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)*b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)*b); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)*b); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_ms_defined; template <> struct mul_eq_ms_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)/b); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)/b); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)/b); write_mat_element<1,3>(r,mat_traits::template read_element<1,3>(a)/b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)/b); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)/b); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)/b); write_mat_element<2,3>(r,mat_traits::template read_element<2,3>(a)/b); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)/b); write_mat_element<3,1>(r,mat_traits::template read_element<3,1>(a)/b); write_mat_element<3,2>(r,mat_traits::template read_element<3,2>(a)/b); write_mat_element<3,3>(r,mat_traits::template read_element<3,3>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==4 && mat_traits::cols==4, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<0,1>(r,a/mat_traits::template read_element<0,1>(b)); write_mat_element<0,2>(r,a/mat_traits::template read_element<0,2>(b)); write_mat_element<0,3>(r,a/mat_traits::template read_element<0,3>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); write_mat_element<1,1>(r,a/mat_traits::template read_element<1,1>(b)); write_mat_element<1,2>(r,a/mat_traits::template read_element<1,2>(b)); write_mat_element<1,3>(r,a/mat_traits::template read_element<1,3>(b)); write_mat_element<2,0>(r,a/mat_traits::template read_element<2,0>(b)); write_mat_element<2,1>(r,a/mat_traits::template read_element<2,1>(b)); write_mat_element<2,2>(r,a/mat_traits::template read_element<2,2>(b)); write_mat_element<2,3>(r,a/mat_traits::template read_element<2,3>(b)); write_mat_element<3,0>(r,a/mat_traits::template read_element<3,0>(b)); write_mat_element<3,1>(r,a/mat_traits::template read_element<3,1>(b)); write_mat_element<3,2>(r,a/mat_traits::template read_element<3,2>(b)); write_mat_element<3,3>(r,a/mat_traits::template read_element<3,3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==1 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)/b); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)/b); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && mat_traits::rows==4 && mat_traits::cols==1, deduce_mat2::rows,mat_traits::cols> >::type operator/( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,a/mat_traits::template read_element<0,0>(b)); write_mat_element<1,0>(r,a/mat_traits::template read_element<1,0>(b)); write_mat_element<2,0>(r,a/mat_traits::template read_element<2,0>(b)); write_mat_element<3,0>(r,a/mat_traits::template read_element<3,0>(b)); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_sm_defined; template <> struct div_sm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==4 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)/b); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_ms_defined; template <> struct div_ms_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)/b); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); write_mat_element<1,1>(a,mat_traits::template read_element<1,1>(a)/b); write_mat_element<1,2>(a,mat_traits::template read_element<1,2>(a)/b); write_mat_element<1,3>(a,mat_traits::template read_element<1,3>(a)/b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)/b); write_mat_element<2,1>(a,mat_traits::template read_element<2,1>(a)/b); write_mat_element<2,2>(a,mat_traits::template read_element<2,2>(a)/b); write_mat_element<2,3>(a,mat_traits::template read_element<2,3>(a)/b); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)/b); write_mat_element<3,1>(a,mat_traits::template read_element<3,1>(a)/b); write_mat_element<3,2>(a,mat_traits::template read_element<3,2>(a)/b); write_mat_element<3,3>(a,mat_traits::template read_element<3,3>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::cols==1 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<1,0>(a,mat_traits::template read_element<1,0>(a)/b); write_mat_element<2,0>(a,mat_traits::template read_element<2,0>(a)/b); write_mat_element<3,0>(a,mat_traits::template read_element<3,0>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::cols==4 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_mat_element<0,0>(a,mat_traits::template read_element<0,0>(a)/b); write_mat_element<0,1>(a,mat_traits::template read_element<0,1>(a)/b); write_mat_element<0,2>(a,mat_traits::template read_element<0,2>(a)/b); write_mat_element<0,3>(a,mat_traits::template read_element<0,3>(a)/b); return a; } namespace sfinae { using ::boost::qvm::operator/=; } namespace qvm_detail { template struct div_eq_ms_defined; template <> struct div_eq_ms_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,mat_traits::template read_element<1,1>(a)); write_mat_element<1,2>(r,mat_traits::template read_element<1,2>(a)); write_mat_element<1,3>(r,mat_traits::template read_element<1,3>(a)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)); write_mat_element<2,1>(r,mat_traits::template read_element<2,1>(a)); write_mat_element<2,2>(r,mat_traits::template read_element<2,2>(a)); write_mat_element<2,3>(r,mat_traits::template read_element<2,3>(a)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)); write_mat_element<3,1>(r,mat_traits::template read_element<3,1>(a)); write_mat_element<3,2>(r,mat_traits::template read_element<3,2>(a)); write_mat_element<3,3>(r,mat_traits::template read_element<3,3>(a)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE typename enable_if_c< is_mat::value && is_quat::value && mat_traits::rows==4 && mat_traits::cols==4, R>::type convert_to( A const & q ) { typedef typename mat_traits::scalar_type T; T const a=quat_traits::template read_element<0>(q); T const b=quat_traits::template read_element<1>(q); T const c=quat_traits::template read_element<2>(q); T const d=quat_traits::template read_element<3>(q); T const bb = b*b; T const cc = c*c; T const dd = d*d; T const bc = b*c; T const bd = b*d; T const cd = c*d; T const ab = a*b; T const ac = a*c; T const ad = a*d; T const zero = scalar_traits::value(0); T const one = scalar_traits::value(1); T const two = one+one; R r; write_mat_element<0,0>(r,one - two*(cc+dd)); write_mat_element<0,1>(r,two*(bc-ad)); write_mat_element<0,2>(r,two*(bd+ac)); write_mat_element<0,3>(r,zero); write_mat_element<1,0>(r,two*(bc+ad)); write_mat_element<1,1>(r,one - two*(bb+dd)); write_mat_element<1,2>(r,two*(cd-ab)); write_mat_element<1,3>(r,zero); write_mat_element<2,0>(r,two*(bd-ac)); write_mat_element<2,1>(r,two*(cd+ab)); write_mat_element<2,2>(r,one - two*(bb+cc)); write_mat_element<2,3>(r,zero); write_mat_element<3,0>(r,zero); write_mat_element<3,1>(r,zero); write_mat_element<3,2>(r,zero); write_mat_element<3,3>(r,one); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,mat_traits::template read_element<1,0>(a)); write_mat_element<2,0>(r,mat_traits::template read_element<2,0>(a)); write_mat_element<3,0>(r,mat_traits::template read_element<3,0>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, R>::type convert_to( A const & a ) { R r; write_mat_element<0,0>(r,mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,mat_traits::template read_element<0,2>(a)); write_mat_element<0,3>(r,mat_traits::template read_element<0,3>(a)); return r; } namespace sfinae { using ::boost::qvm::convert_to; } namespace qvm_detail { template struct convert_to_m_defined; template <> struct convert_to_m_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b) && mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b) && mat_traits::template read_element<0,3>(a)==mat_traits::template read_element<0,3>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b) && mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b) && mat_traits::template read_element<1,2>(a)==mat_traits::template read_element<1,2>(b) && mat_traits::template read_element<1,3>(a)==mat_traits::template read_element<1,3>(b) && mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b) && mat_traits::template read_element<2,1>(a)==mat_traits::template read_element<2,1>(b) && mat_traits::template read_element<2,2>(a)==mat_traits::template read_element<2,2>(b) && mat_traits::template read_element<2,3>(a)==mat_traits::template read_element<2,3>(b) && mat_traits::template read_element<3,0>(a)==mat_traits::template read_element<3,0>(b) && mat_traits::template read_element<3,1>(a)==mat_traits::template read_element<3,1>(b) && mat_traits::template read_element<3,2>(a)==mat_traits::template read_element<3,2>(b) && mat_traits::template read_element<3,3>(a)==mat_traits::template read_element<3,3>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b) && mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b) && mat_traits::template read_element<3,0>(a)==mat_traits::template read_element<3,0>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, bool>::type operator==( A const & a, B const & b ) { return mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b) && mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b) && mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b) && mat_traits::template read_element<0,3>(a)==mat_traits::template read_element<0,3>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_mm_defined; template <> struct eq_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)) || !(mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b)) || !(mat_traits::template read_element<0,3>(a)==mat_traits::template read_element<0,3>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)) || !(mat_traits::template read_element<1,1>(a)==mat_traits::template read_element<1,1>(b)) || !(mat_traits::template read_element<1,2>(a)==mat_traits::template read_element<1,2>(b)) || !(mat_traits::template read_element<1,3>(a)==mat_traits::template read_element<1,3>(b)) || !(mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b)) || !(mat_traits::template read_element<2,1>(a)==mat_traits::template read_element<2,1>(b)) || !(mat_traits::template read_element<2,2>(a)==mat_traits::template read_element<2,2>(b)) || !(mat_traits::template read_element<2,3>(a)==mat_traits::template read_element<2,3>(b)) || !(mat_traits::template read_element<3,0>(a)==mat_traits::template read_element<3,0>(b)) || !(mat_traits::template read_element<3,1>(a)==mat_traits::template read_element<3,1>(b)) || !(mat_traits::template read_element<3,2>(a)==mat_traits::template read_element<3,2>(b)) || !(mat_traits::template read_element<3,3>(a)==mat_traits::template read_element<3,3>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==1 && mat_traits::cols==1, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<1,0>(a)==mat_traits::template read_element<1,0>(b)) || !(mat_traits::template read_element<2,0>(a)==mat_traits::template read_element<2,0>(b)) || !(mat_traits::template read_element<3,0>(a)==mat_traits::template read_element<3,0>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==1 && mat_traits::rows==1 && mat_traits::cols==4 && mat_traits::cols==4, bool>::type operator!=( A const & a, B const & b ) { return !(mat_traits::template read_element<0,0>(a)==mat_traits::template read_element<0,0>(b)) || !(mat_traits::template read_element<0,1>(a)==mat_traits::template read_element<0,1>(b)) || !(mat_traits::template read_element<0,2>(a)==mat_traits::template read_element<0,2>(b)) || !(mat_traits::template read_element<0,3>(a)==mat_traits::template read_element<0,3>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_mm_defined; template <> struct neq_mm_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,-mat_traits::template read_element<0,2>(a)); write_mat_element<0,3>(r,-mat_traits::template read_element<0,3>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); write_mat_element<1,1>(r,-mat_traits::template read_element<1,1>(a)); write_mat_element<1,2>(r,-mat_traits::template read_element<1,2>(a)); write_mat_element<1,3>(r,-mat_traits::template read_element<1,3>(a)); write_mat_element<2,0>(r,-mat_traits::template read_element<2,0>(a)); write_mat_element<2,1>(r,-mat_traits::template read_element<2,1>(a)); write_mat_element<2,2>(r,-mat_traits::template read_element<2,2>(a)); write_mat_element<2,3>(r,-mat_traits::template read_element<2,3>(a)); write_mat_element<3,0>(r,-mat_traits::template read_element<3,0>(a)); write_mat_element<3,1>(r,-mat_traits::template read_element<3,1>(a)); write_mat_element<3,2>(r,-mat_traits::template read_element<3,2>(a)); write_mat_element<3,3>(r,-mat_traits::template read_element<3,3>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==1, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<1,0>(r,-mat_traits::template read_element<1,0>(a)); write_mat_element<2,0>(r,-mat_traits::template read_element<2,0>(a)); write_mat_element<3,0>(r,-mat_traits::template read_element<3,0>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::cols==4, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; write_mat_element<0,0>(r,-mat_traits::template read_element<0,0>(a)); write_mat_element<0,1>(r,-mat_traits::template read_element<0,1>(a)); write_mat_element<0,2>(r,-mat_traits::template read_element<0,2>(a)); write_mat_element<0,3>(r,-mat_traits::template read_element<0,3>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_m_defined; template <> struct minus_m_defined<1,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::cols==4, typename mat_traits::scalar_type>::type determinant( A const & a ) { typedef typename mat_traits::scalar_type T; T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a02=mat_traits::template read_element<0,2>(a); T const a03=mat_traits::template read_element<0,3>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T const a12=mat_traits::template read_element<1,2>(a); T const a13=mat_traits::template read_element<1,3>(a); T const a20=mat_traits::template read_element<2,0>(a); T const a21=mat_traits::template read_element<2,1>(a); T const a22=mat_traits::template read_element<2,2>(a); T const a23=mat_traits::template read_element<2,3>(a); T const a30=mat_traits::template read_element<3,0>(a); T const a31=mat_traits::template read_element<3,1>(a); T const a32=mat_traits::template read_element<3,2>(a); T const a33=mat_traits::template read_element<3,3>(a); T det=(a00*(a11*(a22*a33-a23*a32)-a12*(a21*a33-a23*a31)+a13*(a21*a32-a22*a31))-a01*(a10*(a22*a33-a23*a32)-a12*(a20*a33-a23*a30)+a13*(a20*a32-a22*a30))+a02*(a10*(a21*a33-a23*a31)-a11*(a20*a33-a23*a30)+a13*(a20*a31-a21*a30))-a03*(a10*(a21*a32-a22*a31)-a11*(a20*a32-a22*a30)+a12*(a20*a31-a21*a30))); return det; } namespace sfinae { using ::boost::qvm::determinant; } namespace qvm_detail { template struct determinant_defined; template <> struct determinant_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && is_scalar::value, deduce_mat2::rows,mat_traits::cols> >::type inverse( A const & a, B det ) { typedef typename mat_traits::scalar_type T; BOOST_QVM_ASSERT(det!=scalar_traits::value(0)); T const a00=mat_traits::template read_element<0,0>(a); T const a01=mat_traits::template read_element<0,1>(a); T const a02=mat_traits::template read_element<0,2>(a); T const a03=mat_traits::template read_element<0,3>(a); T const a10=mat_traits::template read_element<1,0>(a); T const a11=mat_traits::template read_element<1,1>(a); T const a12=mat_traits::template read_element<1,2>(a); T const a13=mat_traits::template read_element<1,3>(a); T const a20=mat_traits::template read_element<2,0>(a); T const a21=mat_traits::template read_element<2,1>(a); T const a22=mat_traits::template read_element<2,2>(a); T const a23=mat_traits::template read_element<2,3>(a); T const a30=mat_traits::template read_element<3,0>(a); T const a31=mat_traits::template read_element<3,1>(a); T const a32=mat_traits::template read_element<3,2>(a); T const a33=mat_traits::template read_element<3,3>(a); T const f=scalar_traits::value(1)/det; typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; write_mat_element<0,0>(r, f*(a11*(a22*a33-a23*a32)-a12*(a21*a33-a23*a31)+a13*(a21*a32-a22*a31))); write_mat_element<0,1>(r,-f*(a01*(a22*a33-a23*a32)-a02*(a21*a33-a23*a31)+a03*(a21*a32-a22*a31))); write_mat_element<0,2>(r, f*(a01*(a12*a33-a13*a32)-a02*(a11*a33-a13*a31)+a03*(a11*a32-a12*a31))); write_mat_element<0,3>(r,-f*(a01*(a12*a23-a13*a22)-a02*(a11*a23-a13*a21)+a03*(a11*a22-a12*a21))); write_mat_element<1,0>(r,-f*(a10*(a22*a33-a23*a32)-a12*(a20*a33-a23*a30)+a13*(a20*a32-a22*a30))); write_mat_element<1,1>(r, f*(a00*(a22*a33-a23*a32)-a02*(a20*a33-a23*a30)+a03*(a20*a32-a22*a30))); write_mat_element<1,2>(r,-f*(a00*(a12*a33-a13*a32)-a02*(a10*a33-a13*a30)+a03*(a10*a32-a12*a30))); write_mat_element<1,3>(r, f*(a00*(a12*a23-a13*a22)-a02*(a10*a23-a13*a20)+a03*(a10*a22-a12*a20))); write_mat_element<2,0>(r, f*(a10*(a21*a33-a23*a31)-a11*(a20*a33-a23*a30)+a13*(a20*a31-a21*a30))); write_mat_element<2,1>(r,-f*(a00*(a21*a33-a23*a31)-a01*(a20*a33-a23*a30)+a03*(a20*a31-a21*a30))); write_mat_element<2,2>(r, f*(a00*(a11*a33-a13*a31)-a01*(a10*a33-a13*a30)+a03*(a10*a31-a11*a30))); write_mat_element<2,3>(r,-f*(a00*(a11*a23-a13*a21)-a01*(a10*a23-a13*a20)+a03*(a10*a21-a11*a20))); write_mat_element<3,0>(r,-f*(a10*(a21*a32-a22*a31)-a11*(a20*a32-a22*a30)+a12*(a20*a31-a21*a30))); write_mat_element<3,1>(r, f*(a00*(a21*a32-a22*a31)-a01*(a20*a32-a22*a30)+a02*(a20*a31-a21*a30))); write_mat_element<3,2>(r,-f*(a00*(a11*a32-a12*a31)-a01*(a10*a32-a12*a30)+a02*(a10*a31-a11*a30))); write_mat_element<3,3>(r, f*(a00*(a11*a22-a12*a21)-a01*(a10*a22-a12*a20)+a02*(a10*a21-a11*a20))); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4, deduce_mat >::type inverse( A const & a ) { typedef typename mat_traits::scalar_type T; T det=determinant(a); if( det==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_determinant_error()); return inverse(a,det); } namespace sfinae { using ::boost::qvm::inverse; } namespace qvm_detail { template struct inverse_m_defined; template <> struct inverse_m_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a13 = mat_traits::template read_element<1,3>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Ta const a23 = mat_traits::template read_element<2,3>(a); Ta const a30 = mat_traits::template read_element<3,0>(a); Ta const a31 = mat_traits::template read_element<3,1>(a); Ta const a32 = mat_traits::template read_element<3,2>(a); Ta const a33 = mat_traits::template read_element<3,3>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b03 = mat_traits::template read_element<0,3>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b13 = mat_traits::template read_element<1,3>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); Tb const b23 = mat_traits::template read_element<2,3>(b); Tb const b30 = mat_traits::template read_element<3,0>(b); Tb const b31 = mat_traits::template read_element<3,1>(b); Tb const b32 = mat_traits::template read_element<3,2>(b); Tb const b33 = mat_traits::template read_element<3,3>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20+a03*b30); write_mat_element<0,1>(r,a00*b01+a01*b11+a02*b21+a03*b31); write_mat_element<0,2>(r,a00*b02+a01*b12+a02*b22+a03*b32); write_mat_element<0,3>(r,a00*b03+a01*b13+a02*b23+a03*b33); write_mat_element<1,0>(r,a10*b00+a11*b10+a12*b20+a13*b30); write_mat_element<1,1>(r,a10*b01+a11*b11+a12*b21+a13*b31); write_mat_element<1,2>(r,a10*b02+a11*b12+a12*b22+a13*b32); write_mat_element<1,3>(r,a10*b03+a11*b13+a12*b23+a13*b33); write_mat_element<2,0>(r,a20*b00+a21*b10+a22*b20+a23*b30); write_mat_element<2,1>(r,a20*b01+a21*b11+a22*b21+a23*b31); write_mat_element<2,2>(r,a20*b02+a21*b12+a22*b22+a23*b32); write_mat_element<2,3>(r,a20*b03+a21*b13+a22*b23+a23*b33); write_mat_element<3,0>(r,a30*b00+a31*b10+a32*b20+a33*b30); write_mat_element<3,1>(r,a30*b01+a31*b11+a32*b21+a33*b31); write_mat_element<3,2>(r,a30*b02+a31*b12+a32*b22+a33*b32); write_mat_element<3,3>(r,a30*b03+a31*b13+a32*b23+a33*b33); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<4,4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, A &>::type operator*=( A & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a13 = mat_traits::template read_element<1,3>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Ta const a23 = mat_traits::template read_element<2,3>(a); Ta const a30 = mat_traits::template read_element<3,0>(a); Ta const a31 = mat_traits::template read_element<3,1>(a); Ta const a32 = mat_traits::template read_element<3,2>(a); Ta const a33 = mat_traits::template read_element<3,3>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b03 = mat_traits::template read_element<0,3>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b13 = mat_traits::template read_element<1,3>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); Tb const b23 = mat_traits::template read_element<2,3>(b); Tb const b30 = mat_traits::template read_element<3,0>(b); Tb const b31 = mat_traits::template read_element<3,1>(b); Tb const b32 = mat_traits::template read_element<3,2>(b); Tb const b33 = mat_traits::template read_element<3,3>(b); write_mat_element<0,0>(a,a00*b00+a01*b10+a02*b20+a03*b30); write_mat_element<0,1>(a,a00*b01+a01*b11+a02*b21+a03*b31); write_mat_element<0,2>(a,a00*b02+a01*b12+a02*b22+a03*b32); write_mat_element<0,3>(a,a00*b03+a01*b13+a02*b23+a03*b33); write_mat_element<1,0>(a,a10*b00+a11*b10+a12*b20+a13*b30); write_mat_element<1,1>(a,a10*b01+a11*b11+a12*b21+a13*b31); write_mat_element<1,2>(a,a10*b02+a11*b12+a12*b22+a13*b32); write_mat_element<1,3>(a,a10*b03+a11*b13+a12*b23+a13*b33); write_mat_element<2,0>(a,a20*b00+a21*b10+a22*b20+a23*b30); write_mat_element<2,1>(a,a20*b01+a21*b11+a22*b21+a23*b31); write_mat_element<2,2>(a,a20*b02+a21*b12+a22*b22+a23*b32); write_mat_element<2,3>(a,a20*b03+a21*b13+a22*b23+a23*b33); write_mat_element<3,0>(a,a30*b00+a31*b10+a32*b20+a33*b30); write_mat_element<3,1>(a,a30*b01+a31*b11+a32*b21+a33*b31); write_mat_element<3,2>(a,a30*b02+a31*b12+a32*b22+a33*b32); write_mat_element<3,3>(a,a30*b03+a31*b13+a32*b23+a33*b33); return a; } namespace sfinae { using ::boost::qvm::operator*=; } namespace qvm_detail { template struct mul_eq_mm_defined; template <> struct mul_eq_mm_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==1, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a13 = mat_traits::template read_element<1,3>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Ta const a23 = mat_traits::template read_element<2,3>(a); Ta const a30 = mat_traits::template read_element<3,0>(a); Ta const a31 = mat_traits::template read_element<3,1>(a); Ta const a32 = mat_traits::template read_element<3,2>(a); Ta const a33 = mat_traits::template read_element<3,3>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b30 = mat_traits::template read_element<3,0>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==4); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==1); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20+a03*b30); write_mat_element<1,0>(r,a10*b00+a11*b10+a12*b20+a13*b30); write_mat_element<2,0>(r,a20*b00+a21*b10+a22*b20+a23*b30); write_mat_element<3,0>(r,a30*b00+a31*b10+a32*b20+a33*b30); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<4,4,1> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==1 && mat_traits::rows==4 && mat_traits::cols==4 && mat_traits::cols==4, deduce_mat2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b03 = mat_traits::template read_element<0,3>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b13 = mat_traits::template read_element<1,3>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); Tb const b23 = mat_traits::template read_element<2,3>(b); Tb const b30 = mat_traits::template read_element<3,0>(b); Tb const b31 = mat_traits::template read_element<3,1>(b); Tb const b32 = mat_traits::template read_element<3,2>(b); Tb const b33 = mat_traits::template read_element<3,3>(b); typedef typename deduce_mat2::type R; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==1); BOOST_QVM_STATIC_ASSERT(mat_traits::cols==4); R r; write_mat_element<0,0>(r,a00*b00+a01*b10+a02*b20+a03*b30); write_mat_element<0,1>(r,a00*b01+a01*b11+a02*b21+a03*b31); write_mat_element<0,2>(r,a00*b02+a01*b12+a02*b22+a03*b32); write_mat_element<0,3>(r,a00*b03+a01*b13+a02*b23+a03*b33); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mm_defined; template <> struct mul_mm_defined<1,4,4> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/mat_operations4.hpp" // <<< #include #line 14 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/math.hpp" #ifndef BOOST_QVM_MATH_HPP_INCLUDED #define BOOST_QVM_MATH_HPP_INCLUDED // Copyright 2008-2022 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) #include // Expanded at line 145: #include namespace boost { namespace qvm { template T acos( T ); template T asin( T ); template T atan( T ); template T atan2( T, T ); template T cos( T ); template T sin( T ); template T tan( T ); template T cosh( T ); template T sinh( T ); template T tanh( T ); template T exp( T ); template T log( T ); template T log10( T ); template T mod( T , T ); template T pow( T, T ); template T sqrt( T ); template T ceil( T ); template T abs( T ); template T floor( T ); template T mod( T, T ); template T ldexp( T, int ); template T sign( T ); template <> BOOST_QVM_INLINE_TRIVIAL float acos( float x ) { return ::acosf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float asin( float x ) { return ::asinf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float atan( float x ) { return ::atanf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float atan2( float x, float y ) { return ::atan2f(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL float cos( float x ) { return ::cosf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float sin( float x ) { return ::sinf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float tan( float x ) { return ::tanf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float cosh( float x ) { return ::coshf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float sinh( float x ) { return ::sinhf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float tanh( float x ) { return ::tanhf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float exp( float x ) { return ::expf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float log( float x ) { return ::logf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float log10( float x ) { return ::log10f(x); } template <> BOOST_QVM_INLINE_TRIVIAL float mod( float x, float y ) { return ::fmodf(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL float pow( float x, float y ) { return ::powf(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL float sqrt( float x ) { return ::sqrtf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float ceil( float x ) { return ::ceilf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float abs( float x ) { return ::fabsf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float floor( float x ) { return ::floorf(x); } template <> BOOST_QVM_INLINE_TRIVIAL float ldexp( float x, int y ) { return ::ldexpf(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL float sign( float x ) { return x<0 ? -1.f : +1.f; } template <> BOOST_QVM_INLINE_TRIVIAL double acos( double x ) { return ::acos(x); } template <> BOOST_QVM_INLINE_TRIVIAL double asin( double x ) { return ::asin(x); } template <> BOOST_QVM_INLINE_TRIVIAL double atan( double x ) { return ::atan(x); } template <> BOOST_QVM_INLINE_TRIVIAL double atan2( double x, double y ) { return ::atan2(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL double cos( double x ) { return ::cos(x); } template <> BOOST_QVM_INLINE_TRIVIAL double sin( double x ) { return ::sin(x); } template <> BOOST_QVM_INLINE_TRIVIAL double tan( double x ) { return ::tan(x); } template <> BOOST_QVM_INLINE_TRIVIAL double cosh( double x ) { return ::cosh(x); } template <> BOOST_QVM_INLINE_TRIVIAL double sinh( double x ) { return ::sinh(x); } template <> BOOST_QVM_INLINE_TRIVIAL double tanh( double x ) { return ::tanh(x); } template <> BOOST_QVM_INLINE_TRIVIAL double exp( double x ) { return ::exp(x); } template <> BOOST_QVM_INLINE_TRIVIAL double log( double x ) { return ::log(x); } template <> BOOST_QVM_INLINE_TRIVIAL double log10( double x ) { return ::log10(x); } template <> BOOST_QVM_INLINE_TRIVIAL double mod( double x, double y ) { return ::fmod(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL double pow( double x, double y ) { return ::pow(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL double sqrt( double x ) { return ::sqrt(x); } template <> BOOST_QVM_INLINE_TRIVIAL double ceil( double x ) { return ::ceil(x); } template <> BOOST_QVM_INLINE_TRIVIAL double abs( double x ) { return ::fabs(x); } template <> BOOST_QVM_INLINE_TRIVIAL double floor( double x ) { return ::floor(x); } template <> BOOST_QVM_INLINE_TRIVIAL double ldexp( double x, int y ) { return ::ldexp(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL double sign( double x ) { return x<0 ? -1.0 : +1.0; } template <> BOOST_QVM_INLINE_TRIVIAL long double acos( long double x ) { return ::acosl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double asin( long double x ) { return ::asinl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double atan( long double x ) { return ::atanl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double atan2( long double x, long double y ) { return ::atan2l(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL long double cos( long double x ) { return ::cosl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double sin( long double x ) { return ::sinl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double tan( long double x ) { return ::tanl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double cosh( long double x ) { return ::coshl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double sinh( long double x ) { return ::sinhl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double tanh( long double x ) { return ::tanhl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double exp( long double x ) { return ::expl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double log( long double x ) { return ::logl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double log10( long double x ) { return ::log10l(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double mod( long double x, long double y ) { return ::fmodl(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL long double pow( long double x, long double y ) { return ::powl(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL long double sqrt( long double x ) { return ::sqrtl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double ceil( long double x ) { return ::ceill(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double abs( long double x ) { return ::fabsl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double floor( long double x ) { return ::floorl(x); } template <> BOOST_QVM_INLINE_TRIVIAL long double ldexp( long double x, int y ) { return ::ldexpl(x,y); } template <> BOOST_QVM_INLINE_TRIVIAL long double sign( long double x ) { return x<0 ? -1.0 : +1.0; } } } #endif // <<< #include #line 15 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/detail/determinant_impl.hpp" #ifndef BOOST_QVM_DETAIL_DETERMINANT_IMPL_HPP_INCLUDED #define BOOST_QVM_DETAIL_DETERMINANT_IMPL_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // >>> #include #line 1 "boost/qvm/mat_traits_array.hpp" #ifndef BOOST_QVM_MAT_TRAITS_ARRAY_HPP_INCLUDED #define BOOST_QVM_MAT_TRAITS_ARRAY_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 986: #include // Expanded at line 969: #include #if __cplusplus > 199711L #include namespace boost { namespace qvm { template struct mat_traits,Q>,C> > { static int const rows=0; static int const cols=0; typedef void scalar_type; }; template struct mat_traits,Cols> > { typedef std::array,Cols> this_matrix; typedef T scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col struct mat_traits,Cols> const> { typedef std::array,Cols> const this_matrix; typedef T scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col struct deduce_mat,Cols>,R,C> { typedef mat type; }; template struct deduce_mat,Cols> const,R,C> { typedef mat type; }; template struct deduce_mat2,Cols>,std::array,Cols>,R,C> { typedef mat::type,R,C> type; }; template struct deduce_mat2,Cols> const,std::array,Cols>,R,C> { typedef mat::type,R,C> type; }; template struct deduce_mat2,Cols>,std::array const,Cols>,R,C> { typedef mat::type,R,C> type; }; template struct deduce_mat2,Cols> const,std::array,Cols> const,R,C> { typedef mat::type,R,C> type; }; } } #endif namespace boost { namespace qvm { template struct mat_traits { static int const rows=0; static int const cols=0; typedef void scalar_type; }; template struct mat_traits { typedef T this_matrix[Rows][Cols]; typedef T scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col struct deduce_mat { typedef mat type; }; template struct deduce_mat { typedef mat type; }; template struct deduce_mat2 { typedef mat::type,R,C> type; }; template T (&ptr_mref( T * ptr ))[Rows][Cols] { return *reinterpret_cast(ptr); } } } #endif // <<< #include #line 11 "boost/qvm/detail/determinant_impl.hpp" // Expanded at line 1292: #include namespace boost { namespace qvm { namespace qvm_detail { template struct det_size { }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename mat_traits::scalar_type determinant_impl_( M const & a, det_size<2> ) { return mat_traits::template read_element<0,0>(a) * mat_traits::template read_element<1,1>(a) - mat_traits::template read_element<1,0>(a) * mat_traits::template read_element<0,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_RECURSION typename mat_traits::scalar_type determinant_impl_( M const & a, det_size ) { typedef typename mat_traits::scalar_type T; T m[N-1][N-1]; T det=T(0); for( int j1=0; j1!=N; ++j1 ) { for( int i=1; i!=N; ++i ) { int j2 = 0; for( int j=0; j!=N; ++j ) { if( j==j1 ) continue; m[i-1][j2] = mat_traits::read_element_idx(i,j,a); ++j2; } } T d=determinant_impl_(m,det_size()); if( j1&1 ) d=-d; det += mat_traits::read_element_idx(0,j1,a) * d; } return det; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename mat_traits::scalar_type determinant_impl( M const & a ) { BOOST_QVM_STATIC_ASSERT(mat_traits::rows==mat_traits::cols); return determinant_impl_(a,det_size::rows>()); } } } } #endif // <<< #include #line 16 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/detail/cofactor_impl.hpp" #ifndef BOOST_QVM_DETAIL_COFACTOR_IMPL_HPP_INCLUDED #define BOOST_QVM_DETAIL_COFACTOR_IMPL_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 7664: #include // Expanded at line 349: #include // Expanded at line 1292: #include namespace boost { namespace qvm { namespace qvm_detail { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename deduce_mat::type cofactor_impl( A const & a ) { BOOST_QVM_STATIC_ASSERT(mat_traits::rows==mat_traits::cols); int const N=mat_traits::rows; typedef typename mat_traits::scalar_type T; T c[N-1][N-1]; typedef typename deduce_mat::type R; R b; for( int j=0; j!=N; ++j ) { for( int i=0; i!=N; ++i ) { int i1=0; for( int ii=0; ii!=N; ++ii ) { if( ii==i ) continue; int j1=0; for( int jj=0; jj!=N; ++jj ) { if( jj==j ) continue; c[i1][j1] = mat_traits::read_element_idx(ii,jj,a); ++j1; } ++i1; } T det = determinant_impl(c); if( (i+j)&1 ) det=-det; write_mat_element_idx(i,j,b,det); } } return b; } } } } #endif // <<< #include #line 17 "boost/qvm/mat_operations.hpp" // >>> #include #line 1 "boost/qvm/detail/transp_impl.hpp" #ifndef BOOST_QVM_DETAIL_TRANSP_IMPL_HPP_INCLUDED #define BOOST_QVM_DETAIL_TRANSP_IMPL_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 986: #include // Expanded at line 1292: #include // Expanded at line 969: #include namespace boost { namespace qvm { namespace qvm_detail { template class transposed_ { transposed_( transposed_ const & ); transposed_ & operator=( transposed_ const & ); ~transposed_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL transposed_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct transposed_write_traits; template struct transposed_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef transposed_ this_matrix; static int const rows=mat_traits::cols; static int const cols=mat_traits::rows; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(col,row,reinterpret_cast(x)); } }; template struct transposed_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef transposed_ this_matrix; static int const rows=mat_traits::cols; static int const cols=mat_traits::rows; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(col,row,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::transposed_ >: qvm_detail::transposed_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef qvm_detail::transposed_ this_matrix; static int const rows=mat_traits::cols; static int const cols=mat_traits::rows; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(col,row,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::transposed_,R,C> { typedef mat::scalar_type,R,C> type; }; } } #endif // <<< #include #line 18 "boost/qvm/mat_operations.hpp" // Expanded at line 1006: #include // Expanded at line 62: #include namespace boost { namespace qvm { namespace qvm_detail { BOOST_QVM_INLINE_CRITICAL void const * get_valid_ptr_mat_operations() { static int const obj=0; return &obj; } } //////////////////////////////////////////////// namespace qvm_detail { template struct to_string_m_defined { static bool const value=false; }; template struct to_string_matrix_elements { template static std::string f( A const & a ) { using namespace qvm_to_string_detail; return ( (I%mat_traits::cols)==0 ? '(' : ',' ) + to_string(mat_traits::template read_element::cols,I%mat_traits::cols>(a)) + ( (I%mat_traits::cols)==mat_traits::cols-1 ? ")" : "" ) + to_string_matrix_elements::f(a); } }; template struct to_string_matrix_elements { template static std::string f( A const & a ) { using namespace qvm_to_string_detail; return ( (SizeMinusOne%mat_traits::cols)==0 ? '(' : ',' ) + to_string(mat_traits::template read_element::cols,SizeMinusOne%mat_traits::cols>(a)) + ')'; } }; } template inline typename enable_if_c< is_mat::value && !qvm_detail::to_string_m_defined::rows,mat_traits::cols>::value, std::string>::type to_string( A const & a ) { return "("+qvm_detail::to_string_matrix_elements<0,mat_traits::rows*mat_traits::cols-1>::f(a)+')'; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols, bool>::type cmp( A const & a, B const & b, Cmp f ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) if( !f( mat_traits::read_element_idx(i, j, a), mat_traits::read_element_idx(i, j, b)) ) return false; return true; } //////////////////////////////////////////////// namespace qvm_detail { template struct convert_to_m_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::convert_to_m_defined::rows,mat_traits::cols>::value, R>::type convert_to( A const & a ) { R r; assign(r,a); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct determinant_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && !qvm_detail::determinant_defined::rows>::value, typename mat_traits::scalar_type>::type determinant( A const & a ) { return qvm_detail::determinant_impl(a); } //////////////////////////////////////////////// namespace qvm_detail { template class identity_mat_ { identity_mat_( identity_mat_ const & ); identity_mat_ & operator=( identity_mat_ const & ); ~identity_mat_(); public: template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::identity_mat_ > { typedef qvm_detail::identity_mat_ this_matrix; typedef T scalar_type; static int const rows=Dim; static int const cols=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & /*x*/ ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::value(Row==Col); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & /*x*/ ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::value(row==col); } }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::identity_mat_ const & identity_mat() { return *(qvm_detail::identity_mat_ const *)qvm_detail::get_valid_ptr_mat_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols, void>::type set_identity( A & a ) { assign(a,identity_mat::scalar_type,mat_traits::rows>()); } //////////////////////////////////////////////// namespace qvm_detail { template struct projection_ { T const _00; T const _11; T const _22; T const _23; T const _32; BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL projection_( T _00, T _11, T _22, T _23, T _32 ): _00(_00), _11(_11), _22(_22), _23(_23), _32(_32) { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct projection_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & ) { return scalar_traits::value(0); } }; template <> struct projection_get<0,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & m ) { return m._00; } }; template <> struct projection_get<1,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & m ) { return m._11; } }; template <> struct projection_get<2,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & m ) { return m._22; } }; template <> struct projection_get<2,3> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & m ) { return m._23; } }; template <> struct projection_get<3,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( projection_ const & m ) { return m._32; } }; } template struct mat_traits< qvm_detail::projection_ > { typedef qvm_detail::projection_ this_matrix; typedef T scalar_type; static int const rows=4; static int const cols=4; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::get(x); } }; template qvm_detail::projection_ BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS perspective_lh( T fov_y, T aspect_ratio, T z_near, T z_far ) { T const one = scalar_traits::value(1); T const ys = one/tan(fov_y/scalar_traits::value(2)); T const xs = ys/aspect_ratio; T const zd = z_far-z_near; T const z1 = z_far/zd; T const z2 = -z_near*z1; return qvm_detail::projection_(xs,ys,z1,z2,one); } template qvm_detail::projection_ BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS perspective_rh( T fov_y, T aspect_ratio, T z_near, T z_far ) { T const one = scalar_traits::value(1); T const ys = one/tan(fov_y/scalar_traits::value(2)); T const xs = ys/aspect_ratio; T const zd = z_near-z_far; T const z1 = z_far/zd; T const z2 = z_near*z1; return qvm_detail::projection_(xs,ys,z1,z2,-one); } //////////////////////////////////////////////// namespace qvm_detail { template class matrix_scalar_cast_ { matrix_scalar_cast_( matrix_scalar_cast_ const & ); matrix_scalar_cast_ & operator=( matrix_scalar_cast_ const & ); ~matrix_scalar_cast_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL matrix_scalar_cast_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct scalar_cast_matrix_filter { }; template <> struct scalar_cast_matrix_filter { typedef int type; }; } template struct mat_traits< qvm_detail::matrix_scalar_cast_ > { typedef Scalar scalar_type; typedef qvm_detail::matrix_scalar_cast_ this_matrix; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x))); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(col,row,reinterpret_cast(x))); } }; template struct deduce_mat,R,C> { typedef mat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::matrix_scalar_cast_ const & scalar_cast( T const & x, typename qvm_detail::scalar_cast_matrix_filter::value>::type=0 ) { return reinterpret_cast const &>(x); } //////////////////////////////////////////////// namespace qvm_detail { template struct div_eq_ms_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_scalar::value && !qvm_detail::div_eq_ms_defined::rows,mat_traits::cols>::value, A &>::type operator/=( A & a, B b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,a,mat_traits::read_element_idx(i,j,a)/b); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct div_ms_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_scalar::value && !qvm_detail::div_ms_defined::rows,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator/( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,mat_traits::read_element_idx(i,j,a)/b); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct eq_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::eq_mm_defined::rows,mat_traits::cols>::value, bool>::type operator==( A const & a, B const & b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) if( mat_traits::read_element_idx(i,j,a)!=mat_traits::read_element_idx(i,j,b) ) return false; return true; } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_eq_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::minus_eq_mm_defined::rows,mat_traits::cols>::value, A &>::type operator-=( A & a, B const & b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,a,mat_traits::read_element_idx(i,j,a)-mat_traits::read_element_idx(i,j,b)); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_m_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && !qvm_detail::minus_m_defined::rows,mat_traits::cols>::value, deduce_mat >::type operator-( A const & a ) { typedef typename deduce_mat::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,-mat_traits::read_element_idx(i,j,a)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::minus_mm_defined::rows,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator-( A const & a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,mat_traits::read_element_idx(i,j,a)-mat_traits::read_element_idx(i,j,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_eq_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::mul_eq_mm_defined::rows>::value, A &>::type operator*=( A & r, B const & b ) { typedef typename mat_traits::scalar_type Ta; Ta a[mat_traits::rows][mat_traits::cols]; for( int i=0; i::rows; ++i ) for( int j=0; j::cols; ++j ) a[i][j]=mat_traits::read_element_idx(i,j,r); for( int i=0; i::rows; ++i ) for( int j=0; j::cols; ++j ) { Ta x(scalar_traits::value(0)); for( int k=0; k::cols; ++k ) x += a[i][k]*mat_traits::read_element_idx(k,j,b); write_mat_element_idx(i,j,r,x); } return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_eq_ms_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_scalar::value && !qvm_detail::mul_eq_ms_defined::rows,mat_traits::cols>::value, A &>::type operator*=( A & a, B b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,a,mat_traits::read_element_idx(i,j,a)*b); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_mat::value && mat_traits::cols==mat_traits::rows && !qvm_detail::mul_mm_defined::rows,mat_traits::cols,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i::rows; ++i ) for( int j=0; j::cols; ++j ) { typedef typename mat_traits::scalar_type Ta; Ta x(scalar_traits::value(0)); for( int k=0; k::cols; ++k ) x += mat_traits::read_element_idx(i,k,a)*mat_traits::read_element_idx(k,j,b); write_mat_element_idx(i,j,r,x); } return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_ms_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_scalar::value && !qvm_detail::mul_ms_defined::rows,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A const & a, B b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,mat_traits::read_element_idx(i,j,a)*b); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_sm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && is_mat::value && !qvm_detail::mul_sm_defined::rows,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator*( A a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,a*mat_traits::read_element_idx(i,j,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct neq_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::neq_mm_defined::rows,mat_traits::cols>::value, bool>::type operator!=( A const & a, B const & b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) if( mat_traits::read_element_idx(i,j,a)!=mat_traits::read_element_idx(i,j,b) ) return true; return false; } //////////////////////////////////////////////// namespace qvm_detail { template struct plus_eq_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::plus_eq_mm_defined::rows,mat_traits::cols>::value, A &>::type operator+=( A & a, B const & b ) { for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,a,mat_traits::read_element_idx(i,j,a)+mat_traits::read_element_idx(i,j,b)); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct plus_mm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_mat::value && mat_traits::rows==mat_traits::rows && mat_traits::cols==mat_traits::cols && !qvm_detail::plus_mm_defined::rows,mat_traits::cols>::value, deduce_mat2::rows,mat_traits::cols> >::type operator+( A const & a, B const & b ) { typedef typename deduce_mat2::rows,mat_traits::cols>::type R; R r; for( int i=0; i!=mat_traits::rows; ++i ) for( int j=0; j!=mat_traits::cols; ++j ) write_mat_element_idx(i,j,r,mat_traits::read_element_idx(i,j,a)+mat_traits::read_element_idx(i,j,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template class mref_ { mref_( mref_ const & ); mref_ & operator=( mref_ const & ); ~mref_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL mref_ & operator=( R const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct mref_write_traits; template struct mref_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef qvm_detail::mref_ this_matrix; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col,reinterpret_cast(x)); } }; template struct mref_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef qvm_detail::mref_ this_matrix; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::mref_ >: qvm_detail::mref_write_traits { typedef typename mat_traits::scalar_type scalar_type; typedef qvm_detail::mref_ this_matrix; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value, qvm_detail::mref_ const &>::type mref( M const & a ) { return reinterpret_cast const &>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value, qvm_detail::mref_ &>::type mref( M & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class zero_mat_ { zero_mat_( zero_mat_ const & ); zero_mat_ & operator=( zero_mat_ const & ); ~zero_mat_(); public: template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits< qvm_detail::zero_mat_ > { typedef qvm_detail::zero_mat_ this_matrix; typedef T scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::value(0); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::value(0); } }; template struct deduce_mat,R,C> { typedef mat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::zero_mat_ const & zero_mat() { return *(qvm_detail::zero_mat_ const *)qvm_detail::get_valid_ptr_mat_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::zero_mat_ const & zero_mat() { return *(qvm_detail::zero_mat_ const *)qvm_detail::get_valid_ptr_mat_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value, void>::type set_zero( A & a ) { assign(a,zero_mat::scalar_type,mat_traits::rows,mat_traits::cols>()); } //////////////////////////////////////////////// namespace qvm_detail { template struct rot_mat_ { typedef S scalar_type; scalar_type a[3][3]; BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE rot_mat_( scalar_type a00, scalar_type a01, scalar_type a02, scalar_type a10, scalar_type a11, scalar_type a12, scalar_type a20, scalar_type a21, scalar_type a22 ) { a[0][0] = a00; a[0][1] = a01; a[0][2] = a02; a[1][0] = a10; a[1][1] = a11; a[1][2] = a12; a[2][0] = a20; a[2][1] = a21; a[2][2] = a22; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct rot_m_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&)[3][3] ) { return scalar_traits::value(Row==Col); } }; template <> struct rot_m_get<0,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[0][0]; } }; template <> struct rot_m_get<0,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[0][1]; } }; template <> struct rot_m_get<0,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[0][2]; } }; template <> struct rot_m_get<1,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[1][0]; } }; template <> struct rot_m_get<1,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[1][1]; } }; template <> struct rot_m_get<1,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[1][2]; } }; template <> struct rot_m_get<2,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[2][0]; } }; template <> struct rot_m_get<2,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[2][1]; } }; template <> struct rot_m_get<2,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const (&a)[3][3] ) { return a[2][2]; } }; } template struct mat_traits; template struct mat_traits< qvm_detail::rot_mat_ > { typedef qvm_detail::rot_mat_ this_matrix; typedef typename this_matrix::scalar_type scalar_type; static int const rows=D; static int const cols=D; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::get(x.a); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::value(row==col); } }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE typename enable_if_c< is_vec::value && vec_traits::dim==3, qvm_detail::rot_mat_ >::type rot_mat( V const & axis, Angle angle ) { typedef Angle scalar_type; scalar_type const x=vec_traits::template read_element<0>(axis); scalar_type const y=vec_traits::template read_element<1>(axis); scalar_type const z=vec_traits::template read_element<2>(axis); scalar_type const m2=x*x+y*y+z*z; if( m2==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); scalar_type const s = sin(angle); scalar_type const c = cos(angle); scalar_type const x2 = x*x; scalar_type const y2 = y*y; scalar_type const z2 = z*z; scalar_type const xy = x*y; scalar_type const xz = x*z; scalar_type const yz = y*z; scalar_type const xs = x*s; scalar_type const ys = y*s; scalar_type const zs = z*s; scalar_type const one = scalar_traits::value(1); scalar_type const c1 = one-c; return qvm_detail::rot_mat_( x2+(one-x2)*c, xy*c1-zs, xz*(one-c)+ys, xy*c1+zs, y2+(one-y2)*c, yz*c1-xs, xz*c1-ys, yz*c1+xs, z2+(one-z2)*c ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3 && is_vec::value && vec_traits::dim==3, void>::type set_rot( A & a, B const & axis, Angle angle ) { assign(a,rot_mat::rows>(axis,angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3 && is_vec::value && vec_traits::dim==3, void>::type rotate( A & a, B const & axis, Angle angle ) { a *= rot_mat::rows>(axis,angle); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_xzy( Angle x1, Angle z2, Angle y3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(x1); scalar_type const s1 = sin(x1); scalar_type const c2 = cos(z2); scalar_type const s2 = sin(z2); scalar_type const c3 = cos(y3); scalar_type const s3 = sin(y3); return qvm_detail::rot_mat_( c2*c3, -s2, c2*s3, s1*s3 + c1*c3*s2, c1*c2, c1*s2*s3 - c3*s1, c3*s1*s2 - c1*s3, c2*s1, c1*c3 + s1*s2*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_xzy( A & a, Angle x1, Angle z2, Angle y3 ) { assign(a,rot_mat_xzy::rows>(x1,z2,y3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_xzy( A & a, Angle x1, Angle z2, Angle y3 ) { a *= rot_mat_xzy::rows>(x1,z2,y3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_xyz( Angle x1, Angle y2, Angle z3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(x1); scalar_type const s1 = sin(x1); scalar_type const c2 = cos(y2); scalar_type const s2 = sin(y2); scalar_type const c3 = cos(z3); scalar_type const s3 = sin(z3); return qvm_detail::rot_mat_( c2*c3, -c2*s3, s2, c1*s3 + c3*s1*s2, c1*c3 - s1*s2*s3, -c2*s1, s1*s3 - c1*c3*s2, c3*s1 + c1*s2*s3, c1*c2 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_xyz( A & a, Angle x1, Angle y2, Angle z3 ) { assign(a,rot_mat_xyz::rows>(x1,y2,z3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_xyz( A & a, Angle x1, Angle y2, Angle z3 ) { a *= rot_mat_xyz::rows>(x1,y2,z3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_yxz( Angle y1, Angle x2, Angle z3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(y1); scalar_type const s1 = sin(y1); scalar_type const c2 = cos(x2); scalar_type const s2 = sin(x2); scalar_type const c3 = cos(z3); scalar_type const s3 = sin(z3); return qvm_detail::rot_mat_( c1*c3 + s1*s2*s3, c3*s1*s2 - c1*s3, c2*s1, c2*s3, c2*c3, -s2, c1*s2*s3 - c3*s1, c1*c3*s2 + s1*s3, c1*c2 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_yxz( A & a, Angle y1, Angle x2, Angle z3 ) { assign(a,rot_mat_yxz::rows>(y1,x2,z3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_yxz( A & a, Angle y1, Angle x2, Angle z3 ) { a *= rot_mat_yxz::rows>(y1,x2,z3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_yzx( Angle y1, Angle z2, Angle x3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(y1); scalar_type const s1 = sin(y1); scalar_type const c2 = cos(z2); scalar_type const s2 = sin(z2); scalar_type const c3 = cos(x3); scalar_type const s3 = sin(x3); return qvm_detail::rot_mat_( c1*c2, s1*s3 - c1*c3*s2, c3*s1 + c1*s2*s3, s2, c2*c3, -c2*s3, -c2*s1, c1*s3 + c3*s1*s2, c1*c3 - s1*s2*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_yzx( A & a, Angle y1, Angle z2, Angle x3 ) { assign(a,rot_mat_yzx::rows>(y1,z2,x3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_yzx( A & a, Angle y1, Angle z2, Angle x3 ) { a *= rot_mat_yzx::rows>(y1,z2,x3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_zyx( Angle z1, Angle y2, Angle x3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(z1); scalar_type const s1 = sin(z1); scalar_type const c2 = cos(y2); scalar_type const s2 = sin(y2); scalar_type const c3 = cos(x3); scalar_type const s3 = sin(x3); return qvm_detail::rot_mat_( c1*c2, c1*s2*s3 - c3*s1, s1*s3 + c1*c3*s2, c2*s1, c1*c3 + s1*s2*s3, c3*s1*s2 - c1*s3, -s2, c2*s3, c2*c3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_zyx( A & a, Angle z1, Angle y2, Angle x3 ) { assign(a,rot_mat_zyx::rows>(z1,y2,x3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_zyx( A & a, Angle z1, Angle y2, Angle x3 ) { a *= rot_mat_zyx::rows>(z1,y2,x3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_zxy( Angle z1, Angle x2, Angle y3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(z1); scalar_type const s1 = sin(z1); scalar_type const c2 = cos(x2); scalar_type const s2 = sin(x2); scalar_type const c3 = cos(y3); scalar_type const s3 = sin(y3); return qvm_detail::rot_mat_( c1*c3 - s1*s2*s3, -c2*s1, c1*s3 + c3*s1*s2, c3*s1 + c1*s2*s3, c1*c2, s1*s3 - c1*c3*s2, -c2*s3, s2, c2*c3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_zxy( A & a, Angle z1, Angle x2, Angle y3 ) { assign(a,rot_mat_zxy::rows>(z1,x2,y3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_zxy( A & a, Angle z1, Angle x2, Angle y3 ) { a *= rot_mat_zxy::rows>(z1,x2,y3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_xzx( Angle x1, Angle z2, Angle x3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(x1); scalar_type const s1 = sin(x1); scalar_type const c2 = cos(z2); scalar_type const s2 = sin(z2); scalar_type const c3 = cos(x3); scalar_type const s3 = sin(x3); return qvm_detail::rot_mat_( c2, -c3*s2, s2*s3, c1*s2, c1*c2*c3 - s1*s3, -c3*s1 - c1*c2*s3, s1*s2, c1*s3 + c2*c3*s1, c1*c3 - c2*s1*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_xzx( A & a, Angle x1, Angle z2, Angle x3 ) { assign(a,rot_mat_xzx::rows>(x1,z2,x3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_xzx( A & a, Angle x1, Angle z2, Angle x3 ) { a *= rot_mat_xzx::rows>(x1,z2,x3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_xyx( Angle x1, Angle y2, Angle x3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(x1); scalar_type const s1 = sin(x1); scalar_type const c2 = cos(y2); scalar_type const s2 = sin(y2); scalar_type const c3 = cos(x3); scalar_type const s3 = sin(x3); return qvm_detail::rot_mat_( c2, s2*s3, c3*s2, s1*s2, c1*c3 - c2*s1*s3, -c1*s3 - c2*c3*s1, -c1*s2, c3*s1 + c1*c2*s3, c1*c2*c3 - s1*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_xyx( A & a, Angle x1, Angle y2, Angle x3 ) { assign(a,rot_mat_xyx::rows>(x1,y2,x3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_xyx( A & a, Angle x1, Angle y2, Angle x3 ) { a *= rot_mat_xyx::rows>(x1,y2,x3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_yxy( Angle y1, Angle x2, Angle y3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(y1); scalar_type const s1 = sin(y1); scalar_type const c2 = cos(x2); scalar_type const s2 = sin(x2); scalar_type const c3 = cos(y3); scalar_type const s3 = sin(y3); return qvm_detail::rot_mat_( c1*c3 - c2*s1*s3, s1*s2, c1*s3 + c2*c3*s1, s2*s3, c2, -c3*s2, -c3*s1 - c1*c2*s3, c1*s2, c1*c2*c3 - s1*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_yxy( A & a, Angle y1, Angle x2, Angle y3 ) { assign(a,rot_mat_yxy::rows>(y1,x2,y3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_yxy( A & a, Angle y1, Angle x2, Angle y3 ) { a *= rot_mat_yxy::rows>(y1,x2,y3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_yzy( Angle y1, Angle z2, Angle y3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(y1); scalar_type const s1 = sin(y1); scalar_type const c2 = cos(z2); scalar_type const s2 = sin(z2); scalar_type const c3 = cos(y3); scalar_type const s3 = sin(y3); return qvm_detail::rot_mat_( c1*c2*c3 - s1*s3, -c1*s2, c3*s1 + c1*c2*s3, c3*s2, c2, s2*s3, -c1*s3 - c2*c3*s1, s1*s2, c1*c3 - c2*s1*s3 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_yzy( A & a, Angle y1, Angle z2, Angle y3 ) { assign(a,rot_mat_yzy::rows>(y1,z2,y3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_yzy( A & a, Angle y1, Angle z2, Angle y3 ) { a *= rot_mat_yzy::rows>(y1,z2,y3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_zyz( Angle z1, Angle y2, Angle z3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(z1); scalar_type const s1 = sin(z1); scalar_type const c2 = cos(y2); scalar_type const s2 = sin(y2); scalar_type const c3 = cos(z3); scalar_type const s3 = sin(z3); return qvm_detail::rot_mat_( c1*c2*c3 - s1*s3, -c3*s1 - c1*c2*s3, c1*s2, c1*s3 + c2*c3*s1, c1*c3 - c2*s1*s3, s1*s2, -c3*s2, s2*s3, c2 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_zyz( A & a, Angle z1, Angle y2, Angle z3 ) { assign(a,rot_mat_zyz::rows>(z1,y2,z3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_zyz( A & a, Angle z1, Angle y2, Angle z3 ) { a *= rot_mat_zyz::rows>(z1,y2,z3); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE qvm_detail::rot_mat_ rot_mat_zxz( Angle z1, Angle x2, Angle z3 ) { typedef Angle scalar_type; scalar_type const c1 = cos(z1); scalar_type const s1 = sin(z1); scalar_type const c2 = cos(x2); scalar_type const s2 = sin(x2); scalar_type const c3 = cos(z3); scalar_type const s3 = sin(z3); return qvm_detail::rot_mat_( c1*c3 - c2*s1*s3, -c1*s3 - c2*c3*s1, s1*s2, c3*s1 + c1*c2*s3, c1*c2*c3 - s1*s3, -c1*s2, s2*s3, c3*s2, c2 ); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type set_rot_zxz( A & a, Angle z1, Angle x2, Angle z3 ) { assign(a,rot_mat_zxz::rows>(z1,x2,z3)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && mat_traits::rows>=3, void>::type rotate_zxz( A & a, Angle z1, Angle x2, Angle z3 ) { a *= rot_mat_zxz::rows>(z1,x2,z3); } //////////////////////////////////////////////// namespace qvm_detail { template struct rotx_mat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL rotx_mat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: rotx_mat_( rotx_mat_ const & ); rotx_mat_ & operator=( rotx_mat_ const & ); ~rotx_mat_(); }; template struct rotx_m_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(Row==Col); } }; template <> struct rotx_m_get<1,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; template <> struct rotx_m_get<1,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return -sin(angle); } }; template <> struct rotx_m_get<2,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle); } }; template <> struct rotx_m_get<2,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; } template struct mat_traits< qvm_detail::rotx_mat_ > { typedef qvm_detail::rotx_mat_ this_matrix; typedef Angle scalar_type; static int const rows=Dim; static int const cols=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Row::get(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(row(x); if( row==1 ) { if( col==1 ) return cos(a); if( col==2 ) return -sin(a); } if( row==2 ) { if( col==1 ) return sin(a); if( col==2 ) return cos(a); } return scalar_traits::value(row==col); } }; template struct deduce_mat,Dim,Dim> { typedef mat type; }; template struct deduce_mat2,qvm_detail::rotx_mat_,Dim,Dim> { typedef mat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::rotx_mat_ const & rotx_mat( Angle const & angle ) { BOOST_QVM_STATIC_ASSERT(Dim>=3); return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=3 && mat_traits::rows==mat_traits::cols, void>::type set_rotx( A & a, Angle angle ) { assign(a,rotx_mat::rows>(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=3 && mat_traits::rows==mat_traits::cols, void>::type rotate_x( A & a, Angle angle ) { a *= rotx_mat::rows>(angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct roty_mat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL roty_mat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: roty_mat_( roty_mat_ const & ); roty_mat_ & operator=( roty_mat_ const & ); ~roty_mat_(); }; template struct roty_m_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(Row==Col); } }; template <> struct roty_m_get<0,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; template <> struct roty_m_get<0,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle); } }; template <> struct roty_m_get<2,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return -sin(angle); } }; template <> struct roty_m_get<2,2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; } template struct mat_traits< qvm_detail::roty_mat_ > { typedef qvm_detail::roty_mat_ this_matrix; typedef Angle scalar_type; static int const rows=Dim; static int const cols=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Row::get(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(row(x); if( row==0 ) { if( col==0 ) return cos(a); if( col==2 ) return sin(a); } if( row==2 ) { if( col==0 ) return -sin(a); if( col==2 ) return cos(a); } return scalar_traits::value(row==col); } }; template struct deduce_mat,Dim,Dim> { typedef mat type; }; template struct deduce_mat2,qvm_detail::roty_mat_,Dim,Dim> { typedef mat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::roty_mat_ const & roty_mat( Angle const & angle ) { BOOST_QVM_STATIC_ASSERT(Dim>=3); return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=2 && mat_traits::rows==mat_traits::cols, void>::type set_roty( A & a, Angle angle ) { assign(a,roty_mat::rows>(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=3 && mat_traits::rows==mat_traits::cols, void>::type rotate_y( A & a, Angle angle ) { a *= roty_mat::rows>(angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct rotz_mat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL rotz_mat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: rotz_mat_( rotz_mat_ const & ); rotz_mat_ & operator=( rotz_mat_ const & ); ~rotz_mat_(); }; template struct rotz_m_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(Row==Col); } }; template <> struct rotz_m_get<0,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; template <> struct rotz_m_get<0,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return -sin(angle); } }; template <> struct rotz_m_get<1,0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle); } }; template <> struct rotz_m_get<1,1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle); } }; } template struct mat_traits< qvm_detail::rotz_mat_ > { typedef qvm_detail::rotz_mat_ this_matrix; typedef Angle scalar_type; static int const rows=Dim; static int const cols=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Row::get(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(row(x); if( row==0 ) { if( col==0 ) return cos(a); if( col==1 ) return -sin(a); } if( row==1 ) { if( col==0 ) return sin(a); if( col==1 ) return cos(a); } return scalar_traits::value(row==col); } }; template struct deduce_mat,Dim,Dim> { typedef mat type; }; template struct deduce_mat2,qvm_detail::rotz_mat_,R,C> { typedef mat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::rotz_mat_ const & rotz_mat( Angle const & angle ) { BOOST_QVM_STATIC_ASSERT(Dim>=2); return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=2 && mat_traits::rows==mat_traits::cols, void>::type set_rotz( A & a, Angle angle ) { assign(a,rotz_mat::rows>(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_mat::value && mat_traits::rows>=2 && mat_traits::rows==mat_traits::cols, void>::type rotate_z( A & a, Angle angle ) { a *= rotz_mat::rows>(angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct inverse_m_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename lazy_enable_if_c< is_mat::value && is_scalar::value && mat_traits::rows==mat_traits::cols && !qvm_detail::inverse_m_defined::rows>::value, deduce_mat2::rows,mat_traits::cols> >::type inverse( A const & a, B det ) { typedef typename mat_traits::scalar_type T; BOOST_QVM_ASSERT(det!=scalar_traits::value(0)); T f=scalar_traits::value(1)/det; typedef typename deduce_mat2::rows,mat_traits::cols>::type cofactor_return_type; cofactor_return_type c=qvm_detail::cofactor_impl(a); return reinterpret_cast const &>(c) * f; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename lazy_enable_if_c< is_mat::value && mat_traits::rows==mat_traits::cols && !qvm_detail::inverse_m_defined::rows>::value, deduce_mat >::type inverse( A const & a ) { typedef typename mat_traits::scalar_type T; T det=determinant(a); if( det==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_determinant_error()); return inverse(a,det); } //////////////////////////////////////////////// namespace sfinae { using ::boost::qvm::to_string; using ::boost::qvm::assign; using ::boost::qvm::determinant; using ::boost::qvm::cmp; using ::boost::qvm::convert_to; using ::boost::qvm::set_identity; using ::boost::qvm::set_zero; using ::boost::qvm::scalar_cast; using ::boost::qvm::operator/=; using ::boost::qvm::operator/; using ::boost::qvm::operator==; using ::boost::qvm::operator-=; using ::boost::qvm::operator-; using ::boost::qvm::operator*=; using ::boost::qvm::operator*; using ::boost::qvm::operator!=; using ::boost::qvm::operator+=; using ::boost::qvm::operator+; using ::boost::qvm::mref; using ::boost::qvm::rot_mat; using ::boost::qvm::set_rot; using ::boost::qvm::rotate; using ::boost::qvm::set_rotx; using ::boost::qvm::rotate_x; using ::boost::qvm::set_roty; using ::boost::qvm::rotate_y; using ::boost::qvm::set_rotz; using ::boost::qvm::rotate_z; using ::boost::qvm::inverse; } } } #endif // <<< #include #line 9 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/mat_access.hpp" #ifndef BOOST_QVM_MAT_ACCESS_HPP_INCLUDED #define BOOST_QVM_MAT_ACCESS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 349: #include // Expanded at line 145: #include // Expanded at line 1292: #include // Expanded at line 218: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A00( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 0::cols); return mat_traits::template read_element<0,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A01( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 1::cols); return mat_traits::template read_element<0,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A02( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 2::cols); return mat_traits::template read_element<0,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A03( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 3::cols); return mat_traits::template read_element<0,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A04( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 4::cols); return mat_traits::template read_element<0,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A05( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 5::cols); return mat_traits::template read_element<0,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A06( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 6::cols); return mat_traits::template read_element<0,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A07( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 7::cols); return mat_traits::template read_element<0,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A08( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 8::cols); return mat_traits::template read_element<0,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A09( M const & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 9::cols); return mat_traits::template read_element<0,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A10( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 0::cols); return mat_traits::template read_element<1,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A11( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 1::cols); return mat_traits::template read_element<1,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A12( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 2::cols); return mat_traits::template read_element<1,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A13( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 3::cols); return mat_traits::template read_element<1,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A14( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 4::cols); return mat_traits::template read_element<1,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A15( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 5::cols); return mat_traits::template read_element<1,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A16( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 6::cols); return mat_traits::template read_element<1,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A17( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 7::cols); return mat_traits::template read_element<1,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A18( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 8::cols); return mat_traits::template read_element<1,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A19( M const & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 9::cols); return mat_traits::template read_element<1,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A20( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 0::cols); return mat_traits::template read_element<2,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A21( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 1::cols); return mat_traits::template read_element<2,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A22( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 2::cols); return mat_traits::template read_element<2,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A23( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 3::cols); return mat_traits::template read_element<2,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A24( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 4::cols); return mat_traits::template read_element<2,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A25( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 5::cols); return mat_traits::template read_element<2,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A26( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 6::cols); return mat_traits::template read_element<2,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A27( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 7::cols); return mat_traits::template read_element<2,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A28( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 8::cols); return mat_traits::template read_element<2,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A29( M const & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 9::cols); return mat_traits::template read_element<2,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A30( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 0::cols); return mat_traits::template read_element<3,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A31( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 1::cols); return mat_traits::template read_element<3,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A32( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 2::cols); return mat_traits::template read_element<3,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A33( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 3::cols); return mat_traits::template read_element<3,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A34( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 4::cols); return mat_traits::template read_element<3,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A35( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 5::cols); return mat_traits::template read_element<3,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A36( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 6::cols); return mat_traits::template read_element<3,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A37( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 7::cols); return mat_traits::template read_element<3,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A38( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 8::cols); return mat_traits::template read_element<3,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A39( M const & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 9::cols); return mat_traits::template read_element<3,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A40( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 0::cols); return mat_traits::template read_element<4,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A41( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 1::cols); return mat_traits::template read_element<4,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A42( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 2::cols); return mat_traits::template read_element<4,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A43( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 3::cols); return mat_traits::template read_element<4,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A44( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 4::cols); return mat_traits::template read_element<4,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A45( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 5::cols); return mat_traits::template read_element<4,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A46( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 6::cols); return mat_traits::template read_element<4,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A47( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 7::cols); return mat_traits::template read_element<4,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A48( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 8::cols); return mat_traits::template read_element<4,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A49( M const & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 9::cols); return mat_traits::template read_element<4,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A50( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 0::cols); return mat_traits::template read_element<5,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A51( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 1::cols); return mat_traits::template read_element<5,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A52( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 2::cols); return mat_traits::template read_element<5,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A53( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 3::cols); return mat_traits::template read_element<5,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A54( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 4::cols); return mat_traits::template read_element<5,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A55( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 5::cols); return mat_traits::template read_element<5,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A56( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 6::cols); return mat_traits::template read_element<5,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A57( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 7::cols); return mat_traits::template read_element<5,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A58( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 8::cols); return mat_traits::template read_element<5,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A59( M const & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 9::cols); return mat_traits::template read_element<5,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A60( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 0::cols); return mat_traits::template read_element<6,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A61( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 1::cols); return mat_traits::template read_element<6,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A62( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 2::cols); return mat_traits::template read_element<6,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A63( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 3::cols); return mat_traits::template read_element<6,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A64( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 4::cols); return mat_traits::template read_element<6,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A65( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 5::cols); return mat_traits::template read_element<6,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A66( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 6::cols); return mat_traits::template read_element<6,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A67( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 7::cols); return mat_traits::template read_element<6,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A68( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 8::cols); return mat_traits::template read_element<6,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A69( M const & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 9::cols); return mat_traits::template read_element<6,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A70( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 0::cols); return mat_traits::template read_element<7,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A71( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 1::cols); return mat_traits::template read_element<7,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A72( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 2::cols); return mat_traits::template read_element<7,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A73( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 3::cols); return mat_traits::template read_element<7,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A74( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 4::cols); return mat_traits::template read_element<7,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A75( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 5::cols); return mat_traits::template read_element<7,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A76( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 6::cols); return mat_traits::template read_element<7,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A77( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 7::cols); return mat_traits::template read_element<7,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A78( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 8::cols); return mat_traits::template read_element<7,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A79( M const & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 9::cols); return mat_traits::template read_element<7,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A80( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 0::cols); return mat_traits::template read_element<8,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A81( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 1::cols); return mat_traits::template read_element<8,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A82( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 2::cols); return mat_traits::template read_element<8,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A83( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 3::cols); return mat_traits::template read_element<8,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A84( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 4::cols); return mat_traits::template read_element<8,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A85( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 5::cols); return mat_traits::template read_element<8,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A86( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 6::cols); return mat_traits::template read_element<8,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A87( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 7::cols); return mat_traits::template read_element<8,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A88( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 8::cols); return mat_traits::template read_element<8,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A89( M const & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 9::cols); return mat_traits::template read_element<8,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A90( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 0::cols); return mat_traits::template read_element<9,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A91( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 1::cols); return mat_traits::template read_element<9,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A92( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 2::cols); return mat_traits::template read_element<9,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A93( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 3::cols); return mat_traits::template read_element<9,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A94( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 4::cols); return mat_traits::template read_element<9,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A95( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 5::cols); return mat_traits::template read_element<9,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A96( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 6::cols); return mat_traits::template read_element<9,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A97( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 7::cols); return mat_traits::template read_element<9,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A98( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 8::cols); return mat_traits::template read_element<9,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename mat_traits::scalar_type>::type A99( M const & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 9::cols); return mat_traits::template read_element<9,9>(a); } namespace qvm_detail { template struct m_element_access { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void operator=( typename mat_traits::scalar_type s ) { mat_traits::template write_element(*reinterpret_cast(this), s); } BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL operator typename mat_traits::scalar_type() const { return mat_traits::template read_element(*reinterpret_cast(this)); } }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value, typename mat_traits::scalar_type>::type A( M const & a ) { BOOST_QVM_STATIC_ASSERT(R>=0); BOOST_QVM_STATIC_ASSERT(R::rows); BOOST_QVM_STATIC_ASSERT(C>=0); BOOST_QVM_STATIC_ASSERT(C::cols); return mat_traits::template read_element(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value && mat_write_element_ref::value, typename mat_traits::scalar_type &>::type A( M & a ) { BOOST_QVM_STATIC_ASSERT(R>=0); BOOST_QVM_STATIC_ASSERT(R::rows); BOOST_QVM_STATIC_ASSERT(C>=0); BOOST_QVM_STATIC_ASSERT(C::cols); return mat_traits::template write_element(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_mat::value && !mat_write_element_ref::value, qvm_detail::m_element_access &>::type A( M & a ) { BOOST_QVM_STATIC_ASSERT(R>=0); BOOST_QVM_STATIC_ASSERT(R::rows); BOOST_QVM_STATIC_ASSERT(C>=0); BOOST_QVM_STATIC_ASSERT(C::cols); return *reinterpret_cast *>(&a); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A00( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 0::cols); return mat_traits::template write_element<0,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A01( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 1::cols); return mat_traits::template write_element<0,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A02( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 2::cols); return mat_traits::template write_element<0,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A03( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 3::cols); return mat_traits::template write_element<0,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A04( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 4::cols); return mat_traits::template write_element<0,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A05( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 5::cols); return mat_traits::template write_element<0,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A06( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 6::cols); return mat_traits::template write_element<0,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A07( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 7::cols); return mat_traits::template write_element<0,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A08( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 8::cols); return mat_traits::template write_element<0,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A09( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 9::cols); return mat_traits::template write_element<0,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A10( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 0::cols); return mat_traits::template write_element<1,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A11( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 1::cols); return mat_traits::template write_element<1,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A12( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 2::cols); return mat_traits::template write_element<1,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A13( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 3::cols); return mat_traits::template write_element<1,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A14( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 4::cols); return mat_traits::template write_element<1,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A15( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 5::cols); return mat_traits::template write_element<1,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A16( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 6::cols); return mat_traits::template write_element<1,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A17( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 7::cols); return mat_traits::template write_element<1,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A18( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 8::cols); return mat_traits::template write_element<1,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A19( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 9::cols); return mat_traits::template write_element<1,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A20( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 0::cols); return mat_traits::template write_element<2,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A21( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 1::cols); return mat_traits::template write_element<2,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A22( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 2::cols); return mat_traits::template write_element<2,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A23( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 3::cols); return mat_traits::template write_element<2,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A24( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 4::cols); return mat_traits::template write_element<2,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A25( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 5::cols); return mat_traits::template write_element<2,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A26( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 6::cols); return mat_traits::template write_element<2,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A27( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 7::cols); return mat_traits::template write_element<2,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A28( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 8::cols); return mat_traits::template write_element<2,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A29( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 9::cols); return mat_traits::template write_element<2,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A30( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 0::cols); return mat_traits::template write_element<3,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A31( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 1::cols); return mat_traits::template write_element<3,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A32( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 2::cols); return mat_traits::template write_element<3,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A33( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 3::cols); return mat_traits::template write_element<3,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A34( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 4::cols); return mat_traits::template write_element<3,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A35( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 5::cols); return mat_traits::template write_element<3,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A36( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 6::cols); return mat_traits::template write_element<3,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A37( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 7::cols); return mat_traits::template write_element<3,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A38( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 8::cols); return mat_traits::template write_element<3,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A39( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 9::cols); return mat_traits::template write_element<3,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A40( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 0::cols); return mat_traits::template write_element<4,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A41( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 1::cols); return mat_traits::template write_element<4,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A42( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 2::cols); return mat_traits::template write_element<4,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A43( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 3::cols); return mat_traits::template write_element<4,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A44( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 4::cols); return mat_traits::template write_element<4,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A45( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 5::cols); return mat_traits::template write_element<4,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A46( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 6::cols); return mat_traits::template write_element<4,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A47( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 7::cols); return mat_traits::template write_element<4,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A48( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 8::cols); return mat_traits::template write_element<4,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A49( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 9::cols); return mat_traits::template write_element<4,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A50( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 0::cols); return mat_traits::template write_element<5,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A51( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 1::cols); return mat_traits::template write_element<5,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A52( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 2::cols); return mat_traits::template write_element<5,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A53( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 3::cols); return mat_traits::template write_element<5,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A54( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 4::cols); return mat_traits::template write_element<5,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A55( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 5::cols); return mat_traits::template write_element<5,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A56( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 6::cols); return mat_traits::template write_element<5,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A57( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 7::cols); return mat_traits::template write_element<5,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A58( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 8::cols); return mat_traits::template write_element<5,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A59( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 9::cols); return mat_traits::template write_element<5,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A60( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 0::cols); return mat_traits::template write_element<6,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A61( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 1::cols); return mat_traits::template write_element<6,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A62( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 2::cols); return mat_traits::template write_element<6,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A63( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 3::cols); return mat_traits::template write_element<6,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A64( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 4::cols); return mat_traits::template write_element<6,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A65( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 5::cols); return mat_traits::template write_element<6,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A66( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 6::cols); return mat_traits::template write_element<6,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A67( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 7::cols); return mat_traits::template write_element<6,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A68( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 8::cols); return mat_traits::template write_element<6,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A69( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 9::cols); return mat_traits::template write_element<6,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A70( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 0::cols); return mat_traits::template write_element<7,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A71( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 1::cols); return mat_traits::template write_element<7,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A72( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 2::cols); return mat_traits::template write_element<7,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A73( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 3::cols); return mat_traits::template write_element<7,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A74( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 4::cols); return mat_traits::template write_element<7,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A75( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 5::cols); return mat_traits::template write_element<7,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A76( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 6::cols); return mat_traits::template write_element<7,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A77( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 7::cols); return mat_traits::template write_element<7,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A78( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 8::cols); return mat_traits::template write_element<7,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A79( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 9::cols); return mat_traits::template write_element<7,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A80( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 0::cols); return mat_traits::template write_element<8,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A81( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 1::cols); return mat_traits::template write_element<8,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A82( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 2::cols); return mat_traits::template write_element<8,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A83( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 3::cols); return mat_traits::template write_element<8,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A84( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 4::cols); return mat_traits::template write_element<8,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A85( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 5::cols); return mat_traits::template write_element<8,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A86( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 6::cols); return mat_traits::template write_element<8,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A87( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 7::cols); return mat_traits::template write_element<8,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A88( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 8::cols); return mat_traits::template write_element<8,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A89( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 9::cols); return mat_traits::template write_element<8,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A90( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 0::cols); return mat_traits::template write_element<9,0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A91( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 1::cols); return mat_traits::template write_element<9,1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A92( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 2::cols); return mat_traits::template write_element<9,2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A93( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 3::cols); return mat_traits::template write_element<9,3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A94( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 4::cols); return mat_traits::template write_element<9,4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A95( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 5::cols); return mat_traits::template write_element<9,5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A96( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 6::cols); return mat_traits::template write_element<9,6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A97( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 7::cols); return mat_traits::template write_element<9,7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A98( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 8::cols); return mat_traits::template write_element<9,8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && mat_write_element_ref::value,typename mat_traits::scalar_type &>::type A99( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 9::cols); return mat_traits::template write_element<9,9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,0,M> &>::type A00( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,1,M> &>::type A01( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,2,M> &>::type A02( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,3,M> &>::type A03( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,4,M> &>::type A04( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,5,M> &>::type A05( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,6,M> &>::type A06( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,7,M> &>::type A07( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,8,M> &>::type A08( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<0,9,M> &>::type A09( M & a ) { BOOST_QVM_STATIC_ASSERT(0::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,0,M> &>::type A10( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,1,M> &>::type A11( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,2,M> &>::type A12( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,3,M> &>::type A13( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,4,M> &>::type A14( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,5,M> &>::type A15( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,6,M> &>::type A16( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,7,M> &>::type A17( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,8,M> &>::type A18( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<1,9,M> &>::type A19( M & a ) { BOOST_QVM_STATIC_ASSERT(1::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,0,M> &>::type A20( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,1,M> &>::type A21( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,2,M> &>::type A22( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,3,M> &>::type A23( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,4,M> &>::type A24( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,5,M> &>::type A25( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,6,M> &>::type A26( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,7,M> &>::type A27( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,8,M> &>::type A28( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<2,9,M> &>::type A29( M & a ) { BOOST_QVM_STATIC_ASSERT(2::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,0,M> &>::type A30( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,1,M> &>::type A31( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,2,M> &>::type A32( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,3,M> &>::type A33( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,4,M> &>::type A34( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,5,M> &>::type A35( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,6,M> &>::type A36( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,7,M> &>::type A37( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,8,M> &>::type A38( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<3,9,M> &>::type A39( M & a ) { BOOST_QVM_STATIC_ASSERT(3::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,0,M> &>::type A40( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,1,M> &>::type A41( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,2,M> &>::type A42( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,3,M> &>::type A43( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,4,M> &>::type A44( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,5,M> &>::type A45( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,6,M> &>::type A46( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,7,M> &>::type A47( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,8,M> &>::type A48( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<4,9,M> &>::type A49( M & a ) { BOOST_QVM_STATIC_ASSERT(4::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,0,M> &>::type A50( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,1,M> &>::type A51( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,2,M> &>::type A52( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,3,M> &>::type A53( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,4,M> &>::type A54( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,5,M> &>::type A55( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,6,M> &>::type A56( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,7,M> &>::type A57( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,8,M> &>::type A58( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<5,9,M> &>::type A59( M & a ) { BOOST_QVM_STATIC_ASSERT(5::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,0,M> &>::type A60( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,1,M> &>::type A61( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,2,M> &>::type A62( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,3,M> &>::type A63( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,4,M> &>::type A64( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,5,M> &>::type A65( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,6,M> &>::type A66( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,7,M> &>::type A67( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,8,M> &>::type A68( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<6,9,M> &>::type A69( M & a ) { BOOST_QVM_STATIC_ASSERT(6::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,0,M> &>::type A70( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,1,M> &>::type A71( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,2,M> &>::type A72( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,3,M> &>::type A73( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,4,M> &>::type A74( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,5,M> &>::type A75( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,6,M> &>::type A76( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,7,M> &>::type A77( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,8,M> &>::type A78( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<7,9,M> &>::type A79( M & a ) { BOOST_QVM_STATIC_ASSERT(7::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,0,M> &>::type A80( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,1,M> &>::type A81( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,2,M> &>::type A82( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,3,M> &>::type A83( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,4,M> &>::type A84( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,5,M> &>::type A85( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,6,M> &>::type A86( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,7,M> &>::type A87( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,8,M> &>::type A88( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<8,9,M> &>::type A89( M & a ) { BOOST_QVM_STATIC_ASSERT(8::rows && 9::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,0,M> &>::type A90( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 0::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,1,M> &>::type A91( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 1::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,2,M> &>::type A92( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 2::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,3,M> &>::type A93( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 3::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,4,M> &>::type A94( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 4::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,5,M> &>::type A95( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 5::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,6,M> &>::type A96( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 6::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,7,M> &>::type A97( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 7::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,8,M> &>::type A98( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 8::cols); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !mat_write_element_ref::value,qvm_detail::m_element_access<9,9,M> &>::type A99( M & a ) { BOOST_QVM_STATIC_ASSERT(9::rows && 9::cols); return *reinterpret_cast *>(&a); } } } #endif // <<< #include #line 10 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/mat_traits_defaults.hpp" #ifndef BOOST_QVM_MAT_TRAITS_DEFAULTS_HPP_INCLUDED #define BOOST_QVM_MAT_TRAITS_DEFAULTS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 969: #include namespace boost { namespace qvm { template struct mat_traits; namespace qvm_detail { template struct matrix_w { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename mat_traits::scalar_type & write_element_idx( int r, int c, A & a ) { return (I/mat_traits::cols)==r && (I%mat_traits::cols)==c? mat_traits::template write_element::cols,I%mat_traits::cols>(a) : matrix_w::write_element_idx(r,c,a); } }; template struct matrix_w { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename mat_traits::scalar_type & write_element_idx( int, int, A & a ) { BOOST_QVM_ASSERT(0); return mat_traits::template write_element<0,0>(a); } }; } template struct mat_traits_defaults { typedef MatType mat_type; typedef ScalarType scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( mat_type const & x ) { return mat_traits::template write_element(const_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int r, int c, mat_type const & x ) { return mat_traits::write_element_idx(r,c,const_cast(x)); } protected: static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL scalar_type & write_element_idx( int r, int c, mat_type & m ) { return qvm_detail::matrix_w<0,mat_traits::rows*mat_traits::cols>::write_element_idx(r,c,m); } }; } } #endif // <<< #include #line 11 "boost/qvm/lite.hpp" // Expanded at line 7675: #include // >>> #include #line 1 "boost/qvm/mat.hpp" #ifndef BOOST_QVM_MAT_HPP_INCLUDED #define BOOST_QVM_MAT_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 123: #include // Expanded at line 969: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct mat { T a[Rows][Cols]; template = 201103L , class = typename enable_if >::type #endif > operator R() const { R r; assign(r,*this); return r; } }; template struct mat_traits; template struct mat_traits< mat > { typedef mat this_matrix; typedef T scalar_type; static int const rows=Rows; static int const cols=Cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col #line 13 "boost/qvm/lite.hpp" // Expanded at line 7555: #include // >>> #include #line 1 "boost/qvm/quat_operations.hpp" #ifndef BOOST_QVM_QUAT_OPERATIONS #define BOOST_QVM_QUAT_OPERATIONS // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/detail/quat_assign.hpp" #ifndef BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED #define BOOST_QVM_DETAIL_QUAT_ASSIGN_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 1016: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_quat::value, A &>::type assign( A & a, B const & b ) { write_quat_element<0>(a,quat_traits::template read_element<0>(b)); write_quat_element<1>(a,quat_traits::template read_element<1>(b)); write_quat_element<2>(a,quat_traits::template read_element<2>(b)); write_quat_element<3>(a,quat_traits::template read_element<3>(b)); return a; } } } #endif // <<< #include #line 10 "boost/qvm/quat_operations.hpp" // >>> #include #line 1 "boost/qvm/deduce_quat.hpp" #ifndef BOOST_QVM_DEDUCE_QUAT_HPP_INCLUDED #define BOOST_QVM_DEDUCE_QUAT_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 996: #include // Expanded at line 1016: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct quat; namespace qvm_detail { template ::scalar_type> struct deduce_q_default { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef quat::scalar_type> type; }; template struct deduce_q_default { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef Q type; }; } template ::scalar_type> struct deduce_quat { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef typename qvm_detail::deduce_q_default::type type; }; namespace qvm_detail { template ::value, bool IsScalarB=is_scalar::value> struct deduce_q2_default { typedef quat type; }; template struct deduce_q2_default { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef Q type; }; template struct deduce_q2_default { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef typename deduce_quat::type type; }; template struct deduce_q2_default { BOOST_QVM_STATIC_ASSERT(is_quat::value); typedef typename deduce_quat::type type; }; } template ::type,typename scalar::type>::type> struct deduce_quat2 { BOOST_QVM_STATIC_ASSERT(is_quat::value || is_quat::value); typedef typename qvm_detail::deduce_q2_default::type type; }; } } #endif // <<< #include #line 11 "boost/qvm/quat_operations.hpp" // Expanded at line 349: #include // Expanded at line 1006: #include // Expanded at line 7555: #include // Expanded at line 969: #include // Expanded at line 25: #include // Expanded at line 1673: #include // Expanded at line 62: #include namespace boost { namespace qvm { namespace qvm_detail { BOOST_QVM_INLINE_CRITICAL void const * get_valid_ptr_quat_operations() { static int const obj=0; return &obj; } } //////////////////////////////////////////////// namespace msvc_parse_bug_workaround { template struct quats { static bool const value=is_quat::value && is_quat::value; }; } template inline typename enable_if_c< is_quat::value, std::string>::type to_string( A const & a ) { using namespace qvm_to_string_detail; return '('+ to_string(quat_traits::template read_element<0>(a))+','+ to_string(quat_traits::template read_element<1>(a))+','+ to_string(quat_traits::template read_element<2>(a))+','+ to_string(quat_traits::template read_element<3>(a))+')'; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_quat::value, bool>::type cmp( A const & a, B const & b, Cmp f ) { typedef typename quat_traits::scalar_type T; typedef typename quat_traits::scalar_type U; T q1[4] = { quat_traits::template read_element<0>(a), quat_traits::template read_element<1>(a), quat_traits::template read_element<2>(a), quat_traits::template read_element<3>(a) }; U q2[4] = { quat_traits::template read_element<0>(b), quat_traits::template read_element<1>(b), quat_traits::template read_element<2>(b), quat_traits::template read_element<3>(b) }; int i=0; for( ; i!=4; ++i ) if( !f(q1[i],q2[i]) ) break; if( i==4 ) return true; for( i=0; i!=4; ++i ) if( !f(q1[i],-q2[i]) ) return false; return true; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_quat::value && is_quat::value, R>::type convert_to( A const & a ) { R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)); write_quat_element<1>(r,quat_traits::template read_element<1>(a)); write_quat_element<2>(r,quat_traits::template read_element<2>(a)); write_quat_element<3>(r,quat_traits::template read_element<3>(a)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_mat::value && mat_traits::rows==3 && mat_traits::cols==3, R>::type convert_to( A const & a ) { typedef typename mat_traits::scalar_type T; T const mat[3][3] = { { mat_traits::template read_element<0,0>(a), mat_traits::template read_element<0,1>(a), mat_traits::template read_element<0,2>(a) }, { mat_traits::template read_element<1,0>(a), mat_traits::template read_element<1,1>(a), mat_traits::template read_element<1,2>(a) }, { mat_traits::template read_element<2,0>(a), mat_traits::template read_element<2,1>(a), mat_traits::template read_element<2,2>(a) } }; R r; if( mat[0][0]+mat[1][1]+mat[2][2] > scalar_traits::value(0) ) { T t = mat[0][0] + mat[1][1] + mat[2][2] + scalar_traits::value(1); T s = (scalar_traits::value(1)/sqrt(t))/2; write_quat_element<0>(r,s*t); write_quat_element<1>(r,(mat[2][1]-mat[1][2])*s); write_quat_element<2>(r,(mat[0][2]-mat[2][0])*s); write_quat_element<3>(r,(mat[1][0]-mat[0][1])*s); } else if( mat[0][0]>mat[1][1] && mat[0][0]>mat[2][2] ) { T t = mat[0][0] - mat[1][1] - mat[2][2] + scalar_traits::value(1); T s = (scalar_traits::value(1)/sqrt(t))/2; write_quat_element<0>(r,(mat[2][1]-mat[1][2])*s); write_quat_element<1>(r,s*t); write_quat_element<2>(r,(mat[1][0]+mat[0][1])*s); write_quat_element<3>(r,(mat[0][2]+mat[2][0])*s); } else if( mat[1][1]>mat[2][2] ) { T t = - mat[0][0] + mat[1][1] - mat[2][2] + scalar_traits::value(1); T s = (scalar_traits::value(1)/sqrt(t))/2; write_quat_element<0>(r,(mat[0][2]-mat[2][0])*s); write_quat_element<1>(r,(mat[1][0]+mat[0][1])*s); write_quat_element<2>(r,s*t); write_quat_element<3>(r,(mat[2][1]+mat[1][2])*s); } else { T t = - mat[0][0] - mat[1][1] + mat[2][2] + scalar_traits::value(1); T s = (scalar_traits::value(1)/sqrt(t))/2; write_quat_element<0>(r,(mat[1][0]-mat[0][1])*s); write_quat_element<1>(r,(mat[0][2]+mat[2][0])*s); write_quat_element<2>(r,(mat[2][1]+mat[1][2])*s); write_quat_element<3>(r,s*t); } return r; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value, deduce_quat >::type conjugate( A const & a ) { typedef typename deduce_quat::type R; R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)); write_quat_element<1>(r,-quat_traits::template read_element<1>(a)); write_quat_element<2>(r,-quat_traits::template read_element<2>(a)); write_quat_element<3>(r,-quat_traits::template read_element<3>(a)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template class identity_quat_ { identity_quat_( identity_quat_ const & ); identity_quat_ & operator=( identity_quat_ const & ); ~identity_quat_(); public: template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct quat_traits< qvm_detail::identity_quat_ > { typedef qvm_detail::identity_quat_ this_quaternion; typedef T scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return scalar_traits::value(I==0); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_quaternion const & ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i<4); return scalar_traits::value(i==0); } }; template struct deduce_quat< qvm_detail::identity_quat_ > { typedef quat type; }; template struct deduce_quat2< qvm_detail::identity_quat_, qvm_detail::identity_quat_ > { typedef quat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::identity_quat_ const & identity_quat() { return *(qvm_detail::identity_quat_ const *)qvm_detail::get_valid_ptr_quat_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type set_identity( A & a ) { typedef typename quat_traits::scalar_type T; T const zero=scalar_traits::value(0); T const one=scalar_traits::value(1); write_quat_element<0>(a,one); write_quat_element<1>(a,zero); write_quat_element<2>(a,zero); write_quat_element<3>(a,zero); } //////////////////////////////////////////////// namespace qvm_detail { template class quaternion_scalar_cast_ { quaternion_scalar_cast_( quaternion_scalar_cast_ const & ); quaternion_scalar_cast_ & operator=( quaternion_scalar_cast_ const & ); ~quaternion_scalar_cast_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL quaternion_scalar_cast_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct scalar_cast_quaternion_filter { }; template <> struct scalar_cast_quaternion_filter { typedef int type; }; } template struct quat_traits< qvm_detail::quaternion_scalar_cast_ > { typedef Scalar scalar_type; typedef qvm_detail::quaternion_scalar_cast_ this_quaternion; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return scalar_type(quat_traits::template read_element(reinterpret_cast(x))); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_quaternion const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i<4); return scalar_type(quat_traits::read_element_idx(i,reinterpret_cast(x))); } }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::quaternion_scalar_cast_ const & scalar_cast( T const & x, typename qvm_detail::scalar_cast_quaternion_filter::value>::type=0 ) { return reinterpret_cast const &>(x); } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_quat_element<0>(a,quat_traits::template read_element<0>(a)/b); write_quat_element<1>(a,quat_traits::template read_element<1>(a)/b); write_quat_element<2>(a,quat_traits::template read_element<2>(a)/b); write_quat_element<3>(a,quat_traits::template read_element<3>(a)/b); return a; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_scalar::value, deduce_quat2 >::type operator/( A const & a, B b ) { typedef typename deduce_quat2::type R; R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)/b); write_quat_element<1>(r,quat_traits::template read_element<1>(a)/b); write_quat_element<2>(r,quat_traits::template read_element<2>(a)/b); write_quat_element<3>(r,quat_traits::template read_element<3>(a)/b); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value, deduce_scalar::scalar_type,typename quat_traits::scalar_type> >::type dot( A const & a, B const & b ) { typedef typename quat_traits::scalar_type Ta; typedef typename quat_traits::scalar_type Tb; typedef typename deduce_scalar::type Tr; Ta const a0=quat_traits::template read_element<0>(a); Ta const a1=quat_traits::template read_element<1>(a); Ta const a2=quat_traits::template read_element<2>(a); Ta const a3=quat_traits::template read_element<3>(a); Tb const b0=quat_traits::template read_element<0>(b); Tb const b1=quat_traits::template read_element<1>(b); Tb const b2=quat_traits::template read_element<2>(b); Tb const b3=quat_traits::template read_element<3>(b); Tr const dp=a0*b0+a1*b1+a2*b2+a3*b3; return dp; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_quat::value, bool>::type operator==( A const & a, B const & b ) { return quat_traits::template read_element<0>(a)==quat_traits::template read_element<0>(b) && quat_traits::template read_element<1>(a)==quat_traits::template read_element<1>(b) && quat_traits::template read_element<2>(a)==quat_traits::template read_element<2>(b) && quat_traits::template read_element<3>(a)==quat_traits::template read_element<3>(b); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value, deduce_quat >::type inverse( A const & a ) { typedef typename deduce_quat::type R; typedef typename quat_traits::scalar_type TA; TA aa = quat_traits::template read_element<0>(a); TA ab = quat_traits::template read_element<1>(a); TA ac = quat_traits::template read_element<2>(a); TA ad = quat_traits::template read_element<3>(a); TA m2 = ab*ab + ac*ac + ad*ad + aa*aa; if( m2==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); TA rm=scalar_traits::value(1)/m2; R r; write_quat_element<0>(r,aa*rm); write_quat_element<1>(r,-ab*rm); write_quat_element<2>(r,-ac*rm); write_quat_element<3>(r,-ad*rm); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, typename quat_traits::scalar_type>::type mag_sqr( A const & a ) { typedef typename quat_traits::scalar_type T; T x=quat_traits::template read_element<0>(a); T y=quat_traits::template read_element<1>(a); T z=quat_traits::template read_element<2>(a); T w=quat_traits::template read_element<3>(a); return x*x+y*y+z*z+w*w; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, typename quat_traits::scalar_type>::type mag( A const & a ) { typedef typename quat_traits::scalar_type T; T x=quat_traits::template read_element<0>(a); T y=quat_traits::template read_element<1>(a); T z=quat_traits::template read_element<2>(a); T w=quat_traits::template read_element<3>(a); return sqrt(x*x+y*y+z*z+w*w); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if< msvc_parse_bug_workaround::quats, A &>::type operator-=( A & a, B const & b ) { write_quat_element<0>(a,quat_traits::template read_element<0>(a)-quat_traits::template read_element<0>(b)); write_quat_element<1>(a,quat_traits::template read_element<1>(a)-quat_traits::template read_element<1>(b)); write_quat_element<2>(a,quat_traits::template read_element<2>(a)-quat_traits::template read_element<2>(b)); write_quat_element<3>(a,quat_traits::template read_element<3>(a)-quat_traits::template read_element<3>(b)); return a; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value, deduce_quat2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_quat2::type R; R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)-quat_traits::template read_element<0>(b)); write_quat_element<1>(r,quat_traits::template read_element<1>(a)-quat_traits::template read_element<1>(b)); write_quat_element<2>(r,quat_traits::template read_element<2>(a)-quat_traits::template read_element<2>(b)); write_quat_element<3>(r,quat_traits::template read_element<3>(a)-quat_traits::template read_element<3>(b)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value, deduce_quat >::type operator-( A const & a ) { typedef typename deduce_quat::type R; R r; write_quat_element<0>(r,-quat_traits::template read_element<0>(a)); write_quat_element<1>(r,-quat_traits::template read_element<1>(a)); write_quat_element<2>(r,-quat_traits::template read_element<2>(a)); write_quat_element<3>(r,-quat_traits::template read_element<3>(a)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if< msvc_parse_bug_workaround::quats, A &>::type operator*=( A & a, B const & b ) { typedef typename quat_traits::scalar_type TA; typedef typename quat_traits::scalar_type TB; TA const aa=quat_traits::template read_element<0>(a); TA const ab=quat_traits::template read_element<1>(a); TA const ac=quat_traits::template read_element<2>(a); TA const ad=quat_traits::template read_element<3>(a); TB const ba=quat_traits::template read_element<0>(b); TB const bb=quat_traits::template read_element<1>(b); TB const bc=quat_traits::template read_element<2>(b); TB const bd=quat_traits::template read_element<3>(b); write_quat_element<0>(a,aa*ba - ab*bb - ac*bc - ad*bd); write_quat_element<1>(a,aa*bb + ab*ba + ac*bd - ad*bc); write_quat_element<2>(a,aa*bc + ac*ba + ad*bb - ab*bd); write_quat_element<3>(a,aa*bd + ad*ba + ab*bc - ac*bb); return a; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_quat_element<0>(a, quat_traits::template read_element<0>(a)*b); write_quat_element<1>(a, quat_traits::template read_element<1>(a)*b); write_quat_element<2>(a, quat_traits::template read_element<2>(a)*b); write_quat_element<3>(a, quat_traits::template read_element<3>(a)*b); return a; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value, deduce_quat2 >::type operator*( A const & a, B const & b ) { typedef typename deduce_quat2::type R; typedef typename quat_traits::scalar_type TA; typedef typename quat_traits::scalar_type TB; TA const aa=quat_traits::template read_element<0>(a); TA const ab=quat_traits::template read_element<1>(a); TA const ac=quat_traits::template read_element<2>(a); TA const ad=quat_traits::template read_element<3>(a); TB const ba=quat_traits::template read_element<0>(b); TB const bb=quat_traits::template read_element<1>(b); TB const bc=quat_traits::template read_element<2>(b); TB const bd=quat_traits::template read_element<3>(b); R r; write_quat_element<0>(r,aa*ba - ab*bb - ac*bc - ad*bd); write_quat_element<1>(r,aa*bb + ab*ba + ac*bd - ad*bc); write_quat_element<2>(r,aa*bc + ac*ba + ad*bb - ab*bd); write_quat_element<3>(r,aa*bd + ad*ba + ab*bc - ac*bb); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c2< is_quat::value && is_scalar::value, deduce_quat2 >::type operator*( A const & a, B b ) { typedef typename deduce_quat2::type R; R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)*b); write_quat_element<1>(r,quat_traits::template read_element<1>(a)*b); write_quat_element<2>(r,quat_traits::template read_element<2>(a)*b); write_quat_element<3>(r,quat_traits::template read_element<3>(a)*b); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_quat::value, bool>::type operator!=( A const & a, B const & b ) { return quat_traits::template read_element<0>(a)!=quat_traits::template read_element<0>(b) || quat_traits::template read_element<1>(a)!=quat_traits::template read_element<1>(b) || quat_traits::template read_element<2>(a)!=quat_traits::template read_element<2>(b) || quat_traits::template read_element<3>(a)!=quat_traits::template read_element<3>(b); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value, deduce_quat >::type normalized( A const & a ) { typedef typename quat_traits::scalar_type T; T const a0=quat_traits::template read_element<0>(a); T const a1=quat_traits::template read_element<1>(a); T const a2=quat_traits::template read_element<2>(a); T const a3=quat_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; 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_quat::type R; R r; write_quat_element<0>(r,a0*rm); write_quat_element<1>(r,a1*rm); write_quat_element<2>(r,a2*rm); write_quat_element<3>(r,a3*rm); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type normalize( A & a ) { typedef typename quat_traits::scalar_type T; T const a0=quat_traits::template read_element<0>(a); T const a1=quat_traits::template read_element<1>(a); T const a2=quat_traits::template read_element<2>(a); T const a3=quat_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; if( m2==scalar_traits::scalar_type>::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const rm=scalar_traits::value(1)/sqrt(m2); write_quat_element<0>(a,quat_traits::template read_element<0>(a)*rm); write_quat_element<1>(a,quat_traits::template read_element<1>(a)*rm); write_quat_element<2>(a,quat_traits::template read_element<2>(a)*rm); write_quat_element<3>(a,quat_traits::template read_element<3>(a)*rm); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if< msvc_parse_bug_workaround::quats, A &>::type operator+=( A & a, B const & b ) { write_quat_element<0>(a,quat_traits::template read_element<0>(a)+quat_traits::template read_element<0>(b)); write_quat_element<1>(a,quat_traits::template read_element<1>(a)+quat_traits::template read_element<1>(b)); write_quat_element<2>(a,quat_traits::template read_element<2>(a)+quat_traits::template read_element<2>(b)); write_quat_element<3>(a,quat_traits::template read_element<3>(a)+quat_traits::template read_element<3>(b)); return a; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value, deduce_quat2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_quat2::type R; R r; write_quat_element<0>(r,quat_traits::template read_element<0>(a)+quat_traits::template read_element<0>(b)); write_quat_element<1>(r,quat_traits::template read_element<1>(a)+quat_traits::template read_element<1>(b)); write_quat_element<2>(r,quat_traits::template read_element<2>(a)+quat_traits::template read_element<2>(b)); write_quat_element<3>(r,quat_traits::template read_element<3>(a)+quat_traits::template read_element<3>(b)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value && is_scalar::value, deduce_quat2 >::type slerp360( A const & a, B const & b, C t ) { typedef typename deduce_quat2::type R; typedef typename quat_traits::scalar_type TR; TR const one = scalar_traits::value(1); TR const threshold = one - one / scalar_traits::value(2000); //0.9995 TR const dp = dot(a,b); TR const abs_dp = abs(dp); if( abs_dp > threshold ) return a*(one-t) + b*t; TR const th = acos(dp); TR const invsinth = one / sin(th); return a * (sin(th * (one-t)) * invsinth) + b * (sin(th * t) * invsinth); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value && is_scalar::value, deduce_quat2 >::type slerp180( A const & a, B const & b, C t ) { typedef typename deduce_quat2::type R; typedef typename quat_traits::scalar_type TR; TR const one = scalar_traits::value(1); TR const threshold = one - one / scalar_traits::value(2000); //0.9995 TR const dp = dot(a,b); TR const abs_dp = abs(dp); if( abs_dp > threshold ) return a*(one-t)*sign(dp) + b*t; TR const th = acos(abs_dp); TR const invsinth = one / sin(th); return a * (sin(th * (one-t)) * invsinth * sign(dp)) + b * (sin(th * t) * invsinth); } template BOOST_QVM_DEPRECATED("please use slerp180 or slerp360") BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_quat::value && is_scalar::value, deduce_quat2 >::type slerp( A const & a, B const & b, C t ) { return slerp360(a, b, t); } //////////////////////////////////////////////// namespace qvm_detail { template class qref_ { qref_( qref_ const & ); qref_ & operator=( qref_ const & ); ~qref_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qref_ & operator=( R const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct qref_write_traits; template struct qref_write_traits { typedef typename quat_traits::scalar_type scalar_type; typedef qvm_detail::qref_ this_quaternion; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_quaternion & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return quat_traits::template write_element(reinterpret_cast(x)); } }; template struct qref_write_traits { typedef typename quat_traits::scalar_type scalar_type; typedef qvm_detail::qref_ this_quaternion; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_quaternion & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); quat_traits::template write_element(reinterpret_cast(x), s); } }; } template struct quat_traits; template struct quat_traits< qvm_detail::qref_ >: qvm_detail::qref_write_traits { typedef typename quat_traits::scalar_type scalar_type; typedef qvm_detail::qref_ this_quaternion; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return quat_traits::template read_element(reinterpret_cast(x)); } }; template struct deduce_quat< qvm_detail::qref_ > { typedef quat::scalar_type> type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_quat::value, qvm_detail::qref_ const &>::type qref( Q const & a ) { return reinterpret_cast const &>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_quat::value, qvm_detail::qref_ &>::type qref( Q & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class zero_q_ { zero_q_( zero_q_ const & ); zero_q_ & operator=( zero_q_ const & ); ~zero_q_(); public: template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct quat_traits< qvm_detail::zero_q_ > { typedef qvm_detail::zero_q_ this_quaternion; typedef T scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return scalar_traits::value(0); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_quaternion const & ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i<4); return scalar_traits::value(0); } }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::zero_q_ const & zero_quat() { return *(qvm_detail::zero_q_ const *)qvm_detail::get_valid_ptr_quat_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type set_zero( A & a ) { typedef typename quat_traits::scalar_type T; T const zero=scalar_traits::value(0); write_quat_element<0>(a,zero); write_quat_element<1>(a,zero); write_quat_element<2>(a,zero); write_quat_element<3>(a,zero); } //////////////////////////////////////////////// namespace qvm_detail { template struct rot_quat_ { typedef typename vec_traits::scalar_type scalar_type; scalar_type a[4]; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE rot_quat_( V const & axis, Angle angle ) { scalar_type const x=vec_traits::template read_element<0>(axis); scalar_type const y=vec_traits::template read_element<1>(axis); scalar_type const z=vec_traits::template read_element<2>(axis); scalar_type const m2=x*x+y*y+z*z; if( m2==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); scalar_type const rm=scalar_traits::value(1)/sqrt(m2); angle/=2; scalar_type const s=sin(angle); a[0] = cos(angle); a[1] = rm*x*s; a[2] = rm*y*s; a[3] = rm*z*s; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct quat_traits< qvm_detail::rot_quat_ > { typedef qvm_detail::rot_quat_ this_quaternion; typedef typename this_quaternion::scalar_type scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return x.a[I]; } }; template struct deduce_quat< qvm_detail::rot_quat_ > { typedef quat::scalar_type> type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE typename enable_if_c< is_vec::value && vec_traits::dim==3, qvm_detail::rot_quat_ >::type rot_quat( A const & axis, Angle angle ) { return qvm_detail::rot_quat_(axis,angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_vec::value && vec_traits::dim==3, void>::type set_rot( A & a, B const & axis, Angle angle ) { assign(a,rot_quat(axis,angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_vec::value && vec_traits::dim==3, void>::type rotate( A & a, B const & axis, Angle angle ) { a *= rot_quat(axis,angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct rotx_quat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL rotx_quat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: rotx_quat_( rotx_quat_ const & ); rotx_quat_ & operator=( rotx_quat_ const & ); ~rotx_quat_(); }; template struct rotx_q_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(0); } }; template <> struct rotx_q_get<1> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle/2); } }; template <> struct rotx_q_get<0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle/2); } }; } template struct quat_traits< qvm_detail::rotx_quat_ > { typedef qvm_detail::rotx_quat_ this_quaternion; typedef Angle scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return qvm_detail::rotx_q_get::get(reinterpret_cast(x)); } }; template struct deduce_quat< qvm_detail::rotx_quat_ > { typedef quat type; }; template struct deduce_quat2< qvm_detail::rotx_quat_, qvm_detail::rotx_quat_ > { typedef quat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::rotx_quat_ const & rotx_quat( Angle const & angle ) { return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type set_rotx( A & a, Angle angle ) { assign(a,rotx_quat(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type rotate_x( A & a, Angle angle ) { a *= rotx_quat(angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct roty_quat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL roty_quat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: roty_quat_( roty_quat_ const & ); roty_quat_ & operator=( roty_quat_ const & ); ~roty_quat_(); }; template struct roty_q_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(0); } }; template <> struct roty_q_get<2> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle/2); } }; template <> struct roty_q_get<0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle/2); } }; } template struct quat_traits< qvm_detail::roty_quat_ > { typedef qvm_detail::roty_quat_ this_quaternion; typedef Angle scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return qvm_detail::roty_q_get::get(reinterpret_cast(x)); } }; template struct deduce_quat< qvm_detail::roty_quat_ > { typedef quat type; }; template struct deduce_quat2< qvm_detail::roty_quat_, qvm_detail::roty_quat_ > { typedef quat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::roty_quat_ const & roty_quat( Angle const & angle ) { return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type set_roty( A & a, Angle angle ) { assign(a,roty_quat(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type rotate_y( A & a, Angle angle ) { a *= roty_quat(angle); } //////////////////////////////////////////////// namespace qvm_detail { template struct rotz_quat_ { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL rotz_quat_() { } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } private: rotz_quat_( rotz_quat_ const & ); rotz_quat_ & operator=( rotz_quat_ const & ); ~rotz_quat_(); }; template struct rotz_q_get { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & ) { return scalar_traits::value(0); } }; template <> struct rotz_q_get<3> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return sin(angle/2); } }; template <> struct rotz_q_get<0> { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL T get( T const & angle ) { return cos(angle/2); } }; } template struct quat_traits< qvm_detail::rotz_quat_ > { typedef qvm_detail::rotz_quat_ this_quaternion; typedef Angle scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return qvm_detail::rotz_q_get::get(reinterpret_cast(x)); } }; template struct deduce_quat< qvm_detail::rotz_quat_ > { typedef quat type; }; template struct deduce_quat2< qvm_detail::rotz_quat_, qvm_detail::rotz_quat_ > { typedef quat type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::rotz_quat_ const & rotz_quat( Angle const & angle ) { return reinterpret_cast const &>(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type set_rotz( A & a, Angle angle ) { assign(a,rotz_quat(angle)); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value, void>::type rotate_z( A & a, Angle angle ) { a *= rotz_quat(angle); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_quat::value && is_vec::value && vec_traits::dim==3, typename quat_traits::scalar_type>::type axis_angle( A const & a, B & b ) { typedef typename quat_traits::scalar_type T; T a0=quat_traits::template read_element<0>(a); T a1=quat_traits::template read_element<1>(a); T a2=quat_traits::template read_element<2>(a); T a3=quat_traits::template read_element<3>(a); if( a0>1 ) { T const m2=a0*a0+a1*a1+a2*a2+a3*a3; if( m2==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const s=sqrt(m2); a0/=s; a1/=s; a2/=s; a3/=s; } if( T s=sqrt(1-a0*a0) ) { write_vec_element<0>(b, a1/s); write_vec_element<1>(b, a2/s); write_vec_element<2>(b, a3/s); } else { typedef typename vec_traits::scalar_type U; write_vec_element<0>(b, scalar_traits::value(1)); write_vec_element<1>(b, scalar_traits::value(0)); write_vec_element<2>(b, scalar_traits::value(0)); } return scalar_traits::value(2) * qvm::acos(a0); } //////////////////////////////////////////////// namespace sfinae { using ::boost::qvm::assign; using ::boost::qvm::cmp; using ::boost::qvm::convert_to; using ::boost::qvm::conjugate; using ::boost::qvm::set_identity; using ::boost::qvm::set_zero; using ::boost::qvm::scalar_cast; using ::boost::qvm::operator/=; using ::boost::qvm::operator/; using ::boost::qvm::dot; using ::boost::qvm::operator==; using ::boost::qvm::inverse; using ::boost::qvm::mag_sqr; using ::boost::qvm::mag; using ::boost::qvm::slerp360; using ::boost::qvm::slerp180; using ::boost::qvm::slerp; using ::boost::qvm::operator-=; using ::boost::qvm::operator-; using ::boost::qvm::operator*=; using ::boost::qvm::operator*; using ::boost::qvm::operator!=; using ::boost::qvm::normalized; using ::boost::qvm::normalize; using ::boost::qvm::operator+=; using ::boost::qvm::operator+; using ::boost::qvm::qref; using ::boost::qvm::rot_quat; using ::boost::qvm::set_rot; using ::boost::qvm::rotate; using ::boost::qvm::rotx_quat; using ::boost::qvm::set_rotx; using ::boost::qvm::rotate_x; using ::boost::qvm::roty_quat; using ::boost::qvm::set_roty; using ::boost::qvm::rotate_y; using ::boost::qvm::rotz_quat; using ::boost::qvm::set_rotz; using ::boost::qvm::rotate_z; } } } #endif // <<< #include #line 15 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/quat_access.hpp" #ifndef BOOST_QVM_QUAT_ACCESS_HPP_INCLUDED #define BOOST_QVM_QUAT_ACCESS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 1016: #include // Expanded at line 1572: #include // Expanded at line 1292: #include // Expanded at line 218: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename quat_traits::scalar_type>::type S( Q const & a ) { return quat_traits::template read_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename quat_traits::scalar_type>::type X( Q const & a ) { return quat_traits::template read_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename quat_traits::scalar_type>::type Y( Q const & a ) { return quat_traits::template read_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename quat_traits::scalar_type>::type Z( Q const & a ) { return quat_traits::template read_element<3>(a); } namespace qvm_detail { template struct q_element_access { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void operator=( typename quat_traits::scalar_type s ) { quat_traits::template write_element(*reinterpret_cast(this), s); } BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL operator typename vec_traits::scalar_type() const { return quat_traits::template read_element(*reinterpret_cast(this)); } }; template struct quat_v_ { template = 201103L , class = typename enable_if >::type #endif > operator R() const { R r; assign(r,*this); return r; } private: quat_v_( quat_v_ const & ); quat_v_ const & operator=( quat_v_ const & ); ~quat_v_(); }; template ::value> struct quat_v_write_traits; template struct quat_v_write_traits { typedef qvm_detail::quat_v_ this_vector; typedef typename quat_traits::scalar_type scalar_type; static int const dim=3; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL static scalar_type & write_element( this_vector & q ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element( reinterpret_cast(q) ); } }; template struct quat_v_write_traits { typedef qvm_detail::quat_v_ this_vector; typedef typename quat_traits::scalar_type scalar_type; static int const dim=3; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL static void write_element( this_vector & q, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element( reinterpret_cast(q), s ); } }; } template struct vec_traits; template struct vec_traits< qvm_detail::quat_v_ >: qvm_detail::quat_v_write_traits { typedef qvm_detail::quat_v_ this_vector; typedef typename quat_traits::scalar_type scalar_type; static int const dim=3; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL static scalar_type read_element( this_vector const & q ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element( reinterpret_cast(q) ); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template struct deduce_vec2,qvm_detail::quat_v_,D> { typedef vec::scalar_type,D> type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_quat::value, qvm_detail::quat_v_ const &>::type V( Q const & a ) { return reinterpret_cast const &>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_quat::value, qvm_detail::quat_v_ &>::type V( Q & a ) { return reinterpret_cast &>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && quat_write_element_ref::value,typename quat_traits::scalar_type &>::type S( Q & a ) { return quat_traits::template write_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && quat_write_element_ref::value,typename quat_traits::scalar_type &>::type X( Q & a ) { return quat_traits::template write_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && quat_write_element_ref::value,typename quat_traits::scalar_type &>::type Y( Q & a ) { return quat_traits::template write_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && quat_write_element_ref::value,typename quat_traits::scalar_type &>::type Z( Q & a ) { return quat_traits::template write_element<3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !quat_write_element_ref::value,qvm_detail::q_element_access<0,Q> &>::type S( Q & a ) { return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !quat_write_element_ref::value,qvm_detail::q_element_access<1,Q> &>::type X( Q & a ) { return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !quat_write_element_ref::value,qvm_detail::q_element_access<2,Q> &>::type Y( Q & a ) { return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !quat_write_element_ref::value,qvm_detail::q_element_access<3,Q> &>::type Z( Q & a ) { return *reinterpret_cast *>(&a); } } } #endif // <<< #include #line 16 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/quat_traits_defaults.hpp" #ifndef BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED #define BOOST_QVM_QUAT_TRAITS_DEFAULTS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 969: #include namespace boost { namespace qvm { template struct quat_traits; template struct quat_traits_defaults { typedef QuatType quat_type; typedef ScalarType scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( quat_type const & x ) { return quat_traits::template write_element(const_cast(x)); } }; } } #endif // <<< #include #line 17 "boost/qvm/lite.hpp" // Expanded at line 1016: #include // >>> #include #line 1 "boost/qvm/quat.hpp" #ifndef BOOST_QVM_QUAT_HPP_INCLUDED #define BOOST_QVM_QUAT_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 11384: #include // Expanded at line 969: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct quat { T a[4]; template = 201103L , class = typename enable_if >::type #endif > operator R() const { R r; assign(r,*this); return r; } }; template struct quat_traits; template struct quat_traits< quat > { typedef quat this_quaternion; typedef T scalar_type; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_quaternion const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return x.a[I]; } template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_quaternion & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I<4); return x.a[I]; } }; } } #endif // <<< #include #line 19 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/quat_vec_operations.hpp" #ifndef BOOST_QVM_QUAT_VEC_OPERATIONS_HPP_INCLUDED #define BOOST_QVM_QUAT_VEC_OPERATIONS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 1016: #include // Expanded at line 1572: #include // Expanded at line 145: #include // Expanded at line 218: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_quat::value && is_vec::value && vec_traits::dim==3, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename deduce_vec2::type R; typedef typename quat_traits::scalar_type TA; typedef typename vec_traits::scalar_type TB; TA const aa = quat_traits::template read_element<0>(a); TA const ab = quat_traits::template read_element<1>(a); TA const ac = quat_traits::template read_element<2>(a); TA const ad = quat_traits::template read_element<3>(a); TA const t2 = aa*ab; TA const t3 = aa*ac; TA const t4 = aa*ad; TA const t5 = -ab*ab; TA const t6 = ab*ac; TA const t7 = ab*ad; TA const t8 = -ac*ac; TA const t9 = ac*ad; TA const t10 = -ad*ad; TB const bx = vec_traits::template read_element<0>(b); TB const by = vec_traits::template read_element<1>(b); TB const bz = vec_traits::template read_element<2>(b); R r; write_vec_element<0>(r, 2*((t8+t10)*bx + (t6-t4)*by + (t3+t7)*bz) + bx); write_vec_element<1>(r, 2*((t4+t6)*bx + (t5+t10)*by + (t9-t2)*bz) + by); write_vec_element<2>(r, 2*((t7-t3)*bx + (t2+t9)*by + (t5+t8)*bz) + bz); return r; } namespace sfinae { using ::boost::qvm::operator*; } } } #endif // <<< #include #line 20 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_operations.hpp" #ifndef BOOST_QVM_VEC_OPERATIONS_HPP_INCLUDED #define BOOST_QVM_VEC_OPERATIONS_HPP_INCLUDED // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2019 agate-pris // 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) // >>> #include #line 1 "boost/qvm/detail/vec_assign.hpp" #ifndef BOOST_QVM_DETAIL_VEC_ASSIGN_HPP_INCLUDED #define BOOST_QVM_DETAIL_VEC_ASSIGN_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_assign2.hpp" #ifndef BOOST_QVM_GEN_VEC_ASSIGN2_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_ASSIGN2_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, A &>::type assign( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_vv_defined; template <> struct assign_vv_defined<2> { static bool const value=true; }; } } } #endif // <<< #include #line 10 "boost/qvm/detail/vec_assign.hpp" // >>> #include #line 1 "boost/qvm/gen/vec_assign3.hpp" #ifndef BOOST_QVM_GEN_VEC_ASSIGN3_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_ASSIGN3_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type assign( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(b)); write_vec_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; }; } } } #endif // <<< #include #line 11 "boost/qvm/detail/vec_assign.hpp" // >>> #include #line 1 "boost/qvm/gen/vec_assign4.hpp" #ifndef BOOST_QVM_GEN_VEC_ASSIGN4_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_ASSIGN4_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 218: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, A &>::type assign( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(b)); write_vec_element<2>(a,vec_traits::template read_element<2>(b)); write_vec_element<3>(a,vec_traits::template read_element<3>(b)); return a; } namespace sfinae { using ::boost::qvm::assign; } namespace qvm_detail { template struct assign_vv_defined; template <> struct assign_vv_defined<4> { static bool const value=true; }; } } } #endif // <<< #include #line 12 "boost/qvm/detail/vec_assign.hpp" namespace boost { namespace qvm { namespace qvm_detail { template struct assign_vv_defined { static bool const value=false; }; template struct copy_vector_elements { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< vec_write_element_ref::value, void>::type f( A & a, B const & b ) { vec_traits::template write_element(a) = vec_traits::template read_element(b); copy_vector_elements::f(a,b); } template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename enable_if_c< !vec_write_element_ref::value, void>::type f( A & a, B const & b ) { vec_traits::template write_element(a, vec_traits::template read_element(b)); copy_vector_elements::f(a,b); } }; template struct copy_vector_elements { template static void f( A &, B const & ) { } }; } template inline typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::assign_vv_defined::dim>::value, A &>::type assign( A & a, B const & b ) { qvm_detail::copy_vector_elements<0,vec_traits::dim>::f(a,b); return a; } } } #endif // <<< #include #line 11 "boost/qvm/vec_operations.hpp" // >>> #include #line 1 "boost/qvm/vec_operations2.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_operations2.hpp" #ifndef BOOST_QVM_GEN_VEC_OPERATIONS2_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_OPERATIONS2_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 996: #include // Expanded at line 1572: #include // Expanded at line 25: #include // Expanded at line 13462: #include // Expanded at line 7555: #include // Expanded at line 1292: #include // Expanded at line 1673: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, deduce_vec2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==2); R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_vv_defined; template <> struct plus_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, deduce_vec2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==2); R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_vv_defined; template <> struct minus_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, A &>::type operator+=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_vv_defined; template <> struct plus_eq_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, A &>::type operator-=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_vv_defined; template <> struct minus_eq_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2 && is_scalar::value, deduce_vec2::dim> >::type operator*( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)*b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vs_defined; template <> struct mul_vs_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && vec_traits::dim==2, deduce_vec2::dim> >::type operator*( A a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,a*vec_traits::template read_element<0>(b)); write_vec_element<1>(r,a*vec_traits::template read_element<1>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sv_defined; template <> struct mul_sv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)*b); write_vec_element<1>(a, vec_traits::template read_element<1>(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<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2 && is_scalar::value, deduce_vec2::dim> >::type operator/( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)/b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_vs_defined; template <> struct div_vs_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)/b); write_vec_element<1>(a, vec_traits::template read_element<1>(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<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==2 && vec_traits::dim==2, R>::type convert_to( A const & a ) { R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)); write_vec_element<1>(r,vec_traits::template read_element<1>(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<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, 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); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_vv_defined; template <> struct eq_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, 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)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_vv_defined; template <> struct neq_vv_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2, deduce_vec >::type operator-( A const & a ) { typedef typename deduce_vec::type R; R r; write_vec_element<0>(r,-vec_traits::template read_element<0>(a)); write_vec_element<1>(r,-vec_traits::template read_element<1>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_v_defined; template <> struct minus_v_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==2, 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 m2=a0*a0+a1*a1; 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<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==2, 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 m2=a0*a0+a1*a1; return m2; } namespace sfinae { using ::boost::qvm::mag_sqr; } namespace qvm_detail { template struct mag_sqr_v_defined; template <> struct mag_sqr_v_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2, 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 m2=a0*a0+a1*a1; 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; write_vec_element<0>(r,a0*rm); write_vec_element<1>(r,a1*rm); return r; } namespace sfinae { using ::boost::qvm::normalized; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==2, 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 m2=a0*a0+a1*a1; if( m2==scalar_traits::scalar_type>::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const rm=scalar_traits::value(1)/sqrt(m2); write_vec_element<0>(a,vec_traits::template read_element<0>(a)*rm); write_vec_element<1>(a,vec_traits::template read_element<1>(a)*rm); } namespace sfinae { using ::boost::qvm::normalize; } namespace qvm_detail { template struct normalize_v_defined; template <> struct normalize_v_defined<2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==2 && vec_traits::dim==2, 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); Tb const b0=vec_traits::template read_element<0>(b); Tb const b1=vec_traits::template read_element<1>(b); Tr const dot=a0*b0+a1*b1; return dot; } namespace sfinae { using ::boost::qvm::dot; } namespace qvm_detail { template struct dot_vv_defined; template <> struct dot_vv_defined<2> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/vec_operations2.hpp" // <<< #include #line 12 "boost/qvm/vec_operations.hpp" // >>> #include #line 1 "boost/qvm/vec_operations3.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_operations3.hpp" #ifndef BOOST_QVM_GEN_VEC_OPERATIONS3_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_OPERATIONS3_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 996: #include // Expanded at line 1572: #include // Expanded at line 25: #include // Expanded at line 13517: #include // Expanded at line 7555: #include // Expanded at line 1292: #include // Expanded at line 1673: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR 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; write_vec_element<0>(r,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); write_vec_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_CONSTEXPR 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; write_vec_element<0>(r,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); write_vec_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type operator+=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); write_vec_element<2>(a,vec_traits::template read_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && vec_traits::dim==3, A &>::type operator-=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); write_vec_element<2>(a,vec_traits::template read_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && is_scalar::value, deduce_vec2::dim> >::type operator*( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)*b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)*b); write_vec_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && vec_traits::dim==3, deduce_vec2::dim> >::type operator*( A a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,a*vec_traits::template read_element<0>(b)); write_vec_element<1>(r,a*vec_traits::template read_element<1>(b)); write_vec_element<2>(r,a*vec_traits::template read_element<2>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sv_defined; template <> struct mul_sv_defined<3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)*b); write_vec_element<1>(a, vec_traits::template read_element<1>(a)*b); write_vec_element<2>(a, vec_traits::template read_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==3 && is_scalar::value, deduce_vec2::dim> >::type operator/( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)/b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)/b); write_vec_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_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==3 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)/b); write_vec_element<1>(a, vec_traits::template read_element<1>(a)/b); write_vec_element<2>(a, vec_traits::template read_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_CONSTEXPR 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; write_vec_element<0>(r,vec_traits::template read_element<0>(a)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)); write_vec_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_CONSTEXPR 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_CONSTEXPR 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_CONSTEXPR 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; write_vec_element<0>(r,-vec_traits::template read_element<0>(a)); write_vec_element<1>(r,-vec_traits::template read_element<1>(a)); write_vec_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_CONSTEXPR 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_CONSTEXPR 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_CONSTEXPR 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; write_vec_element<0>(r,a0*rm); write_vec_element<1>(r,a1*rm); write_vec_element<2>(r,a2*rm); return r; } namespace sfinae { using ::boost::qvm::normalized; } template BOOST_QVM_CONSTEXPR 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); write_vec_element<0>(a,vec_traits::template read_element<0>(a)*rm); write_vec_element<1>(a,vec_traits::template read_element<1>(a)*rm); write_vec_element<2>(a,vec_traits::template read_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_CONSTEXPR 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 // <<< #include #line 7 "boost/qvm/vec_operations3.hpp" // <<< #include #line 13 "boost/qvm/vec_operations.hpp" // >>> #include #line 1 "boost/qvm/vec_operations4.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_operations4.hpp" #ifndef BOOST_QVM_GEN_VEC_OPERATIONS4_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_OPERATIONS4_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 996: #include // Expanded at line 1572: #include // Expanded at line 25: #include // Expanded at line 13573: #include // Expanded at line 7555: #include // Expanded at line 1292: #include // Expanded at line 1673: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, deduce_vec2 >::type operator+( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==4); R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); write_vec_element<2>(r,vec_traits::template read_element<2>(a)+vec_traits::template read_element<2>(b)); write_vec_element<3>(r,vec_traits::template read_element<3>(a)+vec_traits::template read_element<3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator+; } namespace qvm_detail { template struct plus_vv_defined; template <> struct plus_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, deduce_vec2 >::type operator-( A const & a, B const & b ) { typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==4); R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); write_vec_element<2>(r,vec_traits::template read_element<2>(a)-vec_traits::template read_element<2>(b)); write_vec_element<3>(r,vec_traits::template read_element<3>(a)-vec_traits::template read_element<3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_vv_defined; template <> struct minus_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, A &>::type operator+=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)+vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)+vec_traits::template read_element<1>(b)); write_vec_element<2>(a,vec_traits::template read_element<2>(a)+vec_traits::template read_element<2>(b)); write_vec_element<3>(a,vec_traits::template read_element<3>(a)+vec_traits::template read_element<3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator+=; } namespace qvm_detail { template struct plus_eq_vv_defined; template <> struct plus_eq_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, A &>::type operator-=( A & a, B const & b ) { write_vec_element<0>(a,vec_traits::template read_element<0>(a)-vec_traits::template read_element<0>(b)); write_vec_element<1>(a,vec_traits::template read_element<1>(a)-vec_traits::template read_element<1>(b)); write_vec_element<2>(a,vec_traits::template read_element<2>(a)-vec_traits::template read_element<2>(b)); write_vec_element<3>(a,vec_traits::template read_element<3>(a)-vec_traits::template read_element<3>(b)); return a; } namespace sfinae { using ::boost::qvm::operator-=; } namespace qvm_detail { template struct minus_eq_vv_defined; template <> struct minus_eq_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4 && is_scalar::value, deduce_vec2::dim> >::type operator*( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)*b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)*b); write_vec_element<2>(r,vec_traits::template read_element<2>(a)*b); write_vec_element<3>(r,vec_traits::template read_element<3>(a)*b); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vs_defined; template <> struct mul_vs_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && vec_traits::dim==4, deduce_vec2::dim> >::type operator*( A a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,a*vec_traits::template read_element<0>(b)); write_vec_element<1>(r,a*vec_traits::template read_element<1>(b)); write_vec_element<2>(r,a*vec_traits::template read_element<2>(b)); write_vec_element<3>(r,a*vec_traits::template read_element<3>(b)); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_sv_defined; template <> struct mul_sv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && is_scalar::value, A &>::type operator*=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)*b); write_vec_element<1>(a, vec_traits::template read_element<1>(a)*b); write_vec_element<2>(a, vec_traits::template read_element<2>(a)*b); write_vec_element<3>(a, vec_traits::template read_element<3>(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<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4 && is_scalar::value, deduce_vec2::dim> >::type operator/( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)/b); write_vec_element<1>(r,vec_traits::template read_element<1>(a)/b); write_vec_element<2>(r,vec_traits::template read_element<2>(a)/b); write_vec_element<3>(r,vec_traits::template read_element<3>(a)/b); return r; } namespace sfinae { using ::boost::qvm::operator/; } namespace qvm_detail { template struct div_vs_defined; template <> struct div_vs_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && is_scalar::value, A &>::type operator/=( A & a, B b ) { write_vec_element<0>(a, vec_traits::template read_element<0>(a)/b); write_vec_element<1>(a, vec_traits::template read_element<1>(a)/b); write_vec_element<2>(a, vec_traits::template read_element<2>(a)/b); write_vec_element<3>(a, vec_traits::template read_element<3>(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<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==4 && vec_traits::dim==4, R>::type convert_to( A const & a ) { R r; write_vec_element<0>(r,vec_traits::template read_element<0>(a)); write_vec_element<1>(r,vec_traits::template read_element<1>(a)); write_vec_element<2>(r,vec_traits::template read_element<2>(a)); write_vec_element<3>(r,vec_traits::template read_element<3>(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<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, 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) && vec_traits::template read_element<3>(a)==vec_traits::template read_element<3>(b); } namespace sfinae { using ::boost::qvm::operator==; } namespace qvm_detail { template struct eq_vv_defined; template <> struct eq_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, 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)) || !(vec_traits::template read_element<3>(a)==vec_traits::template read_element<3>(b)); } namespace sfinae { using ::boost::qvm::operator!=; } namespace qvm_detail { template struct neq_vv_defined; template <> struct neq_vv_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4, deduce_vec >::type operator-( A const & a ) { typedef typename deduce_vec::type R; R r; write_vec_element<0>(r,-vec_traits::template read_element<0>(a)); write_vec_element<1>(r,-vec_traits::template read_element<1>(a)); write_vec_element<2>(r,-vec_traits::template read_element<2>(a)); write_vec_element<3>(r,-vec_traits::template read_element<3>(a)); return r; } namespace sfinae { using ::boost::qvm::operator-; } namespace qvm_detail { template struct minus_v_defined; template <> struct minus_v_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==4, 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 a3=vec_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; 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<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && vec_traits::dim==4, 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 a3=vec_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; return m2; } namespace sfinae { using ::boost::qvm::mag_sqr; } namespace qvm_detail { template struct mag_sqr_v_defined; template <> struct mag_sqr_v_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4, 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 a3=vec_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; 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; write_vec_element<0>(r,a0*rm); write_vec_element<1>(r,a1*rm); write_vec_element<2>(r,a2*rm); write_vec_element<3>(r,a3*rm); return r; } namespace sfinae { using ::boost::qvm::normalized; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< vec_traits::dim==4, 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 a3=vec_traits::template read_element<3>(a); T const m2=a0*a0+a1*a1+a2*a2+a3*a3; if( m2==scalar_traits::scalar_type>::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T const rm=scalar_traits::value(1)/sqrt(m2); write_vec_element<0>(a,vec_traits::template read_element<0>(a)*rm); write_vec_element<1>(a,vec_traits::template read_element<1>(a)*rm); write_vec_element<2>(a,vec_traits::template read_element<2>(a)*rm); write_vec_element<3>(a,vec_traits::template read_element<3>(a)*rm); } namespace sfinae { using ::boost::qvm::normalize; } namespace qvm_detail { template struct normalize_v_defined; template <> struct normalize_v_defined<4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< vec_traits::dim==4 && vec_traits::dim==4, 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); Ta const a3=vec_traits::template read_element<3>(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); Tb const b3=vec_traits::template read_element<3>(b); Tr const dot=a0*b0+a1*b1+a2*b2+a3*b3; return dot; } namespace sfinae { using ::boost::qvm::dot; } namespace qvm_detail { template struct dot_vv_defined; template <> struct dot_vv_defined<4> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/vec_operations4.hpp" // <<< #include #line 14 "boost/qvm/vec_operations.hpp" // Expanded at line 969: #include // Expanded at line 1006: #include // Expanded at line 62: #include namespace boost { namespace qvm { namespace qvm_detail { BOOST_QVM_INLINE_CRITICAL void const * get_valid_ptr_vec_operations() { static int const obj=0; return &obj; } } //////////////////////////////////////////////// namespace qvm_detail { template struct to_string_v_defined { static bool const value=false; }; template struct to_string_vector_elements { template static std::string f( A const & a ) { using namespace qvm_to_string_detail; return to_string(vec_traits::template read_element(a))+','+to_string_vector_elements::f(a); } }; template struct to_string_vector_elements { template static std::string f( A const & a ) { using namespace qvm_to_string_detail; return to_string(vec_traits::template read_element(a)); } }; } template inline typename enable_if_c< is_vec::value && !qvm_detail::to_string_v_defined::dim>::value, std::string>::type to_string( A const & a ) { return '('+qvm_detail::to_string_vector_elements<0,vec_traits::dim-1>::f(a)+')'; } //////////////////////////////////////////////// namespace qvm_detail { template struct convert_to_v_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::convert_to_v_defined::dim>::value, R>::type convert_to( A const & a ) { R r; assign(r,a); return r; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==3 && vec_traits::dim==3, deduce_vec2 >::type cross( A const & a, B const & b ) { typedef typename deduce_vec2::type R; R r; write_vec_element<0>(r, vec_traits::template read_element<1>(a)*vec_traits::template read_element<2>(b)- vec_traits::template read_element<2>(a)*vec_traits::template read_element<1>(b)); write_vec_element<1>(r, vec_traits::template read_element<2>(a)*vec_traits::template read_element<0>(b)- vec_traits::template read_element<0>(a)*vec_traits::template read_element<2>(b)); write_vec_element<2>(r, vec_traits::template read_element<0>(a)*vec_traits::template read_element<1>(b)- vec_traits::template read_element<1>(a)*vec_traits::template read_element<0>(b)); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==2 && vec_traits::dim==2, deduce_scalar::scalar_type,typename vec_traits::scalar_type> >::type cross( A const & a, B const & b ) { typedef typename deduce_scalar::scalar_type,typename vec_traits::scalar_type>::type R; R const r = vec_traits::template read_element<0>(a)*vec_traits::template read_element<1>(b)- vec_traits::template read_element<1>(a)*vec_traits::template read_element<0>(b); return r; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim, bool>::type cmp( A const & a, B const & b, Cmp f ) { for( int i=0; i!=vec_traits::dim; ++i ) if( !f( vec_traits::read_element_idx(i,a), vec_traits::read_element_idx(i,b)) ) return false; return true; } //////////////////////////////////////////////// namespace qvm_detail { template class zero_vec_ { zero_vec_( zero_vec_ const & ); zero_vec_ & operator=( zero_vec_ const & ); ~zero_vec_(); public: template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct vec_traits; template struct vec_traits< qvm_detail::zero_vec_ > { typedef qvm_detail::zero_vec_ this_vector; typedef T scalar_type; static int const dim=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::value(0); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::value(0); } }; template struct deduce_vec,D> { typedef vec type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::zero_vec_ const & zero_vec() { return *(qvm_detail::zero_vec_ const *)qvm_detail::get_valid_ptr_vec_operations(); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value, void>::type set_zero( A & a ) { assign(a,zero_vec::scalar_type,vec_traits::dim>()); } //////////////////////////////////////////////// namespace qvm_detail { template class vector_scalar_cast_ { vector_scalar_cast_( vector_scalar_cast_ const & ); vector_scalar_cast_ & operator=( vector_scalar_cast_ const & ); ~vector_scalar_cast_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL vector_scalar_cast_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct scalar_cast_vector_filter { }; template <> struct scalar_cast_vector_filter { typedef int type; }; } template struct vec_traits< qvm_detail::vector_scalar_cast_ > { typedef Scalar scalar_type; typedef qvm_detail::vector_scalar_cast_ this_vector; static int const dim=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x))); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(i,reinterpret_cast(x))); } }; template struct deduce_vec,D> { typedef vec type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL qvm_detail::vector_scalar_cast_ const & scalar_cast( T const & x, typename qvm_detail::scalar_cast_vector_filter::value>::type=0 ) { return reinterpret_cast const &>(x); } //////////////////////////////////////////////// namespace qvm_detail { template struct div_eq_vs_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_scalar::value && !qvm_detail::div_eq_vs_defined::dim>::value, A &>::type operator/=( A & a, B b ) { for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,a,vec_traits::read_element_idx(i,a)/b); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct div_vs_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_scalar::value && !qvm_detail::div_vs_defined::dim>::value, deduce_vec2::dim> >::type operator/( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,vec_traits::read_element_idx(i,a)/b); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct dot_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::dot_vv_defined::dim>::value, deduce_scalar::scalar_type,typename vec_traits::scalar_type> >::type dot( A const & a, B const & b ) { typedef typename deduce_scalar::scalar_type,typename vec_traits::scalar_type>::type T; T m(scalar_traits::value(0)); for( int i=0; i!=vec_traits::dim; ++i ) m+=vec_traits::read_element_idx(i,a)*vec_traits::read_element_idx(i,b); return m; } //////////////////////////////////////////////// namespace qvm_detail { template struct eq_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::eq_vv_defined::dim>::value, bool>::type operator==( A const & a, B const & b ) { for( int i=0; i!=vec_traits::dim; ++i ) if( vec_traits::read_element_idx(i,a)!=vec_traits::read_element_idx(i,b) ) return false; return true; } //////////////////////////////////////////////// namespace qvm_detail { template struct mag_sqr_v_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && !qvm_detail::mag_sqr_v_defined::dim>::value, typename vec_traits::scalar_type>::type mag_sqr( A const & a ) { typedef typename vec_traits::scalar_type T; T m(scalar_traits::value(0)); for( int i=0; i!=vec_traits::dim; ++i ) { T x=vec_traits::read_element_idx(i,a); m+=x*x; } return m; } //////////////////////////////////////////////// namespace qvm_detail { template struct mag_v_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && !qvm_detail::mag_v_defined::dim>::value, typename vec_traits::scalar_type>::type mag( A const & a ) { typedef typename vec_traits::scalar_type T; T m(scalar_traits::value(0)); for( int i=0; i!=vec_traits::dim; ++i ) { T x=vec_traits::read_element_idx(i,a); m+=x*x; } return sqrt(m); } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_eq_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::minus_eq_vv_defined::dim>::value, A &>::type operator-=( A & a, B const & b ) { for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,a,vec_traits::read_element_idx(i,a)-vec_traits::read_element_idx(i,b)); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_v_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && !qvm_detail::minus_v_defined::dim>::value, deduce_vec >::type operator-( A const & a ) { typedef typename deduce_vec::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,-vec_traits::read_element_idx(i,a)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct minus_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::minus_vv_defined::dim>::value, deduce_vec2::dim> >::type operator-( A const & a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,vec_traits::read_element_idx(i,a)-vec_traits::read_element_idx(i,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_eq_vs_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_scalar::value && !qvm_detail::mul_eq_vs_defined::dim>::value, A &>::type operator*=( A & a, B b ) { for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,a,vec_traits::read_element_idx(i,a)*b); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_vs_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_scalar::value && !qvm_detail::mul_vs_defined::dim>::value, deduce_vec2::dim> >::type operator*( A const & a, B b ) { typedef typename deduce_vec2::dim>::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,vec_traits::read_element_idx(i,a)*b); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct mul_sv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_scalar::value && is_vec::value && !qvm_detail::mul_sv_defined::dim>::value, deduce_vec2::dim> >::type operator*( A a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,a*vec_traits::read_element_idx(i,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template struct neq_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::neq_vv_defined::dim>::value, bool>::type operator!=( A const & a, B const & b ) { for( int i=0; i!=vec_traits::dim; ++i ) if( vec_traits::read_element_idx(i,a)!=vec_traits::read_element_idx(i,b) ) return true; return false; } //////////////////////////////////////////////// namespace qvm_detail { template struct normalize_v_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && !qvm_detail::normalize_v_defined::dim>::value, deduce_vec >::type normalized( A const & a ) { typedef typename vec_traits::scalar_type T; T m(scalar_traits::value(0)); for( int i=0; i!=vec_traits::dim; ++i ) { T x=vec_traits::read_element_idx(i,a); m+=x*x; } if( m==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T rm=scalar_traits::value(1)/sqrt(m); typedef typename deduce_vec::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,vec_traits::read_element_idx(i,a)*rm); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && !qvm_detail::normalize_v_defined::dim>::value, void>::type normalize( A & a ) { typedef typename vec_traits::scalar_type T; T m(scalar_traits::value(0)); for( int i=0; i!=vec_traits::dim; ++i ) { T x=vec_traits::read_element_idx(i,a); m+=x*x; } if( m==scalar_traits::value(0) ) BOOST_QVM_THROW_EXCEPTION(zero_magnitude_error()); T rm=scalar_traits::value(1)/sqrt(m); for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,a,vec_traits::read_element_idx(i,a)*rm); } //////////////////////////////////////////////// namespace qvm_detail { template struct plus_eq_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::plus_eq_vv_defined::dim>::value, A &>::type operator+=( A & a, B const & b ) { for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,a,vec_traits::read_element_idx(i,a)+vec_traits::read_element_idx(i,b)); return a; } //////////////////////////////////////////////// namespace qvm_detail { template struct plus_vv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_vec::value && vec_traits::dim==vec_traits::dim && !qvm_detail::plus_vv_defined::dim>::value, deduce_vec2::dim> >::type operator+( A const & a, B const & b ) { typedef typename deduce_vec2::dim>::type R; R r; for( int i=0; i!=vec_traits::dim; ++i ) write_vec_element_idx(i,r,vec_traits::read_element_idx(i,a)+vec_traits::read_element_idx(i,b)); return r; } //////////////////////////////////////////////// namespace qvm_detail { template class vref_ { vref_( vref_ const & ); vref_ & operator=( vref_ const & ); ~vref_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL vref_ & operator=( R const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct vref_write_traits; template struct vref_write_traits { typedef typename vec_traits::scalar_type scalar_type; typedef qvm_detail::vref_ this_vector; static int const dim=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int i, this_vector & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,reinterpret_cast(x)); } }; template struct vref_write_traits { typedef typename vec_traits::scalar_type scalar_type; typedef qvm_detail::vref_ this_vector; static int const dim=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_vector & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int i, this_vector & x, scalar_type s ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,reinterpret_cast(x), s); } }; } template struct vec_traits< qvm_detail::vref_ >: qvm_detail::vref_write_traits { typedef typename vec_traits::scalar_type scalar_type; typedef qvm_detail::vref_ this_vector; static int const dim=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(i,reinterpret_cast(x)); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value, qvm_detail::vref_ const &>::type vref( V const & a ) { return reinterpret_cast const &>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value, qvm_detail::vref_ &>::type vref( V & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace sfinae { using ::boost::qvm::to_string; using ::boost::qvm::assign; using ::boost::qvm::convert_to; using ::boost::qvm::cross; using ::boost::qvm::cmp; using ::boost::qvm::set_zero; using ::boost::qvm::scalar_cast; using ::boost::qvm::operator/=; using ::boost::qvm::operator/; using ::boost::qvm::dot; using ::boost::qvm::operator==; using ::boost::qvm::mag_sqr; using ::boost::qvm::mag; using ::boost::qvm::operator-=; using ::boost::qvm::operator-; using ::boost::qvm::operator*=; using ::boost::qvm::operator*; using ::boost::qvm::operator!=; using ::boost::qvm::normalized; using ::boost::qvm::normalize; using ::boost::qvm::operator+=; using ::boost::qvm::operator+; using ::boost::qvm::vref; } } } #endif // <<< #include #line 21 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_access.hpp" #ifndef BOOST_QVM_VEC_ACCESS_HPP_INCLUDED #define BOOST_QVM_VEC_ACCESS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 1117: #include // Expanded at line 145: #include // Expanded at line 1292: #include // Expanded at line 218: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type X( V const & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return vec_traits::template read_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type Y( V const & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return vec_traits::template read_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type Z( V const & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return vec_traits::template read_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type W( V const & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return vec_traits::template read_element<3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A0( V const & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return vec_traits::template read_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A1( V const & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return vec_traits::template read_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A2( V const & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return vec_traits::template read_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A3( V const & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return vec_traits::template read_element<3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A4( V const & a ) { BOOST_QVM_STATIC_ASSERT(4::dim); return vec_traits::template read_element<4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A5( V const & a ) { BOOST_QVM_STATIC_ASSERT(5::dim); return vec_traits::template read_element<5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A6( V const & a ) { BOOST_QVM_STATIC_ASSERT(6::dim); return vec_traits::template read_element<6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A7( V const & a ) { BOOST_QVM_STATIC_ASSERT(7::dim); return vec_traits::template read_element<7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A8( V const & a ) { BOOST_QVM_STATIC_ASSERT(8::dim); return vec_traits::template read_element<8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value,typename vec_traits::scalar_type>::type A9( V const & a ) { BOOST_QVM_STATIC_ASSERT(9::dim); return vec_traits::template read_element<9>(a); } namespace qvm_detail { template struct v_element_access { BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void operator=( typename vec_traits::scalar_type s ) { vec_traits::template write_element(*reinterpret_cast(this), s); } BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL operator typename vec_traits::scalar_type() const { return vec_traits::template read_element(*reinterpret_cast(this)); } }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value, typename vec_traits::scalar_type>::type A( V const & a ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::dim); return vec_traits::template read_element(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value && vec_write_element_ref::value, typename vec_traits::scalar_type &>::type A( V & a ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::dim); return vec_traits::template write_element(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c< is_vec::value && !vec_write_element_ref::value, qvm_detail::v_element_access &>::type A( V & a ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type X( V & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return vec_traits::template write_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type Y( V & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return vec_traits::template write_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type Z( V & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return vec_traits::template write_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type W( V & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return vec_traits::template write_element<3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A0( V & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return vec_traits::template write_element<0>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A1( V & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return vec_traits::template write_element<1>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A2( V & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return vec_traits::template write_element<2>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A3( V & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return vec_traits::template write_element<3>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A4( V & a ) { BOOST_QVM_STATIC_ASSERT(4::dim); return vec_traits::template write_element<4>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A5( V & a ) { BOOST_QVM_STATIC_ASSERT(5::dim); return vec_traits::template write_element<5>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A6( V & a ) { BOOST_QVM_STATIC_ASSERT(6::dim); return vec_traits::template write_element<6>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A7( V & a ) { BOOST_QVM_STATIC_ASSERT(7::dim); return vec_traits::template write_element<7>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A8( V & a ) { BOOST_QVM_STATIC_ASSERT(8::dim); return vec_traits::template write_element<8>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && vec_write_element_ref::value,typename vec_traits::scalar_type &>::type A9( V & a ) { BOOST_QVM_STATIC_ASSERT(9::dim); return vec_traits::template write_element<9>(a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<0,V> &>::type X( V & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<1,V> &>::type Y( V & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<2,V> &>::type Z( V & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<3,V> &>::type W( V & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<0,V> &>::type A0( V & a ) { BOOST_QVM_STATIC_ASSERT(0::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<1,V> &>::type A1( V & a ) { BOOST_QVM_STATIC_ASSERT(1::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<2,V> &>::type A2( V & a ) { BOOST_QVM_STATIC_ASSERT(2::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<3,V> &>::type A3( V & a ) { BOOST_QVM_STATIC_ASSERT(3::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<4,V> &>::type A4( V & a ) { BOOST_QVM_STATIC_ASSERT(4::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<5,V> &>::type A5( V & a ) { BOOST_QVM_STATIC_ASSERT(5::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<6,V> &>::type A6( V & a ) { BOOST_QVM_STATIC_ASSERT(6::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<7,V> &>::type A7( V & a ) { BOOST_QVM_STATIC_ASSERT(7::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<8,V> &>::type A8( V & a ) { BOOST_QVM_STATIC_ASSERT(8::dim); return *reinterpret_cast *>(&a); } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename enable_if_c::value && !vec_write_element_ref::value,qvm_detail::v_element_access<9,V> &>::type A9( V & a ) { BOOST_QVM_STATIC_ASSERT(9::dim); return *reinterpret_cast *>(&a); } } } #endif // <<< #include #line 22 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_traits_defaults.hpp" #ifndef BOOST_QVM_VEC_TRAITS_DEFAULTS_HPP_INCLUDED #define BOOST_QVM_VEC_TRAITS_DEFAULTS_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 969: #include namespace boost { namespace qvm { template struct vec_traits; namespace qvm_detail { template struct vector_w { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename vec_traits::scalar_type & write_element_idx( int i, A & a ) { return I==i? vec_traits::template write_element(a) : vector_w::write_element_idx(i,a); } }; template struct vector_w { template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL typename vec_traits::scalar_type & write_element_idx( int, A & a ) { BOOST_QVM_ASSERT(0); return vec_traits::template write_element<0>(a); } }; } template struct vec_traits_defaults { typedef VecType vec_type; typedef ScalarType scalar_type; static int const dim=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( vec_type const & x ) { return vec_traits::template write_element(const_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, vec_type const & x ) { return vec_traits::write_element_idx(i,const_cast(x)); } protected: static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL scalar_type & write_element_idx( int i, vec_type & m ) { return qvm_detail::vector_w<0,vec_traits::dim>::write_element_idx(i,m); } }; } } #endif // <<< #include #line 23 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_traits_array.hpp" #ifndef BOOST_QVM_VEC_TRAITS_ARRAY_HPP_INCLUDED #define BOOST_QVM_VEC_TRAITS_ARRAY_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 1572: #include // Expanded at line 969: #include #if __cplusplus > 199711L #include namespace boost { namespace qvm { template struct vec_traits,N> > { static int const dim=0; typedef void scalar_type; }; template struct vec_traits > { typedef std::array this_vector; typedef T scalar_type; static int const dim=int(Dim); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i=0); BOOST_QVM_ASSERT(i struct vec_traits const> { typedef std::array const this_vector; typedef T scalar_type; static int const dim=int(Dim); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i struct deduce_vec,D> { typedef vec type; }; template struct deduce_vec const,D> { typedef vec type; }; template struct deduce_vec2,std::array,D> { typedef vec::type,D> type; }; template struct deduce_vec2 const,std::array,D> { typedef vec::type,D> type; }; template struct deduce_vec2,std::array const,D> { typedef vec::type,D> type; }; template struct deduce_vec2 const,std::array const,D> { typedef vec::type,D> type; }; } } #endif namespace boost { namespace qvm { template struct vec_traits { static int const dim=0; typedef void scalar_type; }; template struct vec_traits { typedef T this_vector[Dim]; typedef T scalar_type; static int const dim=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i=0); BOOST_QVM_ASSERT(i struct deduce_vec { typedef vec type; }; template struct deduce_vec { typedef vec type; }; template struct deduce_vec2 { typedef vec::type,D> type; }; template T (&ptr_vref( T * ptr ))[Dim] { return *reinterpret_cast(ptr); } } } #endif // <<< #include #line 24 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_traits_gnuc.hpp" #ifndef BOOST_QVM_VEC_TRAITS_GNUC_HPP_INCLUDED #define BOOST_QVM_VEC_TRAITS_GNUC_HPP_INCLUDED // Copyright 2008-2022 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) #if defined(__GNUC__) && defined(__SSE2__) // Expanded at line 145: #include // Expanded at line 969: #include // Expanded at line 1292: #include namespace boost { namespace qvm { namespace qvm_detail { template struct vec_traits_gnuc_impl { typedef T scalar_type; static int const dim=D; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( V const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( V & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i=0); BOOST_QVM_ASSERT(i struct vec_traits; template struct is_vec; #define BOOST_QVM_GNUC_VEC_TYPE(T,D)\ template <>\ struct\ vec_traits:\ qvm_detail::vec_traits_gnuc_impl\ {\ };\ template <>\ struct\ is_vec\ {\ enum { value = true };\ }; BOOST_QVM_GNUC_VEC_TYPE(float,2) BOOST_QVM_GNUC_VEC_TYPE(float,4) BOOST_QVM_GNUC_VEC_TYPE(double,2) BOOST_QVM_GNUC_VEC_TYPE(double,4) #undef BOOST_QVM_GNUC_VEC_TYPE } } #endif #endif // <<< #include #line 25 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec.hpp" #ifndef BOOST_QVM_VEC_HPP_INCLUDED #define BOOST_QVM_VEC_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 13452: #include // Expanded at line 969: #include // Expanded at line 1292: #include namespace boost { namespace qvm { template struct vec { T a[D]; template = 201103L , class = typename enable_if >::type #endif > operator R() const { R r; assign(r,*this); return r; } }; template struct vec_traits; template struct vec_traits< vec > { typedef vec this_vector; typedef T scalar_type; static int const dim=Dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I=0); BOOST_QVM_ASSERT(i=0); BOOST_QVM_ASSERT(i #line 26 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_mat_operations.hpp" #ifndef BOOST_QVM_VEC_MAT_OPERATIONS_HPP_INCLUDED #define BOOST_QVM_VEC_MAT_OPERATIONS_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/vec_mat_operations2.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_mat_operations2.hpp" #ifndef BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_MAT_OPERATIONS2_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 1572: #include // Expanded at line 218: #include // Expanded at line 349: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && vec_traits::dim==2, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Tb const b0 = vec_traits::template read_element<0>(b); Tb const b1 = vec_traits::template read_element<1>(b); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==2); R r; write_vec_element<0>(r,a00*b0+a01*b1); write_vec_element<1>(r,a10*b0+a11*b1); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mv_defined; template <> struct mul_mv_defined<2,2> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==2 && mat_traits::cols==2 && vec_traits::dim==2, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename vec_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; Ta const a0 = vec_traits::template read_element<0>(a); Ta const a1 = vec_traits::template read_element<1>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==2); R r; write_vec_element<0>(r,a0*b00+a1*b10); write_vec_element<1>(r,a0*b01+a1*b11); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vm_defined; template <> struct mul_vm_defined<2,2> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/vec_mat_operations2.hpp" // <<< #include #line 10 "boost/qvm/vec_mat_operations.hpp" // >>> #include #line 1 "boost/qvm/vec_mat_operations3.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_mat_operations3.hpp" #ifndef BOOST_QVM_GEN_VEC_MAT_OPERATIONS3_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_MAT_OPERATIONS3_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 1572: #include // Expanded at line 218: #include // Expanded at line 349: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && vec_traits::dim==3, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,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); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; write_vec_element<0>(r,a00*b0+a01*b1+a02*b2); write_vec_element<1>(r,a10*b0+a11*b1+a12*b2); write_vec_element<2>(r,a20*b0+a21*b1+a22*b2); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mv_defined; template <> struct mul_mv_defined<3,3> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==3 && mat_traits::cols==3 && vec_traits::dim==3, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename vec_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; 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 b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; write_vec_element<0>(r,a0*b00+a1*b10+a2*b20); write_vec_element<1>(r,a0*b01+a1*b11+a2*b21); write_vec_element<2>(r,a0*b02+a1*b12+a2*b22); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vm_defined; template <> struct mul_vm_defined<3,3> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/vec_mat_operations3.hpp" // <<< #include #line 11 "boost/qvm/vec_mat_operations.hpp" // >>> #include #line 1 "boost/qvm/vec_mat_operations4.hpp" // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/gen/vec_mat_operations4.hpp" #ifndef BOOST_QVM_GEN_VEC_MAT_OPERATIONS4_HPP_INCLUDED #define BOOST_QVM_GEN_VEC_MAT_OPERATIONS4_HPP_INCLUDED // Copyright 2008-2022 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) // This file was generated by a program. Do not edit manually. // Expanded at line 145: #include // Expanded at line 1572: #include // Expanded at line 218: #include // Expanded at line 349: #include // Expanded at line 1117: #include namespace boost { namespace qvm { template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && vec_traits::dim==4, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a13 = mat_traits::template read_element<1,3>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Ta const a23 = mat_traits::template read_element<2,3>(a); Ta const a30 = mat_traits::template read_element<3,0>(a); Ta const a31 = mat_traits::template read_element<3,1>(a); Ta const a32 = mat_traits::template read_element<3,2>(a); Ta const a33 = mat_traits::template read_element<3,3>(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); Tb const b3 = vec_traits::template read_element<3>(b); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==4); R r; write_vec_element<0>(r,a00*b0+a01*b1+a02*b2+a03*b3); write_vec_element<1>(r,a10*b0+a11*b1+a12*b2+a13*b3); write_vec_element<2>(r,a20*b0+a21*b1+a22*b2+a23*b3); write_vec_element<3>(r,a30*b0+a31*b1+a32*b2+a33*b3); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_mv_defined; template <> struct mul_mv_defined<4,4> { static bool const value=true; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && vec_traits::dim==4, deduce_vec2 >::type operator*( A const & a, B const & b ) { typedef typename vec_traits::scalar_type Ta; typedef typename mat_traits::scalar_type Tb; 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); Ta const a3 = vec_traits::template read_element<3>(a); Tb const b00 = mat_traits::template read_element<0,0>(b); Tb const b01 = mat_traits::template read_element<0,1>(b); Tb const b02 = mat_traits::template read_element<0,2>(b); Tb const b03 = mat_traits::template read_element<0,3>(b); Tb const b10 = mat_traits::template read_element<1,0>(b); Tb const b11 = mat_traits::template read_element<1,1>(b); Tb const b12 = mat_traits::template read_element<1,2>(b); Tb const b13 = mat_traits::template read_element<1,3>(b); Tb const b20 = mat_traits::template read_element<2,0>(b); Tb const b21 = mat_traits::template read_element<2,1>(b); Tb const b22 = mat_traits::template read_element<2,2>(b); Tb const b23 = mat_traits::template read_element<2,3>(b); Tb const b30 = mat_traits::template read_element<3,0>(b); Tb const b31 = mat_traits::template read_element<3,1>(b); Tb const b32 = mat_traits::template read_element<3,2>(b); Tb const b33 = mat_traits::template read_element<3,3>(b); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==4); R r; write_vec_element<0>(r,a0*b00+a1*b10+a2*b20+a3*b30); write_vec_element<1>(r,a0*b01+a1*b11+a2*b21+a3*b31); write_vec_element<2>(r,a0*b02+a1*b12+a2*b22+a3*b32); write_vec_element<3>(r,a0*b03+a1*b13+a2*b23+a3*b33); return r; } namespace sfinae { using ::boost::qvm::operator*; } namespace qvm_detail { template struct mul_vm_defined; template <> struct mul_vm_defined<4,4> { static bool const value=true; }; } } } #endif // <<< #include #line 7 "boost/qvm/vec_mat_operations4.hpp" // <<< #include #line 12 "boost/qvm/vec_mat_operations.hpp" namespace boost { namespace qvm { namespace qvm_detail { template struct mul_mv_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_mat::value && is_vec::value && mat_traits::cols==vec_traits::dim && !qvm_detail::mul_mv_defined::rows,mat_traits::cols>::value, deduce_vec2::rows> >::type operator*( A const & a, B const & b ) { typedef typename deduce_vec2::rows>::type R; R r; for( int i=0; i::rows; ++i ) { typedef typename vec_traits::scalar_type Tr; Tr x(scalar_traits::value(0)); for( int j=0; j::cols; ++j ) x += mat_traits::read_element_idx(i,j,a)*vec_traits::read_element_idx(j,b); write_vec_element_idx(i,r,x); } return r; } namespace qvm_detail { template struct mul_vm_defined { static bool const value=false; }; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< is_vec::value && is_mat::value && vec_traits::dim==mat_traits::rows && !qvm_detail::mul_vm_defined::rows,mat_traits::cols>::value, deduce_vec2::cols> >::type operator*( A const & a, B const & b ) { typedef typename deduce_vec2::cols>::type R; R r; for( int i=0; i::cols; ++i ) { typedef typename vec_traits::scalar_type Tr; Tr x(scalar_traits::value(0)); for( int j=0; j::rows; ++j ) x += vec_traits::read_element_idx(j,a)*mat_traits::read_element_idx(j,i,b); write_vec_element_idx(i,r,x); } return r; } //////////////////////////////////////////////// template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && vec_traits::dim==3, deduce_vec2 >::type transform_point( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a03 = mat_traits::template read_element<0,3>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a13 = mat_traits::template read_element<1,3>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,2>(a); Ta const a23 = mat_traits::template read_element<2,3>(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); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; write_vec_element<0>(r, a00*b0+a01*b1+a02*b2+a03); write_vec_element<1>(r, a10*b0+a11*b1+a12*b2+a13); write_vec_element<2>(r, a20*b0+a21*b1+a22*b2+a23); return r; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_OPERATIONS typename lazy_enable_if_c< mat_traits::rows==4 && mat_traits::cols==4 && vec_traits::dim==3, deduce_vec2 >::type transform_vector( A const & a, B const & b ) { typedef typename mat_traits::scalar_type Ta; typedef typename vec_traits::scalar_type Tb; Ta const a00 = mat_traits::template read_element<0,0>(a); Ta const a01 = mat_traits::template read_element<0,1>(a); Ta const a02 = mat_traits::template read_element<0,2>(a); Ta const a10 = mat_traits::template read_element<1,0>(a); Ta const a11 = mat_traits::template read_element<1,1>(a); Ta const a12 = mat_traits::template read_element<1,2>(a); Ta const a20 = mat_traits::template read_element<2,0>(a); Ta const a21 = mat_traits::template read_element<2,1>(a); Ta const a22 = mat_traits::template read_element<2,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); typedef typename deduce_vec2::type R; BOOST_QVM_STATIC_ASSERT(vec_traits::dim==3); R r; write_vec_element<0>(r, a00*b0+a01*b1+a02*b2); write_vec_element<1>(r, a10*b0+a11*b1+a12*b2); write_vec_element<2>(r, a20*b0+a21*b1+a22*b2); return r; } //////////////////////////////////////////////// namespace sfinae { using ::boost::qvm::operator*; using ::boost::qvm::transform_point; using ::boost::qvm::transform_vector; } } } #endif // <<< #include #line 27 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/vec_register.hpp" #ifndef BOOST_QVM_VEC_REGISTER_HPP_INCLUDED #define BOOST_QVM_VEC_REGISTER_HPP_INCLUDED // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2018 agate-pris // 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) // >>> #include #line 1 "boost/qvm/vec_register2.hpp" // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2018 agate-pris // 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_VEC_REGISTER2_HPP #define BOOST_QVM_VEC_REGISTER2_HPP // >>> #include #line 1 "boost/qvm/detail/vec_register_impl.hpp" #ifndef BOOST_QVM_DETAIL_VEC_REGISTER_IMPL_HPP #define BOOST_QVM_DETAIL_VEC_REGISTER_IMPL_HPP // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2018 agate-pris // 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) // Expanded at line 969: #include // Expanded at line 145: #include // Expanded at line 1292: #include // Expanded at line 1117: #include namespace boost { namespace qvm { namespace qvm_detail { template struct vec_register_common { typedef VecType vec_type; typedef ScalarType scalar_type; static int const dim = Dim; }; template struct vec_register_read { template static ScalarType read_element(VecType const& v); template struct read_element_idx_detail { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL ScalarType impl(int const i, VecType const& v) { return I == i ? read_element(v) : read_element_idx_detail::impl(i, v); } }; template struct read_element_idx_detail { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL ScalarType impl(int, VecType const& v) { BOOST_QVM_ASSERT(0); return read_element<0>(v); } }; static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL ScalarType read_element_idx(int const i, VecType const& v) { return read_element_idx_detail<0, Dim>::impl(i, v); } }; template struct vec_register_write { template static ScalarType& write_element(VecType& v); template struct write_element_idx_detail { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL ScalarType& impl(int const i, VecType& v) { return I == i ? write_element(v) : write_element_idx_detail::impl(i, v); } }; template struct write_element_idx_detail { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL ScalarType& impl(int, VecType& v) { BOOST_QVM_ASSERT(0); return write_element<0>(v); } }; static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL ScalarType& write_element_idx(int const i, VecType& v) { return write_element_idx_detail<0, Dim>::impl(i, v); } }; }}} #define BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, Dim, I, Read) \ namespace boost { namespace qvm {namespace qvm_detail{ \ template<> \ template<> \ BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL \ ScalarType vec_register_read::read_element(VecType const& v) \ { \ BOOST_QVM_STATIC_ASSERT(I>=0); \ BOOST_QVM_STATIC_ASSERT(I \ template<> \ BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL \ ScalarType& vec_register_write::write_element(VecType& v) \ { \ BOOST_QVM_STATIC_ASSERT(I>=0); \ BOOST_QVM_STATIC_ASSERT(I \ struct vec_traits \ : qvm_detail::vec_register_common \ , qvm_detail::vec_register_read \ { \ }; \ }} #define BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ_WRITE(VecType, ScalarType, Dim)\ namespace boost { namespace qvm { \ template<> \ struct vec_traits \ : qvm_detail::vec_register_common \ , qvm_detail::vec_register_read \ , qvm_detail::vec_register_write \ { \ }; \ }} #endif // <<< #include #line 11 "boost/qvm/vec_register2.hpp" #define BOOST_QVM_REGISTER_VEC_2_READ(VecType, ScalarType, Read0, Read1) \ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ(VecType, ScalarType, 2) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 2, 0, Read0) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 2, 1, Read1) #define BOOST_QVM_REGISTER_VEC_2_READ_WRITE(VecType, ScalarType, Read0, Read1, Write0, Write1) \ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ_WRITE(VecType, ScalarType, 2) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 2, 0, Read0, Write0)\ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 2, 1, Read1, Write1) #define BOOST_QVM_REGISTER_VEC_2(VecType, ScalarType, Element0, Element1) \ BOOST_QVM_REGISTER_VEC_2_READ_WRITE(VecType, ScalarType, Element0, Element1, Element0, Element1) #endif // <<< #include #line 11 "boost/qvm/vec_register.hpp" // >>> #include #line 1 "boost/qvm/vec_register3.hpp" // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2018 agate-pris // 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_VEC_REGISTER3_HPP #define BOOST_QVM_VEC_REGISTER3_HPP // Expanded at line 17954: #include #define BOOST_QVM_REGISTER_VEC_3_READ(VecType, ScalarType, Read0, Read1, Read2) \ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ(VecType, ScalarType, 3) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 3, 0, Read0) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 3, 1, Read1) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 3, 2, Read2) #define BOOST_QVM_REGISTER_VEC_3_READ_WRITE(VecType, ScalarType, Read0, Read1, Read2, Write0, Write1, Write2) \ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ_WRITE(VecType, ScalarType, 3) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 3, 0, Read0, Write0) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 3, 1, Read1, Write1) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 3, 2, Read2, Write2) #define BOOST_QVM_REGISTER_VEC_3(VecType, ScalarType, Element0, Element1, Element2) \ BOOST_QVM_REGISTER_VEC_3_READ_WRITE(VecType, ScalarType, Element0, Element1, Element2, Element0, Element1, Element2) #endif // <<< #include #line 12 "boost/qvm/vec_register.hpp" // >>> #include #line 1 "boost/qvm/vec_register4.hpp" // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Copyright 2018 agate-pris // 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_VEC_REGISTER4_HPP #define BOOST_QVM_VEC_REGISTER4_HPP // Expanded at line 17954: #include #define BOOST_QVM_REGISTER_VEC_4_READ(VecType, ScalarType, Read0, Read1, Read2, Read3) \ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ(VecType, ScalarType, 4) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 4, 0, Read0) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 4, 1, Read1) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 4, 2, Read2) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ(VecType, ScalarType, 4, 3, Read3) #define BOOST_QVM_REGISTER_VEC_4_READ_WRITE(VecType, ScalarType, Read0, Read1, Read2, Read3, Write0, Write1, Write2, Write3)\ BOOST_QVM_DETAIL_REGISTER_VEC_SPECIALIZE_VEC_TRAITS_READ_WRITE(VecType, ScalarType, 4) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 4, 0, Read0, Write0) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 4, 1, Read1, Write1) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 4, 2, Read2, Write2) \ BOOST_QVM_DETAIL_SPECIALIZE_QVM_DETAIL_VEC_REGISTER_READ_WRITE(VecType, ScalarType, 4, 3, Read3, Write3) #define BOOST_QVM_REGISTER_VEC_4(VecType, ScalarType, Element0, Element1, Element2, Element3) \ BOOST_QVM_REGISTER_VEC_4_READ_WRITE(VecType, ScalarType, Element0, Element1, Element2, Element3, Element0, Element1, Element2, Element3) #endif // <<< #include #line 13 "boost/qvm/vec_register.hpp" #endif // <<< #include #line 28 "boost/qvm/lite.hpp" // >>> #include #line 1 "boost/qvm/map.hpp" #ifndef BOOST_QVM_MAP_HPP_INCLUDED #define BOOST_QVM_MAP_HPP_INCLUDED // Copyright 2008-2022 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) // >>> #include #line 1 "boost/qvm/map_vec_mat.hpp" #ifndef BOOST_QVM_MAP_VEC_MAT_HPP_INCLUDED #define BOOST_QVM_MAP_VEC_MAT_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 986: #include // Expanded at line 1117: #include // Expanded at line 969: #include // Expanded at line 218: #include namespace boost { namespace qvm { namespace qvm_detail { template class col_mat_ { col_mat_( col_mat_ const & ); col_mat_ & operator=( col_mat_ const & ); ~col_mat_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col_mat_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct col_mat_write_traits; template struct col_mat_write_traits { typedef qvm_detail::col_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Col==0); BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(col==0); BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x)); } }; template struct col_mat_write_traits { typedef qvm_detail::col_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Col==0); BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(col==0); BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::col_mat_ >: qvm_detail::col_mat_write_traits { typedef qvm_detail::col_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Col==0); BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(col==0); BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::read_element_idx(row,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::col_mat_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_vec::value, qvm_detail::col_mat_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col_mat( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_vec::value, qvm_detail::col_mat_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col_mat( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class row_mat_ { row_mat_( row_mat_ const & ); row_mat_ & operator=( row_mat_ const & ); ~row_mat_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row_mat_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct row_mat_write_traits; template struct row_mat_write_traits { typedef qvm_detail::row_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=1; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row==0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row==0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(col::write_element_idx(col,reinterpret_cast(x)); } }; template struct row_mat_write_traits { typedef qvm_detail::row_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=1; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row==0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row==0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(col::write_element_idx(col,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::row_mat_ >: qvm_detail::row_mat_write_traits { typedef qvm_detail::row_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=1; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row==0); BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row==0); BOOST_QVM_ASSERT(col>=0); BOOST_QVM_ASSERT(col::read_element_idx(col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::row_mat_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_vec::value, qvm_detail::row_mat_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row_mat( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_vec::value, qvm_detail::row_mat_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row_mat( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class translation_mat_ { translation_mat_( translation_mat_ const & ); translation_mat_ & operator=( translation_mat_ const & ); ~translation_mat_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation_mat_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::cols-1)> struct read_translation_matat; template struct read_translation_matat,Row,Col,TransCol> { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename mat_traits< translation_mat_ >::scalar_type f( translation_mat_ const & ) { return scalar_traits >::scalar_type>::value(0); } }; template struct read_translation_matat,D,D,false> { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename mat_traits< translation_mat_ >::scalar_type f( translation_mat_ const & ) { return scalar_traits >::scalar_type>::value(1); } }; template struct read_translation_matat,D,D,true> { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename mat_traits< translation_mat_ >::scalar_type f( translation_mat_ const & ) { return scalar_traits >::scalar_type>::value(1); } }; template struct read_translation_matat,Row,Col,true> { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL typename mat_traits< translation_mat_ >::scalar_type f( translation_mat_ const & x ) { return vec_traits::template read_element(reinterpret_cast(x)); } }; template ::value> struct translation_mat_write_traits; template struct translation_mat_write_traits { typedef qvm_detail::translation_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim+1; static int const cols=vec_traits::dim+1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x)); } }; template struct translation_mat_write_traits { typedef qvm_detail::translation_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim+1; static int const cols=vec_traits::dim+1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix const & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::translation_mat_ >: qvm_detail::translation_mat_write_traits { typedef qvm_detail::translation_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim+1; static int const cols=vec_traits::dim+1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col,Row,Col>::f(x); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::value(1): (col==cols-1? vec_traits::read_element_idx(row,reinterpret_cast(x)): scalar_traits::value(0)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::translation_mat_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_vec::value, qvm_detail::translation_mat_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation_mat( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_vec::value, qvm_detail::translation_mat_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation_mat( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class diag_mat_ { diag_mat_( diag_mat_ const & ); diag_mat_ & operator=( diag_mat_ const & ); ~diag_mat_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag_mat_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct diag_mat_write_traits; template struct diag_mat_write_traits { typedef qvm_detail::diag_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x)); } }; template struct diag_mat_write_traits { typedef qvm_detail::diag_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row::write_element_idx(row,reinterpret_cast(x), s); } }; } template struct mat_traits< qvm_detail::diag_mat_ >: qvm_detail::diag_mat_write_traits { typedef qvm_detail::diag_mat_ this_matrix; typedef typename vec_traits::scalar_type scalar_type; static int const rows=vec_traits::dim; static int const cols=vec_traits::dim; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)):scalar_traits::value(0); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,reinterpret_cast(x)):scalar_traits::value(0); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::diag_mat_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_vec::value, qvm_detail::diag_mat_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag_mat( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_vec::value, qvm_detail::diag_mat_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag_mat( A & a ) { return reinterpret_cast &>(a); } } } #endif // <<< #include #line 10 "boost/qvm/map.hpp" // >>> #include #line 1 "boost/qvm/map_mat_vec.hpp" #ifndef BOOST_QVM_MAP_MAT_VEC_HPP_INCLUDED #define BOOST_QVM_MAP_MAT_VEC_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 349: #include // Expanded at line 1572: #include // Expanded at line 969: #include // Expanded at line 218: #include namespace boost { namespace qvm { namespace qvm_detail { template class col_ { col_( col_ const & ); col_ & operator=( col_ const & ); ~col_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct col_write_traits; template struct col_write_traits { typedef qvm_detail::col_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::rows; BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::cols); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int i, this_vector & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,Col,reinterpret_cast(x)); } }; template struct col_write_traits { typedef qvm_detail::col_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::rows; BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::cols); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_vector & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int i, this_vector & x, scalar_type s ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,Col,reinterpret_cast(x), s); } }; } template struct vec_traits< qvm_detail::col_ >: qvm_detail::col_write_traits { typedef qvm_detail::col_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::rows; BOOST_QVM_STATIC_ASSERT(Col>=0); BOOST_QVM_STATIC_ASSERT(Col::cols); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(i,Col,reinterpret_cast(x)); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template struct deduce_vec2,qvm_detail::col_,D> { typedef vec::scalar_type,D> type; }; template typename enable_if_c< is_mat::value, qvm_detail::col_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::col_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL col( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class row_ { row_( row_ const & ); row_ & operator=( row_ const & ); ~row_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct row_write_traits; template struct row_write_traits { typedef qvm_detail::row_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols; BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::rows); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int i, this_vector & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(Row,i,reinterpret_cast(x)); } }; template struct row_write_traits { typedef qvm_detail::row_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols; BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::rows); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_vector & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int i, this_vector & x, scalar_type s ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(Row,i,reinterpret_cast(x), s); } }; } template struct vec_traits< qvm_detail::row_ >: qvm_detail::row_write_traits { typedef qvm_detail::row_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols; BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row::rows); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(Row,i,reinterpret_cast(x)); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template struct deduce_vec2,qvm_detail::row_,D> { typedef vec::scalar_type,D> type; }; template typename enable_if_c< is_mat::value, qvm_detail::row_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::row_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL row( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class diag_ { diag_( diag_ const & ); diag_ & operator=( diag_ const & ); ~diag_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template struct diag_bool_dispatch; template struct diag_bool_dispatch { static int const value=X; }; template struct diag_bool_dispatch { static int const value=Y; }; template ::value> struct diag_write_traits; template struct diag_write_traits { typedef qvm_detail::diag_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=qvm_detail::diag_bool_dispatch< mat_traits::rows, mat_traits::cols, mat_traits::rows<=mat_traits::cols>::value; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int i, this_vector & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,i,reinterpret_cast(x)); } }; template struct diag_write_traits { typedef qvm_detail::diag_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=qvm_detail::diag_bool_dispatch< mat_traits::rows, mat_traits::cols, mat_traits::rows<=mat_traits::cols>::value; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_vector & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int i, this_vector & x, scalar_type s ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,i,reinterpret_cast(x), s); } }; } template struct vec_traits< qvm_detail::diag_ >: qvm_detail::diag_write_traits { typedef qvm_detail::diag_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=qvm_detail::diag_bool_dispatch< mat_traits::rows, mat_traits::cols, mat_traits::rows<=mat_traits::cols>::value; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(i,i,reinterpret_cast(x)); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template struct deduce_vec2,qvm_detail::diag_,D> { typedef vec::scalar_type,D> type; }; template typename enable_if_c< is_mat::value, qvm_detail::diag_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::diag_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL diag( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class translation_ { translation_( translation_ const & ); ~translation_(); public: translation_ & operator=( translation_ const & x ) { assign(*this,x); return *this; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct translation_write_traits; template struct translation_write_traits { typedef qvm_detail::translation_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols-1; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==mat_traits::cols || mat_traits::rows+1==mat_traits::cols); BOOST_QVM_STATIC_ASSERT(mat_traits::cols>=3); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_vector & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int i, this_vector & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,dim,reinterpret_cast(x)); } }; template struct translation_write_traits { typedef qvm_detail::translation_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols-1; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==mat_traits::cols || mat_traits::rows+1==mat_traits::cols); BOOST_QVM_STATIC_ASSERT(mat_traits::cols>=3); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_vector & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int i, this_vector & x, scalar_type s ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::write_element_idx(i,dim,reinterpret_cast(x), s); } }; } template struct vec_traits< qvm_detail::translation_ >: qvm_detail::translation_write_traits { typedef qvm_detail::translation_ this_vector; typedef typename mat_traits::scalar_type scalar_type; static int const dim=mat_traits::cols-1; BOOST_QVM_STATIC_ASSERT(mat_traits::rows==mat_traits::cols || mat_traits::rows+1==mat_traits::cols); BOOST_QVM_STATIC_ASSERT(mat_traits::cols>=3); template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_vector const & x ) { BOOST_QVM_STATIC_ASSERT(I>=0); BOOST_QVM_STATIC_ASSERT(I::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int i, this_vector const & x ) { BOOST_QVM_ASSERT(i>=0); BOOST_QVM_ASSERT(i::read_element_idx(i,dim,reinterpret_cast(x)); } }; template struct deduce_vec,D> { typedef vec::scalar_type,D> type; }; template struct deduce_vec2,qvm_detail::translation_,D> { typedef vec::scalar_type,D> type; }; template typename enable_if_c< is_mat::value && (mat_traits::rows==mat_traits::cols || mat_traits::rows+1==mat_traits::cols) && mat_traits::cols>=3, qvm_detail::translation_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value && (mat_traits::rows==mat_traits::cols || mat_traits::rows+1==mat_traits::cols) && mat_traits::cols>=3, qvm_detail::translation_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL translation( A & a ) { return reinterpret_cast &>(a); } } } #endif // <<< #include #line 11 "boost/qvm/map.hpp" // >>> #include #line 1 "boost/qvm/map_mat_mat.hpp" #ifndef BOOST_QVM_MAP_MAT_MAT_HPP_INCLUDED #define BOOST_QVM_MAP_MAT_MAT_HPP_INCLUDED // Copyright 2008-2022 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) // Expanded at line 145: #include // Expanded at line 986: #include // Expanded at line 969: #include // Expanded at line 218: #include // Expanded at line 8079: #include namespace boost { namespace qvm { namespace qvm_detail { template class del_row_ { del_row_( del_row_ const & ); del_row_ & operator=( del_row_ const & ); ~del_row_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct del_row_write_traits; template struct del_row_write_traits { typedef del_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col,reinterpret_cast(x)); } }; template struct del_row_write_traits { typedef del_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col>(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col,reinterpret_cast(x), s); } }; } template struct mat_traits >: qvm_detail::del_row_write_traits { typedef qvm_detail::del_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=I),Col>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row+(row>=I),col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_row_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::del_row_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::del_row_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class del_col_ { del_col_( del_col_ const & ); del_col_ & operator=( del_col_ const & ); ~del_col_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct del_col_write_traits; template struct del_col_write_traits { typedef del_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=J)>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col+(col>=J),reinterpret_cast(x)); } }; template struct del_col_write_traits { typedef del_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=J)>(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col+(col>=J),reinterpret_cast(x), s); } }; } template struct mat_traits >: qvm_detail::del_col_write_traits { typedef qvm_detail::del_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=J)>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col+(col>=J),reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::del_col_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_col( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::del_col_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_col( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class del_row_col_ { del_row_col_( del_row_col_ const & ); ~del_row_col_(); public: BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row_col_ & operator=( del_row_col_ const & x ) { assign(*this,x); return *this; } template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct del_row_col_write_traits; template struct del_row_col_write_traits { typedef del_row_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col+(Col>=J)>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast(x)); } }; template struct del_row_col_write_traits { typedef del_row_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element=I),Col+(Col>=J)>(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast(x), s); } }; } template struct mat_traits >: qvm_detail::del_row_col_write_traits { typedef qvm_detail::del_row_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows-1; static int const cols=mat_traits::cols-1; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element=I),Col+(Col>=J)>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row+(row>=I),col+(col>=J),reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::del_row_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::del_row_col_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row_col( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::del_row_col_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL del_row_col( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class neg_row_ { neg_row_( neg_row_ const & ); neg_row_ & operator=( neg_row_ const & ); ~neg_row_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL neg_row_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits > { typedef qvm_detail::neg_row_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)) : mat_traits::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col,reinterpret_cast(x)) : mat_traits::read_element_idx(row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::neg_row_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::neg_row_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL neg_row( A const & a ) { return reinterpret_cast const &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class neg_col_ { neg_col_( neg_col_ const & ); neg_col_ & operator=( neg_col_ const & ); ~neg_col_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL neg_col_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; } template struct mat_traits > { typedef qvm_detail::neg_col_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)) : mat_traits::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col,reinterpret_cast(x)) : mat_traits::read_element_idx(row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::neg_col_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::neg_col_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL neg_col( A const & a ) { return reinterpret_cast const &>(a); } //////////////////////////////////////////////// template typename enable_if_c< is_mat::value, qvm_detail::transposed_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL transposed( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::transposed_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL transposed( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class swap_rows_ { swap_rows_( swap_rows_ const & ); swap_rows_ & operator=( swap_rows_ const & ); ~swap_rows_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_rows_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct swap_rows_write_traits; template struct swap_rows_write_traits { typedef swap_rows_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast(x)); } }; template struct swap_rows_write_traits { typedef swap_rows_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast(x), s); } }; } template struct mat_traits >: qvm_detail::swap_rows_write_traits { typedef qvm_detail::swap_rows_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element<(Row==R1 && R1!=R2)*R2+(Row==R2 && R1!=R2)*R1+((Row!=R1 && Row!=R2) || R1==R2)*Row,Col>(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row==R1?R2:row==R2?R1:row,col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::swap_rows_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::swap_rows_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_rows( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::swap_rows_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_rows( A & a ) { return reinterpret_cast &>(a); } //////////////////////////////////////////////// namespace qvm_detail { template class swap_cols_ { swap_cols_( swap_cols_ const & ); swap_cols_ & operator=( swap_cols_ const & ); ~swap_cols_(); public: template BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_cols_ & operator=( T const & x ) { assign(*this,x); return *this; } template = 201103L , class = typename enable_if >::type #endif > BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL operator R() const { R r; assign(r,*this); return r; } }; template ::value> struct swap_cols_write_traits; template struct swap_cols_write_traits { typedef swap_cols_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element( this_matrix & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type & write_element_idx( int row, int col, this_matrix & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast(x)); } }; template struct swap_cols_write_traits { typedef swap_cols_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element( this_matrix & x, scalar_type s ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template write_element(reinterpret_cast(x), s); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL void write_element_idx( int row, int col, this_matrix & x, scalar_type s ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::write_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast(x), s); } }; } template struct mat_traits >: qvm_detail::swap_cols_write_traits { typedef qvm_detail::swap_cols_ this_matrix; typedef typename mat_traits::scalar_type scalar_type; static int const rows=mat_traits::rows; static int const cols=mat_traits::cols; template static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element( this_matrix const & x ) { BOOST_QVM_STATIC_ASSERT(Row>=0); BOOST_QVM_STATIC_ASSERT(Row=0); BOOST_QVM_STATIC_ASSERT(Col::template read_element(reinterpret_cast(x)); } static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL scalar_type read_element_idx( int row, int col, this_matrix const & x ) { BOOST_QVM_ASSERT(row>=0); BOOST_QVM_ASSERT(row=0); BOOST_QVM_ASSERT(col::read_element_idx(row,col==C1?C2:col==C2?C1:col,reinterpret_cast(x)); } }; template struct deduce_mat,R,C> { typedef mat::scalar_type,R,C> type; }; template struct deduce_mat2,qvm_detail::swap_cols_,R,C> { typedef mat::scalar_type,R,C> type; }; template typename enable_if_c< is_mat::value, qvm_detail::swap_cols_ const &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_cols( A const & a ) { return reinterpret_cast const &>(a); } template typename enable_if_c< is_mat::value, qvm_detail::swap_cols_ &>::type BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_TRIVIAL swap_cols( A & a ) { return reinterpret_cast &>(a); } } } #endif // <<< #include #line 12 "boost/qvm/map.hpp" #endif // <<< #include #line 29 "boost/qvm/lite.hpp" // <<< #include #line 10 "include/boost/qvm_lite.hpp" #endif