Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel
Chronological Thread
- From: Kai WANG <>
- To:
- Subject: Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel
- Date: Fri, 7 Oct 2011 09:31:14 +0800
Hi Sebastien,
The reason is illustrated in another post:
http://cgal-discuss.949826.n4.nabble.com/Issue-on-CGAL-Polygon-2-Intersection-td3877407.html
Since I find my program crash when calculating the 2D polygon intersection with CGAL::Cartesian<double> as the kernel number type, especially when there are more digits after the decimal point.
So acuturally there's confliction between differente packages in CGAL, right? Is there any beatiful solution to solve these two problems in a same project please? Thanks!
On Fri, Oct 7, 2011 at 12:28 AM, Sebastien Loriot (GeometryFactory) <> wrote:
Is there any reason why you want to use Exact_predicates_exact_constructions_kernel
and not Exact_predicates_inexact_constructions_kernel as kernel?
Sebastien.
Kai WANG wrote:
I'm sorry that I still don't quite understand how to modify it. Could you please give a detailed explanation on the way to add a "sqrt" function please? For example, given the following simple program which has complile error, where should I add the "sqrt" function please?
Thanks very much for ur help!
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef K::Line_3 Line;
typedef K::Plane_3 Plane;
typedef K::Point_3 Point;
typedef K::Triangle_3 Triangle;
int main(void)
{
std::list<Triangle> triangles;
Point a(1.0,2.0,3.0);
Point b(4.0,0.0,6.0);
Point c(7.0,8.0,9.0);
Point d(8.0,7.0,6.0);
Point e(5.0,3.0,4.0);
triangles.push_back(Triangle(a,b,c));
triangles.push_back(Triangle(a,b,d));
triangles.push_back(Triangle(d,e,c));
Line line;
Plane plane;
// fit plane to whole triangles
linear_least_squares_fitting_3(triangles.begin(),triangles.end(),plane,CGAL::Dimension_tag<2>());
// fit line to triangle vertices
linear_least_squares_fitting_3(triangles.begin(),triangles.end(),line, CGAL::Dimension_tag<0>());
return 0;
}
On Thu, Oct 6, 2011 at 11:31 PM, Sebastien Loriot (GeometryFactory) < <mailto:>> wrote:CGAL::Exact_predicates_exact___constructions_kernel as kernel,
the PCA package make use of the square root function, so the underlying
number type in the kernel you are using should have a sqrt function
available.
Sebastien.
kyewong wrote:
Hi,
When I'm using the linear_least_squares_fitting_3 and1>F:\Program Files\CGAL-3.8\include\CGAL/__PCA_util.h(132) :
there will be a
compile error as follows.
Could anyone tell me how to modify it if I want to use both of
them at the
same time please? Thanks very much!
Files\CGAL-3.8\include\CGAL/__linear_least_squares_fitting___triangles_3.h(57)
error C2665:
'sqrt' : none of the 3 overloads could convert all the argument
types
1> F:\Program Files\Microsoft Visual Studio
9.0\VC\include\math.h(581): could be 'long double sqrt(long double)'
1> F:\Program Files\Microsoft Visual Studio
9.0\VC\include\math.h(533): or 'float sqrt(float)'
1> F:\Program Files\Microsoft Visual Studio
9.0\VC\include\math.h(128): or 'double sqrt(double)'
1> while trying to match the argument list
'(CGAL::Lazy_exact_nt<ET_>)'
1> with
1> [
1> ET_=CGAL::Gmpq
1> ]
1> F:\ProgramCGAL::internal::assemble___covariance_matrix_3<__InputIterator,K>(__InputIterator,InputIterator,__CGAL::Lazy_exact_nt<ET_>
:
see reference to function template instantiation 'void1> InputIterator=std::list<__Triangle>::_Iterator<true>,
[],const CGAL::Point_3<R_> &,const K &,const
CGAL::Triangle_3<R_> *,const
CGAL::Dimension_tag<dim> &)' being compiled
1> with
1> [Files\CGAL-3.8\include\CGAL/__linear_least_squares_fitting___3.h(58)
1> K=CGAL::Epeck,
1> ET_=CGAL::Gmpq,
1> R_=CGAL::Epeck,
1> dim=2
1> ]
1> F:\ProgramCGAL::internal::linear_least___squares_fitting_3<__InputIterator,Kernel>(__InputIterator,InputIterator,__CGAL::Plane_3<R_>
: see
reference to function template instantiation
'CGAL::Lazy_exact_nt<ET_>1> InputIterator=std::list<__Triangle>::_Iterator<true>,
&,CGAL::Point_3<R_> &,const CGAL::Triangle_3<R_> *,const K &,const
CGAL::Dimension_tag<dim> &)' being compiled
1> with
1> [
1> ET_=CGAL::Gmpq,Files\CGAL-3.8\include\CGAL/__linear_least_squares_fitting___3.h(76)
1> Kernel=CGAL::Epeck,
1> R_=CGAL::Epeck,
1> K=CGAL::Epeck,
1> dim=2
1> ]
1> F:\ProgramCGAL::linear_least_squares___fitting_3<InputIterator,__Object,CGAL::Epeck,Tag>(__InputIterator,InputIterator,__Object
: see
reference to function template instantiation
'CGAL::Lazy_exact_nt<ET_>1> InputIterator=std::list<__Triangle>::_Iterator<true>,
&,CGAL::Point_3<R_> &,const Tag &,const Kernel &)' being compiled
1> with
1> [
1> ET_=CGAL::Gmpq,Files\CGAL-3.8\include\CGAL/__linear_least_squares_fitting___3.h(93)
1> Object=Plane,
1> Tag=CGAL::Dimension_tag<2>,
1> R_=CGAL::Epeck,
1> Kernel=CGAL::Epeck
1> ]
1> F:\Program
: see
reference to function template instantiation
'CGAL::Lazy_exact_nt<ET_>CGAL::linear_least_squares___fitting_3<InputIterator,__Object,CGAL::Point_3<R_>__,Tag>(InputIterator,__InputIterator,Object&,Point &,const Tag &)' being compiled1> InputIterator=std::list<__Triangle>::_Iterator<true>,
1> with
1> [
1> ET_=CGAL::Gmpq,
1> Object=Plane,
1> R_=CGAL::Epeck,
1> Tag=CGAL::Dimension_tag<2>,1> Point=CGAL::Point_3<CGAL::__Epeck>
1> ]
1> .\linear_least_squares___fitting_triangles_3.cpp(33) :see reference
to function template instantiation 'CGAL::Lazy_exact_nt<ET_>CGAL::linear_least_squares___fitting_3<std::list<_Ty&__gt;::_Iterator<_Secure___validation>,Plane,CGAL::__Dimension_tag<dim>>(__InputIterator,InputIterator,__Object
&,const Tag &)' being compiled1> InputIterator=std::list<__Triangle>::_Iterator<true>,
1> with
1> [
1> ET_=CGAL::Gmpq,
1> _Ty=Triangle,
1> _Secure_validation=true,
1> dim=2,http://cgal-discuss.949826.n4.__nabble.com/compiling-error-of-__linear-least-squares-fitting-__3-under-Exact-predicates-__exact-constructions-kernel-__tp3878596p3878596.html
1> Object=Plane,
1> Tag=CGAL::Dimension_tag<2>
1> ]
--
View this message in context:https://lists-sop.inria.fr/__wws/info/cgal-discuss
<http://cgal-discuss.949826.n4.nabble.com/compiling-error-of-linear-least-squares-fitting-3-under-Exact-predicates-exact-constructions-kernel-tp3878596p3878596.html>
Sent from the cgal-discuss mailing list archive at Nabble.com.
-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Kai WANG
- [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, kyewong, 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Laurent Rineau (GeometryFactory), 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/07/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Kai WANG, 10/06/2011
- Re: [cgal-discuss] compiling error of "linear_least_squares_fitting_3" under :Exact_predicates_exact_constructions_kernel, Sebastien Loriot (GeometryFactory), 10/06/2011
Archive powered by MHonArc 2.6.16.