#NEWLINE# @ property #NEWLINE# def woodbury_inv( self ) : #NEWLINE# #INDENT# '\n        The inverse of the woodbury matrix, in the gaussian likelihood case it is defined as\n        $$\n        (K_{xx} + \\Sigma_{xx})^{-1}\n        \\Sigma_{xx} := \texttt{Likelihood.variance / Approximate likelihood covariance}\n        $$\n        ' #NEWLINE# if ( self . _woodbury_inv is None ) : #NEWLINE# #INDENT# if ( self . _woodbury_chol is not None ) : #NEWLINE# #INDENT# ( self . _woodbury_inv , _ ) = dpotri ( self . _woodbury_chol , lower = 1 ) #NEWLINE# symmetrify ( self . _woodbury_inv ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . _covariance is not None ) : #NEWLINE# #INDENT# B = ( np . atleast_3d ( self . _K ) - np . atleast_3d ( self . _covariance ) ) #NEWLINE# self . _woodbury_inv = np . empty_like ( B ) #NEWLINE# for i in range ( B . shape [ ( - 1 ) ] ) : #NEWLINE# #INDENT# ( tmp , _ ) = dpotrs ( self . K_chol , B [ : , : , i ] ) #NEWLINE# ( self . _woodbury_inv [ : , : , i ] , _ ) = dpotrs ( self . K_chol , tmp . T ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return self . _woodbury_inv