Revision 795 branches/replacement/src/linad99/ludcmp_solve.cpp
ludcmp_solve.cpp (revision 795)  

3  3 
* 
4  4 
* Copyright (c) 2009 ADMB Foundation 
5  5 
*/ 
6 
/** 

7 
* \file 

8 
* This file contains the routines necessary to solve 

9 
* a linear system of equations given in Matrixvector form 

10 
*/ 

6  11  
7  12 
#include <ludcmp.hpp> 
8  13  
...  ...  
88  93 
return x; 
89  94 
} 
90  95  
91  
92  96 
/** Solve a linear system using LU decomposition. 
93  97 
\param aa A dvar_matrix containing LU decomposition of input matrix. \f$a\f$. 
94  98 
\param z A dvar_vector containing the RHS, \f$b\f$ of the linear equation 
...  ...  
267  271 
dfz.save_dvector_derivatives(z_pos); 
268  272 
} 
269  273  
270 
//can improve this 

274 
/** 

275 
* Solve a linear system using LU decomposition. 

276 
* \param aa A dvar_matrix containing LU decomposition of input matrix. \f$A\f$. 

277 
* \param z A dvar_vector containing the RHS, \f$b\f$ of the linear equation 

278 
* \param ln_unsigned_det holds the logdeterminant on return 

279 
* \param _sign the sign of the lo 

280 
* \f$A\cdot X = B\f$, to be solved. 

281 
* \return A dvar_vector containing solution vector \f$X\f$. 

282 
* \return The logdeterminant of \f$A\f$. 

283 
*/ 

271  284 
dvar_vector solve(const dvar_matrix & aa, const dvar_vector & z, 
272  285 
prevariable & ln_unsigned_det, 
273  286 
const prevariable & _sign) 
Also available in: Unified diff