ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
dmat3.cpp File Reference

(Last Changed on July 19, 2022 for git-revision ba1be198731ff7b506f755c2cbf37a659af0cdb1.)

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

Go to the source code of this file.

Macros

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

Functions

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

Macro Definition 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 17 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 334 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 334 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 114 of file dmat3.cpp.

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

LU decomposition back susbstitution alogrithm for constant object.

Parameters
aA dmatrix containing LU decomposition of input matrix. $a$.
indxPermutation vector from ludcmp.
bA dvector containing the RHS, $b$ 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

Definition at line 455 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 221 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 344 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?



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

Definition at line 613 of file dmat3.cpp.