【发布时间】:2016-10-26 07:53:47
【问题描述】:
这是我在这个网站上的第一个问题。 我(拼命地)试图在我的程序中反转一个大矩阵。 我想使用 lapack 来做到这一点,我发现这个线程看起来很有希望,但我认为它是用 C++ 语言编写的。你能帮帮我吗?
Computing the inverse of a matrix using lapack in C
谢谢。
更新:你是对的,答案有点不清楚。将我发布的程序合并到我的程序后,我收到以下错误:
mymatrixmalloc_2.c:15:18: fatal error: cstdio: non existing File or directory
#include <cstdio>
^
compilation terminated.
我想问题是我没有正确安装 llapack 库,或者我在编译时包含它。
这就是我安装库的方式(从终端,我有 Ubuntu):
sudo apt-get install build-essential
sudo apt-get install liblapack*
sudo apt-get install libblas*
这就是我的编译方式:
davide@John:~$ gcc -Wall -lm -llapack -lblas mymatrixmalloc_2.c -o mymatrixmalloc_2.exe
我做错了什么?
【问题讨论】:
-
你对另一个答案有什么问题?
-
该帖子包含有效的 C 代码。
-
请考虑包含一些您已经编写(或从该链接使用)的代码。或者考虑更详细地描述运行代码所必须的配置/设置。读者需要做的事情越少(例如点击并阅读另一个链接)越好;你更有可能得到有意义的答案。
-
stackoverflow.com/questions/3519959/… 中的答案由@Olaf 评论:
There is no language C/C++. The code you show is C++. But the question is about C.。确实,#include <cstdio>是 C++,而#include <stdio.h>是 C。这就是编译器抱怨 cstdio 既不是文件也不是目录的原因。
标签: c algorithm matrix lapack inversion