我正在嘗試使用開放源代碼庫http://arma.sourceforge.net進行線性代數計算。犰狳的一些功能如pinv使用LAPACK。我寫了一段非常簡單的代碼來使用Armadillo來計算pinv,但它會產生一個運行時錯誤。這可能是因爲我在sln文件中沒有LAPACK鏈接器標誌。如何在使用Armadillo的Visual Studio 2008項目中使用LAPACK
#include <iostream>
#include "armadillo"
using namespace arma;
using namespace std;
int main(int argc, char** argv)
{
mat A = rand<mat>(4,5);
mat pinverse = pinv(A);
A.print("A=");
return 0;
}
我得到了Windows的LAPACK 3.1.1,但不起作用 – iceman 2010-02-01 06:57:50
我用明顯的lib文件更新了答案,否則 - 無法提供幫助,關於您的情況一定有一些不尋常的事情。如果可以,請嘗試在其他PC上進行全新安裝。 – ima 2010-02-01 12:29:05
我試圖編譯的VS 2008 sln在這裏:http://sites.google.com/site/icemancode/file-cabinet/pseudoInverseMat.rar?attredirects=0&d=1 – iceman 2010-02-02 05:09:37