MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / inverse_Fx

Method inverse_Fx

bayes/src/infRtFlt.cpp:129–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128
129void Information_root_scheme::inverse_Fx (FM::DenseColMatrix& invFx, const FM::Matrix& Fx)
130/* Numerical Inversion of Fx using LU factorisation
131 * Required LAPACK getrf (with PIVOTING) and getrs
132 */
133{
134 // LU factorise with pivots
135 DenseColMatrix FxLU (Fx);
136 LAPACK::pivot_t ipivot(FxLU.size1()); // Pivots initialised to zero
137 ipivot.clear();
138
139 int info = LAPACK::getrf(FxLU, ipivot);
140 if (info < 0)
141 error (Numeric_exception("Fx not LU factorisable"));
142
143 FM::identity(invFx); // Invert
144 info = LAPACK::getrs('N', FxLU, ipivot, invFx);
145 if (info != 0)
146 error (Numeric_exception("Predict Fx not LU invertable"));
147}
148
149
150

Callers

nothing calls this directly

Calls 6

getrfFunction · 0.85
errorFunction · 0.85
Numeric_exceptionClass · 0.85
identityFunction · 0.85
getrsFunction · 0.85
clearMethod · 0.80

Tested by

no test coverage detected