Boost :: Numeric :: UBLAS :: Matrix Lu倒置方法的可靠性

发布于 2025-02-13 11:58:46 字数 685 浏览 0 评论 0原文

我的问题:副方平方矩阵的尺寸为30*30(或在此尺寸附近)。

我开始用C ++编码LU分解方法,然后发现了Librairie Boost :: Numeric :: Ublas :: Matrix的存在。因此,为了让我重写我使用的所有功能的所有功能,即按以下顺序lu_factorize()然后lu_substitute()检索逆。

我手工检查了我的反转功能的可靠性(再次,仅使用上述2个增强功能)将结果与简单的平方矩阵(尺寸3或4)进行比较,到目前为止,结果令人满意。

现在服用(30,30)矩阵“片段:

 1         -1.5e-16  -5.1e-20  2.4e-19  
 0         1         0         -5.4e-20  
 1.1e-16   1.1e-16   1         -1.4e-19  
 6.9e-17   0         -3.3e-17  1         

我无法分辨这些数字(从主角层出发)是由矩阵库制成的,试图大约0,或者是从lu分解中发出的...

我的问题:您是否曾经在这个问题上使用过Boost Ublas?这个图书馆仍然可靠还是过时?有什么方法可以访问这些算法的源代码?

先前

使用C ++ 11,GCC/8.2.0和Boost/1.76.0。

My Problem : inverse squared matrices of doubles numbers of size 30*30 (or around this size).

I started coding in C++ a LU decomposition method, then I discovered the existence of the librairie boost::numeric::ublas::matrix. Therefore to spare me rewriting everything I used some functions of this librairie, namely in this very order lu_factorize() then lu_substitute() to retrieve the inverse.

I hand-checked the reliability of my inversing function (which again, only use the 2 aforementioned boost functions) comparing the results with simple squared matrices (size 3 or 4) and the results are satisfying so far.

Now taking a (30,30) matrix "A" and inversing it "A^-1", the product "A*A^-1" returns me a matrix with 1 on the diagonale and everywhere else some very small numbers, here's a snippet :

 1         -1.5e-16  -5.1e-20  2.4e-19  
 0         1         0         -5.4e-20  
 1.1e-16   1.1e-16   1         -1.4e-19  
 6.9e-17   0         -3.3e-17  1         

I cannot tell if these numbers (out of the main diagonale) are made up by the matrix librairie trying to approximate 0 or if they issued from the LU decomposition ...

My question : Have you ever used boost ublas with this issue ? Is this librairie still reliable or outdated ? Is there any way to access the source code of these algorithm ?

Thanks in advance

Using C++11, gcc/8.2.0 and boost/1.76.0.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文