Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

QVM: Quaternions, Vectors, Matrices

boost/qvm/vec_operations.hpp

This header defines all available function overloads that operate on vector objects.

Synopsis:

#include <boost/qvm/vec_operations.hpp>

namespace boost
{
    namespace qvm
    {
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        A & assign( A & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<R>::value && is_vec<A>::value &&
        //  vec_traits<R>::dim==vec_traits<A>::dim
        template <class R,class A>
        R convert_to( A const & a );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        A & operator-=( A & a, B const & b );        
        
        //Only enabled if: is_vec<A>::value
        template <class A>
        typename deduce_vec<A>::type
        operator-( A const & a );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        typename deduce_vec2<A,B,vec_traits<A>::dim>::type
        operator-( A const & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        A & operator+=( A & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        typename deduce_vec2<A,B,vec_traits<A>::dim>::type
        operator+( A const & a, B const & b );        
        
        //Only enabled if: is_vec<A>::value && is_scalar<B>::value
        template <class A,class B>
        A & operator/=( A & a, B b );        
        
        //Only enabled if: is_vec<A>::value && is_scalar<B>::value
        template <class A,class B>
        typename deduce_vec<A>::type
        operator/( A const & a, B b );        
        
        //Only enabled if: is_vec<A>::value && is_scalar<B>::value
        template <class A,class B>
        A & operator*=( A & a, B b );        
        
        //Only enabled if: is_vec<A>::value && is_scalar<B>::value
        template <class A>
        typename deduce_vec<A>::type
        operator*( A const & a, B b );        
        
        //Only enabled if: is_scalar<A>::value && is_vec<B>::value
        template <class A>
        typename deduce_vec<B>::type
        operator*( A a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        bool operator==( A const & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        bool operator!=( A const & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B,class Cmp>
        bool cmp( A const & a, B const & b, Cmp pred );        
        
        //Only enabled if:
        //  is_vec<A>::value
        template <class A>
        typename vec_traits<A>::scalar_type
        mag_sqr( A const & a );        
        
        //Only enabled if:
        //  is_vec<A>::value
        template <class A>
        typename vec_traits<A>::scalar_type
        mag( A const & a );        
        
        //Only enabled if:
        //  is_vec<A>::value
        template <class A>
        typename deduce_vec<A>::type
        normalized( A const & a );        
        
        //Only enabled if:
        //  is_vec<A>::value
        template <class A>
        void normalize( A & a );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==vec_traits<B>::dim
        template <class A,class B>
        typename deduce_scalar<A,B>::type
        dot( A const & a, B const & b );        
        
        //Only enabled if:
        //  is_vec<A>::value && is_vec<B>::value &&
        //  vec_traits<A>::dim==3 && vec_traits<B>::dim==3
        template <class A,class B>
        typename deduce_vec2<A,B,3>::type
        cross( A const & a, B const & b );        
        
        template <class T,int S>
        -unspecified-return-type- zero_vec();        
        
        //Only enabled if:
        //  is_vec<A>::value
        template <class A>
        void set_zero( A & a );        
        
        //Only enabled if: is_vec<A>::value
        template <class A>
        -unspecified-return-type- vref( A & a );        
        
        //Only enabled if: is_vec<A>::value
        template <class Scalar,class A>
        -unspecified-return_type- scalar_cast( A const & a );
    }
}