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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

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.