Subject: CGAL users discussion list
List archive
- From: "Laurent Rineau (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] linear_least_squares_fitting_2 - Undefined
- Date: Wed, 18 Nov 2009 12:06:00 +0100
- Organization: GeometryFactory
On Wednesday 18 November 2009 11:33:45 Michael Jeulin-L wrote:
> Hi,
>
> I have a very weird error when I`m trying to use the function
> linear_least_squares_fitting_2.
>
> I`m just trying to compil the following code with the exact kernel :
>
> #include <CGAL/Cartesian.h>
> #include <CGAL/linear_least_squares_fitting_2.h>
> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
>
> using namespace std;
> typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
> typedef K::Point_2 Point_2 ;
> typedef K::Line_2 Line_2 ;
>
> int main()
> {
> list<Point_2> points;
> points.push_back(Point_2(1.0,0.0));
> points.push_back(Point_2(2.0,0.0));
> points.push_back(Point_2(3.0,0.0));
>
> Line_2 line;
> linear_least_squares_fitting_2(points.begin(),points.end(),line);
You miss the tag (the fourth parameter). See the example here:
http://www.cgal.org/Manual/last/doc_html/cgal_manual/Principal_component_analysis/Chapter_main.html#Subsection_65.2.4
The compiler just says that there is no function
linear_least_squares_fitting_2 that takes three parameters.
Furthermore, you should write should qualify the name
linear_least_squares_fitting_2 with CGAL::
With the argument dependent name lookup (aka ADL or König lookup), the
qualification with CGAL:: is not mandatory, but you should use it every time,
to avoid future errors.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [cgal-discuss] linear_least_squares_fitting_2 - Undefined, Michael Jeulin-L, 11/18/2009
- Re: [cgal-discuss] linear_least_squares_fitting_2 - Undefined, Laurent Rineau (GeometryFactory), 11/18/2009
- Re: Re: [cgal-discuss] linear_least_squares_fitting_2 - Undefined, Michael Jeulin-L, 11/18/2009
- Re: [cgal-discuss] linear_least_squares_fitting_2 - Undefined, Laurent Rineau (GeometryFactory), 11/18/2009
Archive powered by MHonArc 2.6.16.