gpt4 book ai didi

c++ - clapack.h 或 Visual Studio 2008 中的模板数值工具包

转载 作者:行者123 更新时间:2023-11-28 08:18:56 26 4
gpt4 key购买 nike

我想使用lapack库clapck ,但我如何在 Visual Studio 2008 中的 C++ 项目中使用它...

我也在审查 Template Numerical Toolkit

您是否做过类似的事情,您推荐在 Visual Studio C++ 项目中使用什么?您能否发布一个包含必须包含的 header 的简单示例?

最佳答案

TNT is easy enough.

#include "cmat.h"
#include "lu.h"
/*******************************
* PURPOSE: Solves a linear equation in the form of Ax = b.
*****/
using namespace TNT;
void matrix_solve(double V[9], double xb[3])
{
Matrix<double> A(3, 3, V);
Vector<int> ipiv(3);
Vector<double> b(3, xb);
LU_factor(A, ipiv);
LU_solve(A, ipiv, b);
xb[0] = b[0];
xb[1] = b[1];
xb[2] = b[2];
}

关于c++ - clapack.h 或 Visual Studio 2008 中的模板数值工具包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6658689/

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