aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/LLT_solve.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-29 21:11:05 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-10-29 21:11:05 -0400
commit6b48e932e9b68159d2b0cc9d0d14c4025808327c (patch)
treeb10f93514e0fea336606fd00999addc4ad63df1b /doc/snippets/LLT_solve.cpp
parente8dd552257f0e886ee281aa84b7094fc489608d0 (diff)
*port the Cholesky module to the new solve() API
*improve documentation
Diffstat (limited to 'doc/snippets/LLT_solve.cpp')
-rw-r--r--doc/snippets/LLT_solve.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/snippets/LLT_solve.cpp b/doc/snippets/LLT_solve.cpp
index 76ab09ec5..7095d2cc3 100644
--- a/doc/snippets/LLT_solve.cpp
+++ b/doc/snippets/LLT_solve.cpp
@@ -3,6 +3,6 @@ typedef Matrix<float,Dynamic,2> DataMatrix;
DataMatrix samples = DataMatrix::Random(12,2);
VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1;
// and let's solve samples * [x y]^T = elevations in least square sense:
-Matrix<float,2,1> xy;
-(samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations), &xy);
+Matrix<float,2,1> xy
+ = (samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations));
cout << xy << endl;