<?xml version='1.0'?> <?xml-stylesheet type='text/xsl' href='pmathml.xsl'?> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>Determinant Using Expansion by Minors</title> <meta name="description" id="description" content="Determinant Using Expansion by Minors"/> <meta name="keywords" id="keywords" content=" determinant minor expansion "/> <style type='text/css'> body { color : black } body { background-color : white } A:link { color : blue } A:visited { color : purple } A:active { color : purple } </style> <script type='text/javascript' language='JavaScript' src='_det_by_minor_xml.js'> </script> </head> <body> <table><tr> <td> <a href="http://www.coin-or.org/CppAD/" target="_top"><img border="0" src="_image.gif"/></a> </td> <td><a href="det_of_minor.hpp.xml" target="_top">Prev</a> </td><td><a href="det_by_minor.cpp.xml" target="_top">Next</a> </td><td> <select onchange='choose_across0(this)'> <option>Index-></option> <option>contents</option> <option>reference</option> <option>index</option> <option>search</option> <option>external</option> </select> </td> <td> <select onchange='choose_up0(this)'> <option>Up-></option> <option>CppAD</option> <option>Appendix</option> <option>speed</option> <option>speed_utility</option> <option>det_by_minor</option> </select> </td> <td> <select onchange='choose_down3(this)'> <option>Appendix-></option> <option>Faq</option> <option>speed</option> <option>Theory</option> <option>glossary</option> <option>Bib</option> <option>Bugs</option> <option>WishList</option> <option>whats_new</option> <option>include_deprecated</option> <option>License</option> </select> </td> <td> <select onchange='choose_down2(this)'> <option>speed-></option> <option>speed_main</option> <option>speed_utility</option> <option>speed_double</option> <option>speed_adolc</option> <option>speed_cppad</option> <option>speed_fadbad</option> <option>speed_sacado</option> </select> </td> <td> <select onchange='choose_down1(this)'> <option>speed_utility-></option> <option>uniform_01</option> <option>det_of_minor</option> <option>det_by_minor</option> <option>det_by_lu</option> <option>det_33</option> <option>det_grad_33</option> <option>ode_evaluate</option> <option>sparse_evaluate</option> </select> </td> <td> <select onchange='choose_down0(this)'> <option>det_by_minor-></option> <option>det_by_minor.cpp</option> <option>det_by_minor.hpp</option> </select> </td> <td> <select onchange='choose_current0(this)'> <option>Headings-></option> <option>Syntax</option> <option>Inclusion</option> <option>Constructor</option> <option>Scalar</option> <option>n</option> <option>det</option> <option>---..a</option> <option>---..d</option> <option>Vector</option> <option>Example</option> <option>Source Code</option> </select> </td> </tr></table><br/> <center><b><big><big>Determinant Using Expansion by Minors</big></big></b></center> <br/> <b><big><a name="Syntax" id="Syntax">Syntax</a></big></b> <br/> <code><font color="blue"><span style='white-space: nowrap'># include <cppad/speed/det_by_minor.hpp><br/> </span></font></code><code><font color="blue"><span style='white-space: nowrap'>det_by_minor<</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>> </span></font></code><i><span style='white-space: nowrap'>det</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>n</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/> </span></font></code><code><font color="blue"></font></code><i><span style='white-space: nowrap'>d</span></i><code><font color="blue"><span style='white-space: nowrap'> = </span></font></code><i><span style='white-space: nowrap'>det</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/> </span></font></code><br/> <b><big><a name="Inclusion" id="Inclusion">Inclusion</a></big></b> <br/> The template class <code><font color="blue">det_by_minor</font></code> is defined in the <code><font color="blue">CppAD</font></code> namespace by including the file <code><font color="blue">cppad/speed/det_by_minor.hpp</font></code> (relative to the CppAD distribution directory). It is only intended for example and testing purposes, so it is not automatically included by <a href="cppad.xml" target="_top"><span style='white-space: nowrap'>cppad.hpp</span></a> . <br/> <br/> <b><big><a name="Constructor" id="Constructor">Constructor</a></big></b> <br/> The syntax <code><font color="blue"><span style='white-space: nowrap'><br/>      det_by_minor<</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>> </span></font></code><i><span style='white-space: nowrap'>det</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>n</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/> </span></font></code>constructs the object <i>det</i> which can be used for evaluating the determinant of <i>n</i> by <i>n</i> matrices using expansion by minors. <br/> <br/> <b><big><a name="Scalar" id="Scalar">Scalar</a></big></b> <br/> The type <i>Scalar</i> must satisfy the same conditions as in the function <a href="det_of_minor.xml#Scalar" target="_top"><span style='white-space: nowrap'>det_of_minor</span></a> . <br/> <br/> <b><big><a name="n" id="n">n</a></big></b> <br/> The argument <i>n</i> has prototype <code><font color="blue"><span style='white-space: nowrap'><br/>      size_t </span></font></code><i><span style='white-space: nowrap'>n</span></i><code><font color="blue"><span style='white-space: nowrap'><br/> </span></font></code><br/> <b><big><a name="det" id="det">det</a></big></b> <br/> The syntax <code><font color="blue"><span style='white-space: nowrap'><br/>      </span></font></code><i><span style='white-space: nowrap'>d</span></i><code><font color="blue"><span style='white-space: nowrap'> = </span></font></code><i><span style='white-space: nowrap'>det</span></i><code><font color="blue"><span style='white-space: nowrap'>(</span></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/> </span></font></code>returns the determinant of the matrix <i>A</i> using expansion by minors. <br/> <br/> <b><a name="det.a" id="det.a">a</a></b> <br/> The argument <i>a</i> has prototype <code><font color="blue"><span style='white-space: nowrap'><br/>      const </span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'> &</span></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'><br/> </span></font></code>It must be a <i>Vector</i> with length <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>n</mi> <mo stretchy="false">*</mo> <mi mathvariant='italic'>n</mi> </mrow></math> and with elements of type <i>Scalar</i>. The elements of the <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>n</mi> <mo stretchy="false">×</mo> <mi mathvariant='italic'>n</mi> </mrow></math> matrix <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>A</mi> </mrow></math> are defined, for <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>i</mi> <mo stretchy="false">=</mo> <mn>0</mn> <mo stretchy="false">,</mo> <mo stretchy="false">…</mo> <mo stretchy="false">,</mo> <mi mathvariant='italic'>n</mi> <mn>-1</mn> </mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>j</mi> <mo stretchy="false">=</mo> <mn>0</mn> <mo stretchy="false">,</mo> <mo stretchy="false">…</mo> <mo stretchy="false">,</mo> <mi mathvariant='italic'>n</mi> <mn>-1</mn> </mrow></math> , by <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow> <msub><mi mathvariant='italic'>A</mi> <mrow><mi mathvariant='italic'>i</mi> <mo stretchy="false">,</mo> <mi mathvariant='italic'>j</mi> </mrow> </msub> <mo stretchy="false">=</mo> <mi mathvariant='italic'>a</mi> <mo stretchy="false">[</mo> <mi mathvariant='italic'>i</mi> <mo stretchy="false">*</mo> <mi mathvariant='italic'>m</mi> <mo stretchy="false">+</mo> <mi mathvariant='italic'>j</mi> <mo stretchy="false">]</mo> </mrow></math> <br/> <b><a name="det.d" id="det.d">d</a></b> <br/> The return value <i>d</i> has prototype <code><font color="blue"><span style='white-space: nowrap'><br/>      </span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'> </span></font></code><i><span style='white-space: nowrap'>d</span></i><code><font color="blue"><span style='white-space: nowrap'><br/> </span></font></code>It is equal to the determinant of <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>A</mi> </mrow></math> . <br/> <br/> <b><big><a name="Vector" id="Vector">Vector</a></big></b> <br/> If <i>y</i> is a <i>Vector</i> object, it must support the syntax <code><font color="blue"><span style='white-space: nowrap'><br/>      </span></font></code><i><span style='white-space: nowrap'>y</span></i><code><font color="blue"><span style='white-space: nowrap'>[</span></font></code><i><span style='white-space: nowrap'>i</span></i><code><font color="blue"><span style='white-space: nowrap'>]<br/> </span></font></code>where <i>i</i> has type <code><font color="blue">size_t</font></code> with value less than <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow> <mi mathvariant='italic'>n</mi> <mo stretchy="false">*</mo> <mi mathvariant='italic'>n</mi> </mrow></math> . This must return a <i>Scalar</i> value corresponding to the <i>i</i>-th element of the vector <i>y</i>. This is the only requirement of the type <i>Vector</i>. <br/> <br/> <b><big><a name="Example" id="Example">Example</a></big></b> <br/> The file <a href="det_by_minor.cpp.xml" target="_top"><span style='white-space: nowrap'>det_by_minor.cpp</span></a> contains an example and test of <code><font color="blue">det_by_minor.hpp</font></code>. It returns true if it succeeds and false otherwise. <br/> <br/> <b><big><a name="Source Code" id="Source Code">Source Code</a></big></b> <br/> The file <a href="det_by_minor.hpp.xml" target="_top"><span style='white-space: nowrap'>det_by_minor.hpp</span></a> contains the source for this template function. <hr/>Input File: cppad/speed/det_by_minor.hpp </body> </html>