Prev Next det_grad_33.hpp Headings

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@ This is cppad-20221105 documentation. Here is a link to its current documentation .
Source: det_grad_33
# ifndef CPPAD_DET_GRAD_33_HPP
# define CPPAD_DET_GRAD_33_HPP
# include <limits>
# include <cppad/utility/near_equal.hpp>
namespace CppAD {
template <class Vector>
    bool det_grad_33(const Vector &x, const Vector &g)
    {   bool ok = true;
        typedef typename Vector::value_type Float;
        Float eps = 10. * Float( std::numeric_limits<double>::epsilon() );

        // use expansion by minors to compute the derivative by hand
        double check[9];
        check[0] = + ( x[4] * x[8] - x[5] * x[7] );
        check[1] = - ( x[3] * x[8] - x[5] * x[6] );
        check[2] = + ( x[3] * x[7] - x[4] * x[6] );
        //
        check[3] = - ( x[1] * x[8] - x[2] * x[7] );
        check[4] = + ( x[0] * x[8] - x[2] * x[6] );
        check[5] = - ( x[0] * x[7] - x[1] * x[6] );
        //
        check[6] = + ( x[1] * x[5] - x[2] * x[4] );
        check[7] = - ( x[0] * x[5] - x[2] * x[3] );
        check[8] = + ( x[0] * x[4] - x[1] * x[3] );
        //
        for(size_t i = 0; i < 3 * 3; i++)
            ok &= CppAD::NearEqual(check[i], g[i], eps, eps);

        return ok;
    }
}
# endif

Input File: omh/det_grad_33_hpp.omh