gpt4 book ai didi

c++ - 矩阵模板库矩阵求逆

转载 作者:太空狗 更新时间:2023-10-29 21:09:28 26 4
gpt4 key购买 nike

我正在尝试使用 Boost boost_1_37_0 和 MTL mtl4-alpha-1-r6418 版本对矩阵求逆。我似乎无法找到矩阵求逆代码。我在谷歌上搜索了示例,它们似乎引用了上述版本中似乎缺少的 lu.h。有什么提示吗?

@Matt建议复制 lu.h,但这似乎来自 MTL2 而不是 MTL4。我在使用 VS05 或更高版本编译 MTL2 时遇到问题。

那么,知道如何在 MTL4 中进行矩阵求逆吗?

更新:我想我更了解 Matt,我正在前往 this ITL path .

最佳答案

看起来您使用了 lu_factor,然后是 lu_inverse。不过,我不记得你与枢轴有什么关系。来自documentation .

是的,就像你说的,看起来他们的文档说你需要 lu.h,不知何故:

How do I invert a matrix?

The first question you should ask yourself is whether you want to really compute the inverse of a matrix or if you really want to solve a linear system. For solving a linear system of equations, it is not necessary to explicitly compute the matrix inverse. Rather, it is more efficient to compute triangular factors of the matrix and then perform forward and backward triangular solves with the factors. More about solving linear systems is given below. If you really want to invert a matrix, there is a function lu_inverse() in mtl/lu.h.

如果不出意外,可以看看lu.h on their site .

关于c++ - 矩阵模板库矩阵求逆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/337620/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com