Mercurial > octave
comparison libinterp/corefcn/__qp__.cc @ 21269:3c8a3d35661a
better use of templates for Cholesky factorization
* liboctave/numeric/chol.h, liboctave/numeric/chol.cc: New files
generated from CmplxCHOL.cc, fCmplxCHOL.cc, floatCHOL.cc, CmplxCHOL.h,
dbleCHOL.cc, dbleCHOL.h, fCmplxCHOL.h, and floatCHOL.h and converted
to templates.
* liboctave/numeric/module.mk: Update.
* __qp__.cc, chol.cc, CMatrix.cc, CMatrix.h, dMatrix.cc, dMatrix.h,
fCMatrix.cc, fCMatrix.h, fMatrix.cc, fMatrix.h, eigs-base.cc,
mx-defs.h, mx-ext.h: Use new classes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 16 Feb 2016 02:47:29 -0500 |
parents | fcac5dbbf9ed |
children | cbced1c09916 |
comparison
equal
deleted
inserted
replaced
21268:f08ae27289e4 | 21269:3c8a3d35661a |
---|---|
24 # include <config.h> | 24 # include <config.h> |
25 #endif | 25 #endif |
26 | 26 |
27 #include <cfloat> | 27 #include <cfloat> |
28 | 28 |
29 #include "dbleCHOL.h" | 29 #include "chol.h" |
30 #include "dbleSVD.h" | 30 #include "dbleSVD.h" |
31 #include "mx-m-dm.h" | 31 #include "mx-m-dm.h" |
32 #include "EIG.h" | 32 #include "EIG.h" |
33 | 33 |
34 #include "defun.h" | 34 #include "defun.h" |
189 { | 189 { |
190 // Inverting the Hessian. Using the Cholesky | 190 // Inverting the Hessian. Using the Cholesky |
191 // factorization since the Hessian is positive | 191 // factorization since the Hessian is positive |
192 // definite. | 192 // definite. |
193 | 193 |
194 CHOL cholH (H); | 194 chol<Matrix> cholH (H); |
195 | 195 |
196 R = cholH.chol_matrix (); | 196 R = cholH.chol_matrix (); |
197 | 197 |
198 Matrix Hinv = chol2inv (R); | 198 Matrix Hinv = chol2inv (R); |
199 | 199 |
248 if (dimZ > 0) | 248 if (dimZ > 0) |
249 { | 249 { |
250 // Computing the Cholesky factorization (pR = 0 means | 250 // Computing the Cholesky factorization (pR = 0 means |
251 // that the reduced Hessian was positive definite). | 251 // that the reduced Hessian was positive definite). |
252 | 252 |
253 CHOL cholrH (rH, pR); | 253 chol<Matrix> cholrH (rH, pR); |
254 Matrix tR = cholrH.chol_matrix (); | 254 Matrix tR = cholrH.chol_matrix (); |
255 if (pR == 0) | 255 if (pR == 0) |
256 R = tR; | 256 R = tR; |
257 } | 257 } |
258 | 258 |