mldivide function (matrix left division) C++ analogs

3 ビュー (過去 30 日間)
genawas Vasserman
genawas Vasserman 2011 年 12 月 11 日
Hello, I have a little trouble with implementing in C++ some code I've tested in Matlab. It appears that sparse matrix division that worked perfect in Matlab 2011a, gave different results using common C++ libraries (as LAPACK etc). I'm working with symmetrical positive sparse matrix A and solving the linear equation Ax=b. (in Matlab solution is x = mldivide (A,b);) Maybe someone found this issue previously? I believe it is probably because C++ solver is stuck in some wrong solution since the matrix may be close to singular, however Matlab somehow overcomes this and only gives me a warning that the matrix is close to singular. Thank you

回答 (1 件)

Jan
Jan 2011 年 12 月 11 日
If the matrix is close to singular, you cannot expect a valid or unique solution. Therefore it is not surprising that your get "different" results.
  2 件のコメント
genawas Vasserman
genawas Vasserman 2011 年 12 月 11 日
Thank you.
Is there any C++ solver that performs close/similar to Matlab mldivide? Or what method does mldivide uses to solve linear equation for sparse positive symmetrical matrix?
Jan
Jan 2011 年 12 月 11 日
The used LAPACK routines are explained exhaustively in "doc mldivide". E.g.:
[quote]Note To see information about choice of algorithm and storage allocation for sparse matrices, set the spparms parameter 'spumoni' = 1[/quote]

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by