pint.utils.woodbury_dot
- pint.utils.woodbury_dot(Ndiag, U, Phidiag, x, y)[source]
- Compute an inner product of the form
(x| C^-1 |y)
- where
C = N + U Phi U^T ,
N and Phi are diagonal matrices, using the Woodbury identity
C^-1 = N^-1 - N^-1 - N^-1 U Sigma^-1 U^T N^-1
- where
Sigma = Phi^-1 + U^T N^-1 U
- Additionally,
det[C] = det[N] * det[Phi] * det[Sigma]
Paremeters
- Ndiag: array-like
Diagonal elements of the diagonal matrix N
- U: array-like
A matrix that represents a rank-n update to N
- Phidiag: float
Weights associated with the rank-n update
- x: array-like
Vector 1 for the inner product
- y: array-like
Vector 2 for the inner product
- returns:
result (float) – The inner product
logdetC (float) – log-determinant of C