lapack sgetrs tutorial

I have a problem to solving system linear equation Ax=b using lapack. I am planned to use sgetrs subroutine in lapack to solving system linear equation Ax=b.

sgetrs descriptions is a subroutine to Solves a system of linear equations with an LU-factored square coefficient matrix, with multiple right-hand sides. So, we need to process our data with LU-factored before use sgetrs lapack.

I have create a C/C++ code to give tutorial how to call sgetrs lapack from C/C++ code. I have compared the result from this sgetrs lapack with Matlab and give the same result. Please check this code below (call sgetrs lapack from C/C++) :

We can compile this code (call sgetrs lapack from C/C++) using command :

Sample output after running this code (call sgetrs lapack from C/C++) :

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.