ADMB Documentation  11.2.2853
 All Classes Files Functions Variables Typedefs Friends Defines
Defines | Functions
dmat3.cpp File Reference

(* $Id: dmat3.cpp 789 2010-10-05 01:01:09Z johnoel $)

#include "fvar.hpp"
#include <math.h>

Go to the source code of this file.

Defines

#define ISZERO(d)   ((d)==0.0)
#define TINY   1.0e-20;
 A small number.
#define TINY   1.0e-50;
 A small number.

Functions

double det (const dmatrix &m1)
 Compute determinant of a constant matrix.
dmatrix inv (const dmatrix &m1)
 Inverse of a constant matrix by LU decomposition.
dmatrix inv (const dmatrix &m1, const double &_ln_det, const int &_sgn)
 Inverse of a constant matrix by LU decomposition.
double ln_det (const dmatrix &m1, const int &_sgn)
 Compute log determinant of a constant matrix.
void lubksb (dmatrix a, const ivector &indx, dvector b)
 LU decomposition back susbstitution alogrithm for constant object.
void ludcmp (const dmatrix &_a, const ivector &_indx, const double &_d)
 Lu decomposition of a constant matrix.
void ludcmp_det (const dmatrix &_a, const ivector &_indx, const double &_d)
 LU decomposition.
void ludcmp_index (const dmatrix &_a, const ivector &_indx, const double &_d)
 LU decomposition.

Define Documentation

#define ISZERO (   d)    ((d)==0.0)
Id:
dmat3.cpp 789 2010-10-05 01:01:09Z johnoel

Author: David Fournier Copyright (c) 2009-2012 ADMB Foundation

Definition at line 16 of file dmat3.cpp.

Referenced by lubksb().

#define TINY   1.0e-20;

A small number.

Used to avoid divide by zero in the LU decomposition. Locally defined, undefined, redefined and undefined in this file.

Definition at line 273 of file dmat3.cpp.

Referenced by ludcmp(), ludcmp_det(), and ludcmp_index().

#define TINY   1.0e-50;

A small number.

Used to avoid divide by zero in the LU decomposition. Locally defined, undefined, redefined and undefined in this file.

Definition at line 273 of file dmat3.cpp.


Function Documentation

dmatrix inv ( const dmatrix m1,
const double &  _ln_det,
const int &  _sgn 
)

Inverse of a constant matrix by LU decomposition.

Parameters:
m1A dmatrix, $M$, for which the inverse is to be computed.
_ln_detOn return contains $|\log M|$
_sign
Returns:
A dmatrix containing $M^{-1}$.

The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 2

Definition at line 89 of file dmat3.cpp.

double ln_det ( const dmatrix m1,
const int &  _sgn 
)
void lubksb ( dmatrix  a,
const ivector indx,
dvector  b 
)

LU decomposition back susbstitution alogrithm for constant object.

\param a A dmatrix containing LU decomposition of input matrix. \form#0.
\param indx Permutation vector from ludcmp.
\param b A dvector containing the RHS, \form#1 of the linear equation

$A\cdot X = B$, to be solved, and containing on return the solution vector $X$.



The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 2

Deprecated:
Scheduled for replacement by 2010.

Definition at line 391 of file dmat3.cpp.

Referenced by inv(), and solve().

void ludcmp ( const dmatrix _a,
const ivector _indx,
const double &  _d 
)

Lu decomposition of a constant matrix.

Parameters:
_aA dmatrix; replaced by the by its resulting LU decomposition
_indxAn ivector containing the row permutations generated by partial pivoting
_dA double containing -1 or +1 depending whether the number of row interchanges was even or odd, repectively.

The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 2

Definition at line 174 of file dmat3.cpp.

Referenced by inv(), ln_det(), ludcmp(), and solve().

void ludcmp_det ( const dmatrix _a,
const ivector _indx,
const double &  _d 
)

LU decomposition.

Used to set up determinant computation.

Parameters:
_aA dmatrix; replaced by the by its resulting LU decomposition
_indxAn ivector containing the row permutations generated by partial pivoting
_dA double containing -1 or +1 depending whether the number of row interchanges was even or odd, repectively.

The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 2

Definition at line 283 of file dmat3.cpp.

Referenced by det(), and ln_det().

void ludcmp_index ( const dmatrix _a,
const ivector _indx,
const double &  _d 
)

LU decomposition.

Deprecated:
This function may be completely unused?
\n\n The implementation of this algorithm was inspired by
"Numerical Recipes in C", 2nd edition,
Press, Teukolsky, Vetterling, Flannery, chapter 2

Definition at line 539 of file dmat3.cpp.