Hello,
I am computing a positive definite matrix H (in my case it is a Hessian) and I would like to transform it into another basis according to P^THP with P an upper triangular matrix. Is there an optimized routine to do this, i.e. better than mul!(H, P', H); mul!(H, H, P)
The construction of H
and P
is not relevant here, it’s just to have a working example.
using LinearAlgebra
using Statistics
X = randn(1000, 200)
Y = randn(1000, 200)
H = cov(X)+I
P = UpperTriangular(qr(cov(Y)+I).R)
mul!(H, P', H)
mul!(H, H, P)