aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-05-05 16:50:58 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-05-05 16:50:58 +0000
commit2b2f0c0220528f021acffa8e0f0f40f3dbb0e9ac (patch)
tree436c3cc907923adb7160a1b40383c4f875b6a240 /Eigen/src
parent5b364a68cb05fb8f904b237fabfd686edd955fe1 (diff)
fix linearRegression, fix doc, add unit test (it was untested since the change
making fitHyperplane no longer use it)
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/LeastSquares/LeastSquares.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/LeastSquares/LeastSquares.h b/Eigen/src/LeastSquares/LeastSquares.h
index cd6ec3cf4..f73fa9ff2 100644
--- a/Eigen/src/LeastSquares/LeastSquares.h
+++ b/Eigen/src/LeastSquares/LeastSquares.h
@@ -57,7 +57,7 @@
Vector3d coeffs; // will store the coefficients a, b, c
linearRegression(
5,
- points,
+ &points,
&coeffs,
1 // the coord to express as a function of
// the other ones. 0 means x, 1 means y, 2 means z.
@@ -108,14 +108,14 @@ void linearRegression(int numPoints,
result->resize(size);
Matrix<Scalar, Dynamic, VectorType::SizeAtCompileTime,
- Dynamic, VectorType::MaxSizeAtCompileTime, RowMajorBit>
+ RowMajor, Dynamic, VectorType::MaxSizeAtCompileTime>
m(numPoints, size);
if(funcOfOthers>0)
for(int i = 0; i < numPoints; ++i)
m.row(i).start(funcOfOthers) = points[i]->start(funcOfOthers);
if(funcOfOthers<size-1)
for(int i = 0; i < numPoints; ++i)
- m.row(i).block(funcOfOthers, size-funcOfOthers-1)
+ m.row(i).segment(funcOfOthers, size-funcOfOthers-1)
= points[i]->end(size-funcOfOthers-1);
for(int i = 0; i < numPoints; ++i)
m.row(i).coeffRef(size-1) = Scalar(1);