- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Dear All,
Could someone kindly give me an example for C++ which uses MKL library for calculating the inverse of a square matrix. I would like to extend that to find the inverse of a square matrix which is fully populated and low dimensions (at most 2020).
Thanks,
Ahmad
Could someone kindly give me an example for C++ which uses MKL library for calculating the inverse of a square matrix. I would like to extend that to find the inverse of a square matrix which is fully populated and low dimensions (at most 2020).
Thanks,
Ahmad
コピーされたリンク
2 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I have found the example at http://stackoverflow.com/questions/3519959/computing-the-inverse-of-a-matrix-using-lapack-in-c. However, the function dgetrf and dgetri are not fast. I compared the speed for calculating the inverse of 1010 fully populated matrix with MATLAB and there was order of magnitude difference. Is there a faster function than dgetri?
Thanks.
Thanks.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
How fast do you want it to be? By my measurement DGETRF + DGETRI takes just 1.8ms:
$ cat test.f90 program test double precision a(10, 10), work(10) integer ipiv(10), info integer t1, t2, r call random_number(a) call system_clock(count=t1) call dgetrf(10, 10, a, 10, ipiv, info) call dgetri(10, a, 10, ipiv, work, 10, info) call system_clock(count=t2, count_rate=r) print *, (t2 - t1) / sngl end program $ ifort test.f90 -otest -mkl=sequential $ time ./test 1.8000000E-03 $
