<?xml version='1.0'?>
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:math='http://www.w3.org/1998/Math/MathML'
>
<head>
<title>Determinant of a Minor</title>
<meta name="description" id="description" content="Determinant of a Minor"/>
<meta name="keywords" id="keywords" content=" det_of_minor determinant matrix minor "/>
<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_of_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_by_lu.hpp.xml" target="_top">Prev</a>
</td><td><a href="det_of_minor.cpp.xml" target="_top">Next</a>
</td><td>
<select onchange='choose_across0(this)'>
<option>Index-&gt;</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-&gt;</option>
<option>CppAD</option>
<option>speed</option>
<option>speed_utility</option>
<option>det_of_minor</option>
</select>
</td>
<td>
<select onchange='choose_down3(this)'>
<option>CppAD-&gt;</option>
<option>Install</option>
<option>Introduction</option>
<option>AD</option>
<option>ADFun</option>
<option>preprocessor</option>
<option>multi_thread</option>
<option>library</option>
<option>ipopt_solve</option>
<option>Example</option>
<option>speed</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>speed-&gt;</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-&gt;</option>
<option>det_by_lu</option>
<option>det_of_minor</option>
<option>det_by_minor</option>
<option>det_33</option>
<option>det_grad_33</option>
<option>mat_sum_sq</option>
<option>ode_evaluate</option>
<option>sparse_jac_fun</option>
<option>sparse_hes_fun</option>
<option>uniform_01</option>
</select>
</td>
<td>
<select onchange='choose_down0(this)'>
<option>det_of_minor-&gt;</option>
<option>det_of_minor.cpp</option>
<option>det_of_minor.hpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>Inclusion</option>
<option>Purpose</option>
<option>Determinant of A</option>
<option>a</option>
<option>m</option>
<option>n</option>
<option>r</option>
<option>c</option>
<option>d</option>
<option>Scalar</option>
<option>Example</option>
<option>Source Code</option>
</select>
</td>
</tr></table><br/>








<center><b><big><big>Determinant of a Minor</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'>#&#xA0;include&#xA0;&lt;cppad/speed/det_of_minor.hpp&gt;<br/>
</span></font></code>

<code><i><font color="black"><span style='white-space: nowrap'>d</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;det_of_minor(</span></font><i><font color="black"><span style='white-space: nowrap'>a</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>m</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>n</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>r</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>c</span></font></i><font color="blue"><span style='white-space: nowrap'>)</span></font></code>
 


<br/>
<br/>
<b><big><a name="Inclusion" id="Inclusion">Inclusion</a></big></b>
<br/>
The template function <code><font color="blue">det_of_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_of_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="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
This template function
returns the determinant of a minor of the matrix 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>A</mi>
</mrow></math>


using expansion by minors.
The elements of the 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">&#x000D7;</mo>
<mi mathvariant='italic'>n</mi>
</mrow></math>

 minor 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>M</mi>
</mrow></math>

 
of the 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">&#x02026;</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">&#x02026;</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'>M</mi>
<mrow><mi mathvariant='italic'>i</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>j</mi>
</mrow>
</msub>
<mo stretchy="false">=</mo>
<msub><mi mathvariant='italic'>A</mi>
<mrow><mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">)</mo>
</mrow>
</msub>
</mrow></math>

where the functions 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 is defined by the <a href="det_of_minor.xml#r" target="_top"><span style='white-space: nowrap'>argument&#xA0;r</span></a>
 and

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 is defined by the <a href="det_of_minor.xml#c" target="_top"><span style='white-space: nowrap'>argument&#xA0;c</span></a>
.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>This template function
is for example and testing purposes only.
Expansion by minors is chosen as an example because it uses
a lot of floating point operations yet does not require much source code
(on the order of 
<code><i><font color="black"><span style='white-space: nowrap'>m</span></font></i></code>
 factorial floating point operations and 
about 70 lines of source code including comments).
This is not an efficient method for computing a determinant;
for example, using an LU factorization would be better.

<br/>
<br/>
<b><big><a name="Determinant of A" id="Determinant of A">Determinant of A</a></big></b>
<br/>
If the following conditions hold, the minor is the
entire matrix 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>A</mi>
</mrow></math>

 and hence <code><font color="blue">det_of_minor</font></code>
will return the determinant of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>A</mi>
</mrow></math>

:

<ol type="1"><li>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>m</mi>
</mrow></math>

.
</li><li>

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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow></math>

, 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>r</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

, 
and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>r</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
</mrow></math>

.
</li><li>

for 
<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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow></math>

, 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>c</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

,
and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>c</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
</mrow></math>

.
</li></ol>


