Hello!
I can't solve A*x = b system of linear equations where A is a symmetric matrix
boost::numeric::ublas::symmetric_matrix<double, ublas::lower, ublas::column_major> A(4,4);
A.clear();
A(0,0) = 1.;
A(1,0) = -1.; A(1,1) = 2.;
A(2,1) = -1.; A(2,2) = 2.;
A(3,2) = -1.; A(3,3) = 1.;
ublas::matrix<double,ublas::column_major> b(4,1);
b(0,0) = -1.; b(1,0) = 0.; b(2,0) = 0.; b(3,0) = 1.;
How can I get the solution?
For the case where A was declared as:
ublas::matrix<double,ublas::column_major> A(4,4);
A(0,0) = 1.; A(0,1) = -1.;
A(1,0) = -1.; A(1,1) = 2.; A(1,2) = -1.;
A(2,1) = -1.; A(2,2) = 2.; A(2,3) = -1.;
A(3,2) = -1.; A(3,3) = 1.;
the situation was clear:
boost::numeric::bindings::lapack::gesv(A,b);
Please help me. I would be grateful.