From 780f3122287a93f66e30edc5abfb629baf337ef7 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 24 Feb 2011 19:03:49 +0100 Subject: [PATCH] fix LS documentation --- Eigen/src/LeastSquares/LeastSquares.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Eigen/src/LeastSquares/LeastSquares.h b/Eigen/src/LeastSquares/LeastSquares.h index b2595ede1..9797d7a10 100644 --- a/Eigen/src/LeastSquares/LeastSquares.h +++ b/Eigen/src/LeastSquares/LeastSquares.h @@ -54,10 +54,13 @@ * constants \f$a,b,c\f$ so that the plane of equation \f$y=ax+bz+c\f$ fits * best the five above points. To do that, call this function as follows: * @code + // create a vector of pointers to the points + std::vector points_ptrs(5); + for(int k=0; k<5; ++k) points_ptrs[k] = &points[k]; Vector3d coeffs; // will store the coefficients a, b, c linearRegression( 5, - &points, + &(points_ptrs[0]), &coeffs, 1 // the coord to express as a function of // the other ones. 0 means x, 1 means y, 2 means z.