Right now I want to use C++ Boost to solve a matrix function: A*P=X, P=A\X. I have matrix A and matrix X, so I need to do P=A\X to get matrix P. That's a matrix division problem, right?
My C++ code is
#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);
}
But it has errors Error figure, please help me! Thanks!