This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Solution of a call to A.lu().solve(b)?

Tags: None
(comma "," separated)
vak
Registered Member
Posts
23
Karma
0
OS
Dear All,

I'm having a little bit of trouble finding
where is the solution (i.e. the 'x' in Ax=b) of

xp.lu().solve(b);

For example:

VectorXf lin(MatrixXf& x, RowVectorXf& xm){
MatrixXf A = MatrixXf::Random(3,3);
VectorXf b = VectorXf::Ones(3);
A.lu().solve(b);
std::cout << "sol" << std::endl << ?? << std::endl;
return solution??;
}

i would expect to get a 3 \times 1 vector of x such that
Ax^*=1_p....

Thanks in advance,
jitseniesen
Registered Member
Posts
204
Karma
2
The solution is returned by the solve() method, so if you write "VectorXf x = A.lu().solve(b)", the solution will be in the variable x.
vak
Registered Member
Posts
23
Karma
0
OS
thank you,
o)


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]