Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

matrix inverse

JohnZhang
Novice
524 Views

I have used ?sytrf and ?sytri to do the inverse of a symmetric matrix (a covariance matrix). I realized that the algorithm only uses either the lower or the upper part of the matrix to do the inversion. So the result is only available in either the lower or upper part. To get the full inverse matrix, I need to do additional copy across. It is straightforward, but I wonder if there is a MKL or IPP routine to do that, as performance is really critical in my application.

As a background, I am trying to solve linear equations A*X=B by calculating the matrix inverse A^-1 beforehand. So the X=A^-1*B part only needs to worry about one matrix multiplication every time.

Thank you for any advice.

 

John

0 Kudos
1 Solution
JohnZhang
Novice
440 Views

Thanks for the suggestion. I worked out a solution myself. I used the multiplication of symmetric matrix and vector to do the last step. This avoids the mirroring of the triangular part of the inverse matrix. Then I realized, all the naming convention of MKL routines are classified into , ge, sy, etc. So most of the functions have different versions that support either general matrix of symmetric matrix, etc. 

View solution in original post

6 Replies
PrasanthD_intel
Moderator
494 Views

Hi John,


Thanks for reaching out to us,

As you wanted to solve a system of linear equations, you may use ?sytrs routine instead of ?sytri.

You can derive a factorized matrix using ?sytrf and use it in ?sytrs routine to obtain the unknown(X) matrix.


Thanks

Prasanth


PrasanthD_intel
Moderator
444 Views

Hi John,


We haven't heard back from you.

Let us know if the given solution works for you.


Regards

Prasanth


JohnZhang
Novice
441 Views

Thanks for the suggestion. I worked out a solution myself. I used the multiplication of symmetric matrix and vector to do the last step. This avoids the mirroring of the triangular part of the inverse matrix. Then I realized, all the naming convention of MKL routines are classified into , ge, sy, etc. So most of the functions have different versions that support either general matrix of symmetric matrix, etc. 

PrasanthD_intel
Moderator
417 Views

Hi John,


Glad you have found the solution.

If you don't have any other queries, let us know if we can close this thread.


Regards

Prasanth


JohnZhang
Novice
396 Views
PrasanthD_intel
Moderator
376 Views

Hi John,


Thanks for the confirmation.

As your issue has been resolved, we are closing this thread. If you require additional assistance from Intel, please start a new thread.


Regards

Prasanth


Reply