예제 #1
0
def logdet_dense_chol(R,U,rows,cols):
  if not is_psd_dense(R, U, rows, cols):
    return -np.Inf
  X = build_dense(R, U, rows, cols)
  C = linalg.cholesky(X).diagonal()
  return np.sum(np.log(C))*2
예제 #2
0
def logdet_dense(R,U,rows,cols):
  if not is_psd_dense(R, U, rows, cols):
    return -np.Inf
  X = build_dense(R, U, rows, cols)
  eis = linalg.eigvalsh(X)
  return np.sum(np.log(eis))