# QVM: Quaternions, Vectors, Matrices

### inverse(mat)

#include <boost/qvm/mat_operations.hpp>

    namespace boost
    {
        namespace qvm
        {
            //Only enabled if:
            //  is_mat<A>::value && is_scalar<B>::value
            //  mat_traits<A>::rows==mat_traits<A>::cols

            template <class A,class B>
            typename deduce_mat<A>::type
            inverse( A const & a, B det );

            template <class A>
            typename deduce_mat<A>::type
            inverse( A const & a );
        }
    }

#### Preconditions:

det!=scalar_traits<typename mat_traits<A>::scalar_type>::value(0)

#### Returns:

Both overloads compute the inverse of a. The first overload takes the pre-computed determinant of a.

#### Throws:

The second overload computes the determinant automatically and throws zero_determinant_error if the computed determinant is zero.

See also: boost/qvm/mat_operations.hpp