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

Function isPSD

bayes/src/matSup.cpp:54–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54bool isPSD (const SymMatrix &M)
55/* Check a Matrix is both Symetric and Positive Semi Definite
56 * Creates a temporary copy
57 *
58 * Numerics of Algorithm:
59 * Use UdUfactor and checks reciprocal condition number >=0
60 * Algorithms using UdUfactor will will therefore succeed if isPSD(M) is true
61 * Do NOT assume because isPSD is true that M will appear to be PSD to other numerical algorithms
62 * Return:
63 * true iff M isSymetric and is PSD by the above algorithm
64 */
65{
66 RowMatrix UD(M.size1(),M.size1());
67
68 RowMatrix::value_type rcond = UdUfactor(UD, M);
69 return rcond >= 0.;
70}
71
72
73bool isSymmetric (const Matrix &M)

Callers 6

initMethod · 0.85
initMethod · 0.85
assert_isPSDFunction · 0.85
initMethod · 0.85
init_yYMethod · 0.85
initMethod · 0.85

Calls 1

UdUfactorFunction · 0.70

Tested by

no test coverage detected