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

Function UdUinversePD

bayes/src/UdU.cpp:820–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818}
819
820SymMatrix::value_type UdUinversePD (SymMatrix& M)
821/* Inverse of Positive Definite matrix
822 * Input:
823 * M is a symmetric matrix
824 * Output:
825 * M inverse of M, only updated if return value >0
826 * Return:
827 * reciprocal condition number, -1 if negative, 0 if semi-definite (including zero)
828 */
829{
830 // Abuse as a RowMatrix
831 RowMatrix& M_matrix = M.asRowMatrix();
832 SymMatrix::value_type rcond = UdUfactor (M_matrix, M_matrix.size1());
833 // Only invert and recompose if PD
834 if (rcond > 0) {
835 bool singular = UdUinverse (M_matrix);
836 assert (!singular); (void)singular;
837 UdUrecompose_transpose (M_matrix);
838 }
839 return rcond;
840}
841
842SymMatrix::value_type UdUinversePD (SymMatrix& M, SymMatrix::value_type& detM)
843/* As above but also computes determinant of original M if M is PSD

Callers 9

observeMethod · 0.85
observeMethod · 0.85
observe_innovationMethod · 0.85
initMethod · 0.85
updateMethod · 0.85
predictMethod · 0.85
observe_innovationMethod · 0.85
observe_innovationMethod · 0.85
LzMethod · 0.85

Calls 4

UdUinverseFunction · 0.85
UdUrecompose_transposeFunction · 0.85
UdUdetFunction · 0.85
UdUfactorFunction · 0.70

Tested by

no test coverage detected