Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
6466 Discussions

Basic question regarding matrix inversion vs solver

Mads_Trolle
Beginner
105 Views

Dear all,

Given a matrix A, I need to calculate element (1,1) of its inverse... i.e. if B = inv(A), i need B(1,1), and not the entire matrix B.

Hence, doing a complete inversion of matrix A seems a bit excessive... Does mkl contain any smart solver-based routines i might use...?

My first impression is to use

call getrf(A,i)
call getrs(A,I)

where I = [1,0,0,...], to get the first column of B...

Best,

Mads

 

 

 

0 Kudos
1 Solution
Ying_H_Intel
Employee
105 Views

Hi Mads, 

You are right. If the matrix is dense, then I’d suggest to use ?gesv(A,I) as it is a bit simpler than using factorization and solve routines. If the matrix A is sparse, it is possible to use PARDISO solver with right-hand side “I” and partial solve to get just B(1,1).

Best 
Ying

View solution in original post

2 Replies
Ying_H_Intel
Employee
106 Views

Hi Mads, 

You are right. If the matrix is dense, then I’d suggest to use ?gesv(A,I) as it is a bit simpler than using factorization and solve routines. If the matrix A is sparse, it is possible to use PARDISO solver with right-hand side “I” and partial solve to get just B(1,1).

Best 
Ying

Mads_Trolle
Beginner
105 Views

Dear Ying,

Thank you! Exactly what I was looking for :)

Best,

Mads

Reply