現在我想用C++ Boost來求解矩陣函數:A * P = X,P = A \ X。我有矩陣A和矩陣X,所以我需要做P = A \ X來得到矩陣P.這是一個矩陣劃分問題,對嗎?使用C++ Boost的矩陣分割
我的C++代碼是
#include "stdafx.h"
#include <boost\mat2cpp-20130725/mat2cpp.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
using namespace boost::numeric::ublas;
using namespace std;
int main() {
using namespace mat2cpp;
matrix<double> x(2,2); // initialize a matrix
x(0, 0) = 1; // assign value
x(1, 1) = 1;
matrix<double> y(2, 1);
y(0, 0) = 1;
y(1, 0) = 1;
size_t rank;
matrix<double> z = matrix_div(x, y, rank);
}
但它有錯誤Error figure,請幫幫我!謝謝!
可能重複[什麼是未定義的引用/無法解析的外部符號錯誤,以及如何解決它?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved- external-symbol-error-and-how-do-i-fix) –
我在我的Boost發行版(1.63)中找不到'boost \ mat2cpp-20130725/mat2cpp.hpp'。你使用什麼版本? – TobiMcNamobi
Google發現三(3)頁字符串爲「mat2cpp-20130725」。其中之一就是這個問題。另外兩個表明這個目錄不是提升的一部分。 –