最好的免费跨平台库,适用于更高级别的矩阵、向量和 esp。稀疏矩阵运算?

发布于 2024-09-26 01:10:24 字数 1539 浏览 0 评论 0原文

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

活雷疯 2024-10-03 01:10:24

本征是最好的!它比 boost::ublas 好得多,你可以写 C = A*B 而不是 ublas 中的 C = prod(A,B) ,我测试过它的速度比 ublas 快得多。

eigen is the best one! It's much better than boost::ublas, you can write C = A*B instead of C = prod(A,B) as in ublas and I have tested the speed it's much faster than ublas.

把回忆走一遍 2024-10-03 01:10:24

Eigen3 现在有一个稀疏矩阵类,以及几个流行的稀疏矩阵库的接口。如果您需要计算伪逆来求解最小二乘系统,则可以使用 直接在正规方程上进行 Cholesky 分解

Eigen3 now has a sparse matrix class, along with interfaces to several popular sparse matrix libraries. If you need to calculate the pseudo inverse to solve a least squares system, you can instead use Cholesky decomposition directly on the normal equations.

剪不断理还乱 2024-10-03 01:10:24

NewMat11 是一个很好的、易于使用且易于使用的工具。用于高级矩阵运算(Eigensystems、SVD、QR、LU、逆)的相当轻量级的矩阵库。您可以轻松声明&从数组构建矩阵如下:

Matrix M(numRows,numCols);
M << array;

访问矩阵元素如下:

M.element(i,j);

转置:

M.t();

取逆:

M.i();

仅与 * 相乘:

M*M

并且可以相当轻松地执行其他操作,例如:SVD、QR、LU 等。

对于库来说,显式提供伪逆(Moore-Penrose 逆)运算并不是强制性的,因为您可以通过使用转置和逆运算轻松计算它。逆运算如下:

if row > col,则伪逆(最小二乘解)可以计算为:
M_PseudoInv = (MTM)-1MT

如果行 T col 那么伪逆(最小范数解)可以计算为:
M_PseudoInv = MT (MMT)-1

NewMat11 is a good, easy to use & fairly lightweight matrix library for high level matrix operations (Eigensystems, SVD, QR, LU, inverse). You can easily declare & construct a matrix from an array as:

Matrix M(numRows,numCols);
M << array;

Access matrix elements as:

M.element(i,j);

Take transpose:

M.t();

Take inverse:

M.i();

Multiply with just *:

M*M

And can perform other operations like: SVD, QR, LU etc. fairly easily.

Providing the pseudo-inverse (Moore-Penrose inverse) operation explicitly is not mandatory for a library, because you can calculate it easily by using the transpose & inverse operations as below:

if row > col, then the pseudo-inverse (least-squares solution) can be calculated as:
M_PseudoInv = (MTM)-1MT

if row < col then the pseudo-inverse (least-norm solution) can be calculated as:
M_PseudoInv = MT (MMT)-1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文