Prev Next

@(@\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}} }@)@
Check Determinant of 3 by 3 matrix

# include <cppad/speed/det_33.hpp>
ok = det_33(xd)

This routine can be used to check a method for computing the determinant of a matrix.

The template function det_33 is defined in the CppAD namespace by including the file cppad/speed/det_33.hpp (relative to the CppAD distribution directory).

The argument x has prototype
Vector &x
. It contains the elements of the matrix @(@ X @)@ in row major order; i.e., @[@ X_{i,j} = x [ i * 3 + j ] @]@

The argument d has prototype
Vector &d
. It is tested to see if d[0] it is equal to @(@ \det ( X ) @)@.

If y is a Vector object, it must support the syntax
where i has type size_t with value less than 9. This must return a double value corresponding to the i-th element of the vector y . This is the only requirement of the type Vector . (Note that only the first element of the vector d is used.)

The return value ok has prototype
It is true, if the determinant d[0] passes the test and false otherwise.

Source Code
The file det_33.hpp contains the source code for this template function.
Input File: cppad/speed/det_33.hpp