copy upper triangular part of a symmetric pd matrix to its lower triangular part after finding inverse

问题内容:

I want to find the inverse of a symmetric positive definite matrix. I am using lapack’s “dpotri” subroutine which uses Cholesky decomposition to find the inverse. However it returns the same matrix with upper or lower part modified to contain the inverse elements. Let us say I choose the UPLO=’U’ thus saving inverse elements to upper triangular part. I believe the lower part still contains the earlier elements.

My question is how to copy the upper part to lower part or vice-versa in the most efficient way? Is there a lapack/Blas routine to do so ? I am programming in C.

问题评论:

    
Smells like simple for loop(s).
    
@Paul: Yes, it can be done by for loops. But I was thinking about some fast vectorized code or some cache friendly code. Lapack/Blas generally have such properties.
– user402940
13 mins ago

原文地址:

https://stackoverflow.com/questions/47754222/copy-upper-triangular-part-of-a-symmetric-pd-matrix-to-its-lower-triangular-part

Tags:, ,

添加评论