Method

NumCosmoMathMatrixnearPD

Declaration [src]

gint
ncm_matrix_nearPD (
  NcmMatrix* cm,
  gchar UL,
  gboolean cholesky_decomp,
  const guint maxiter
)

Description [src]

Assuming that cm is a symmetric matrix with data on UL side, computes the nearest positive definite matrix in the Frobenius norm. See [Higham (2002)][XHigham2002]. The iterations stop when the Cholesky decomposition is valid.

Parameters

UL

Type: gchar

Char indicating ‘U’pper or ‘L’ower matrix.

cholesky_decomp

Type: gboolean

If true substitue cm for its Cholesky decomposition.

maxiter

Type: const guint

Maximum number of iterations.

Return value

Type: gint

The return value of the last Cholesky decomposition.