mirror of https://github.com/CGAL/cgal
M Principal_component_analysis/include/CGAL/centroid.h
M Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h M Principal_component_analysis/demo/Principal_component_analysis/linear_least_squares_fitting.cpp Made modifications to remove compilation errors.
This commit is contained in:
parent
b5867d7ba5
commit
2aa37cfc1b
|
|
@ -95,9 +95,10 @@ public:
|
|||
if(list_of_points.size()>1){
|
||||
Line_2 line;
|
||||
linear_least_squares_fitting_2(list_of_points.begin(),
|
||||
list_of_points.end(),
|
||||
line);
|
||||
|
||||
list_of_points.end(),
|
||||
line,
|
||||
CGAL::PCA_dimension_0_tag());
|
||||
|
||||
*widget << line;
|
||||
}
|
||||
widget->unlock();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ centroid(InputIterator begin,
|
|||
InputIterator end,
|
||||
const K&,
|
||||
const typename K::Point_2*,
|
||||
const CGAL::PCA_dimension_0_tag& tag)
|
||||
const CGAL::PCA_dimension_0_tag&)
|
||||
{
|
||||
typedef typename K::Vector_2 Vector;
|
||||
typedef typename K::FT FT;
|
||||
|
|
|
|||
|
|
@ -111,10 +111,6 @@ linear_least_squares_fitting_2(InputIterator first,
|
|||
covariance[0] += mass * (-1.0 * c.x() * c.x());
|
||||
covariance[1] += mass * (-1.0 * c.x() * c.y());
|
||||
covariance[2] += mass * (-1.0 * c.y() * c.y());
|
||||
std::cout<<covariance[0]<<" "<<covariance[1]<<" "<<covariance[2]<<" "<<(std::sqrt(2)/3.0)<<std::endl;
|
||||
|
||||
// to remove later
|
||||
// std::cout<<covariance[0]<<" "<<covariance[1]<<" "<<covariance[2]<<" "<<(std::sqrt(2)/3.0)<<std::endl;
|
||||
|
||||
// solve for eigenvalues and eigenvectors.
|
||||
// eigen values are sorted in descending order,
|
||||
|
|
|
|||
Loading…
Reference in New Issue