# 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 );
        }
    }

See also: assign(vec,vec) | boost/qvm/operations.hpp | boost/qvm/vec_operations2.hpp | boost/qvm/vec_operations3.hpp | boost/qvm/vec_operations4.hpp | Code Generator | cmp(vec,vec) | convert_to(vec) | cross | dot(vec,vec) | mag(vec) | mag_sqr(vec) | normalize(vec) | normalized(vec) | operator!=(vec,vec) | operator*(scalar,vec) | operator*(vec,scalar) | operator*=(vec,scalar) | operator+(vec,vec) | operator+=(vec,vec) | operator-(vec) | operator-(vec,vec) | operator-=(vec,vec) | operator/(vec,scalar) | operator/=(vec,scalar) | operator==(vec,vec) | scalar_cast(vec) | set_zero(vec) | vref | zero_vec