code: def fast_cholesky_invert(A,logdet=False,tiny=_TINY):
      
      L= stable_cho_factor(A,tiny=tiny)
      if logdet:
          return (linalg.cho_solve(L,numpy.eye(A.shape[0])),
                  2.*numpy.sum(numpy.log(numpy.diag(L[0]))))
      else:
          return linalg.cho_solve(L,numpy.eye(A.shape[0]))
docs: NAME:
         fast_cholesky_invert
      PURPOSE:
         invert a positive definite matrix by using its Cholesky decomposition
      INPUT:
         A - matrix to be inverted
         logdet - (Bool) if True, return the logarithm of the determinant as well
         tiny - (double) tiny number to add to the covariance matrix to make the decomposition stable (has a default)
      OUTPUT:
         A^{-1}
      REVISION HISTORY:
         2009-10-07 - Written - Bovy (NYU)