diff options
Diffstat (limited to 'doc/snippets/LeastSquaresQR.cpp')
-rw-r--r-- | doc/snippets/LeastSquaresQR.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/snippets/LeastSquaresQR.cpp b/doc/snippets/LeastSquaresQR.cpp new file mode 100644 index 000000000..6c9704547 --- /dev/null +++ b/doc/snippets/LeastSquaresQR.cpp @@ -0,0 +1,4 @@ +MatrixXf A = MatrixXf::Random(3, 2); +VectorXf b = VectorXf::Random(3); +cout << "The solution using the QR decomposition is:\n" + << A.colPivHouseholderQr().solve(b) << endl; |