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

## Which subroutine can achieve the same result as matlab's mldivide? Beginner
335 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

1 Solution Black Belt
335 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.).

3 Replies Black Belt
336 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.). Moderator
335 Views

the similar is for C - https://software.intel.com/en-us/mkl-developer-reference-c-gesv#90C462DB-A8BF-48A1-AE76-5E49D4EA04AF Employee
335 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 