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

Which subroutine can achieve the same result as matlab's mldivide?

kim__seongik
Beginner
730 Views

I know that DGETRF and DGETRI are for matrix inversion in large scale matrix.

However, it is not the same with Matlab's mldivide.

I want to know which subroutine can achieve the same result as matlab's mldivide.

Thanks for the help.

S. Kim

0 Kudos
1 Solution
mecej4
Honored Contributor III
730 Views

Look up gesv for Fortran 95+, DGESV for Fortran 77.

There are other routines that are better for matrices with special properties (such as positive definite, tridiagonal, etc.).

View solution in original post

0 Kudos
3 Replies
mecej4
Honored Contributor III
731 Views

Look up gesv for Fortran 95+, DGESV for Fortran 77.

There are other routines that are better for matrices with special properties (such as positive definite, tridiagonal, etc.).

0 Kudos
Gennady_F_Intel
Moderator
730 Views

the similar is for C - https://software.intel.com/en-us/mkl-developer-reference-c-gesv#90C462DB-A8BF-48A1-AE76-5E49D4EA04AF

0 Kudos
Kirill_V_Intel
Employee
730 Views

Hello,

You need to be more specific about what you want to do. Functionality mldivide in Matlab is a wrapper around a general operation which dispatches between different cases. You can get an idea about it at https://www.mathworks.com/help/matlab/ref/mldivide.html.

There is no one-call equivalent for ml divide in MKL.

Just for example:

For solving a linear system with a dense matrix, you can call LAPACK routines and then gesv mentioned in other answers is the closest guess.

For solving a linear system with a sparse matrix using a direct method, you can use PARDISO (see https://software.intel.com/en-us/mkl-developer-reference-fortran-intel-mkl-pardiso-parallel-direct-sparse-solver-interface) and Cluster Sparse Solver (for distributed systems) or Sparse QR, https://software.intel.com/en-us/mkl-developer-reference-c-mkl-sparse-qr.

So you need to figure out what exactly you want to do (what kind of system you have) and go from there.

Best,
Kirill

0 Kudos
Reply