mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add doc page on computing Least Squares.
This commit is contained in:
4
doc/snippets/LeastSquaresNormalEquations.cpp
Normal file
4
doc/snippets/LeastSquaresNormalEquations.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
MatrixXf A = MatrixXf::Random(3, 2);
|
||||
VectorXf b = VectorXf::Random(3);
|
||||
cout << "The solution using normal equations is:\n"
|
||||
<< (A.transpose() * A).ldlt().solve(A.transpose() * b) << endl;
|
||||
Reference in New Issue
Block a user