<br/>
<br/>
<b><big><a name="a" id="a">a</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>a</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;std::vector&lt;</span></font><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i><font color="blue"><span style='white-space: nowrap'>&gt;&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>a</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is a vector with size 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">*</mo>
<mi mathvariant='italic'>m</mi>
</mrow></math>


(see description of <a href="det_of_minor.xml#Scalar" target="_top"><span style='white-space: nowrap'>Scalar</span></a>
 below).
The elements of the 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">&#x000D7;</mo>
<mi mathvariant='italic'>m</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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</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><big><a name="m" id="m">m</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>m</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>m</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is the number of rows (and columns) in the square matrix 
<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="n" id="n">n</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>n</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>n</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is the number of rows (and columns) in the square minor 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>M</mi>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="r" id="r">r</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>r</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;std::vector&lt;size_t&gt;&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>r</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is a vector with 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

 elements.
This vector defines the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
which specifies the rows of the minor 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>M</mi>
</mrow></math>

.
To be specific, the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>n</mi>
<mn>-1</mn>
</mrow></math>

 is defined by 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>r</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">]</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>r</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>R</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
</mtd></mtr></mtable>
</mrow></math>

All the elements of 
<code><i><font color="black"><span style='white-space: nowrap'>r</span></font></i></code>
 must have value
less than or equal 
<code><i><font color="black"><span style='white-space: nowrap'>m</span></font></i></code>
.
The elements of vector 
<code><i><font color="black"><span style='white-space: nowrap'>r</span></font></i></code>
 are modified during the computation, 
and restored to their original value before the return from
<code><font color="blue">det_of_minor</font></code>.

<br/>
<br/>
<b><big><a name="c" id="c">c</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>c</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;std::vector&lt;size_t&gt;&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>c</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is a vector with 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

 elements
This vector defines the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
which specifies the rows of the minor 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>M</mi>
</mrow></math>

.
To be specific, the function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 
for 
<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">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>n</mi>
<mn>-1</mn>
</mrow></math>

 is defined by 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>c</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">]</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>c</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>C</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
</mtd></mtr></mtable>
</mrow></math>

All the elements of 
<code><i><font color="black"><span style='white-space: nowrap'>c</span></font></i></code>
 must have value
less than or equal 
<code><i><font color="black"><span style='white-space: nowrap'>m</span></font></i></code>
.
The elements of vector 
<code><i><font color="black"><span style='white-space: nowrap'>c</span></font></i></code>
 are modified during the computation, 
and restored to their original value before the return from
<code><font color="blue">det_of_minor</font></code>.

<br/>
<br/>
<b><big><a name="d" id="d">d</a></big></b>
<br/>
The result 
<code><i><font color="black"><span style='white-space: nowrap'>d</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>d</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and is equal to the determinant of the minor 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>M</mi>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="Scalar" id="Scalar">Scalar</a></big></b>
<br/>
If 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 and 
<code><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>
 are objects of type 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>

and 
<code><i><font color="black"><span style='white-space: nowrap'>i</span></font></i></code>
 is an object of type <code><font color="blue">int</font></code>,
the 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>
 must support the following operations:
<table><tr><td align='left'  valign='top'>

<b>Syntax</b> 
	</td><td align='left'  valign='top'>
 <b>Description</b>
	</td><td align='left'  valign='top'>
 <b>Result Type</b>
</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>

	</td><td align='left'  valign='top'>
 default constructor for 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>
 object.
</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>i</span></font></i></code>

	</td><td align='left'  valign='top'>
 set value of 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 to current value of 
<code><i><font color="black"><span style='white-space: nowrap'>i</span></font></i></code>

</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 set value of 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 to current value of 
<code><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;+&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 value of 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 plus 
<code><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>

</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;-&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 value of 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 minus 
<code><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>

</td></tr><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;*&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 value of 
<code><i><font color="black"><span style='white-space: nowrap'>x</span></font></i></code>
 times value of 
<code><i><font color="black"><span style='white-space: nowrap'>y</span></font></i></code>

	</td><td align='left'  valign='top'>
 
<code><i><font color="black"><span style='white-space: nowrap'>Scalar</span></font></i></code>

</td></tr>
</table>
<br/>
<b><big><a name="Example" id="Example">Example</a></big></b>
<br/>
The file
<a href="det_of_minor.cpp.xml" target="_top"><span style='white-space: nowrap'>det_of_minor.cpp</span></a>
 
contains an example and test of <code><font color="blue">det_of_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_of_minor.hpp.xml" target="_top"><span style='white-space: nowrap'>det_of_minor.hpp</span></a>
 
contains the source for this template function.



<hr/>Input File: cppad/speed/det_of_minor.hpp

</body>
</html>
