Ambigous reference to Weighted_Point during compilation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Ambigous reference to Weighted_Point during compilation

Thomas Zangl - Home
 
Hi!

I have an application, which uses the
Exact_predicated_exact_constructions kernel. I want to replace it with
an *_inexact_constructions kernel to run some speed tests (testing the
impact of the choice of kernel on the applications performance).

I use a regular_triangulation_3 which is defined as follows:

// Kernel
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::RT dbl; // this is used for representing floating point
values

// The types of the regular triangulation
typedef CGAL::Regular_triangulation_filtered_traits_3<K>  RegtrTraits;
typedef CGAL::Triangulation_vertex_base_with_info_3<pOneBall, RegtrTraits>      VertexBase;

typedef CGAL::Triangulation_cell_base_with_info_3<pRCellProperty,K>     CellBase;
typedef CGAL::Triangulation_data_structure_3<VertexBase,CellBase>   TDataStructure;
typedef CGAL::Regular_triangulation_3<RegtrTraits,TDataStructure> Regular_triangulation;
typedef Regular_triangulation::Weighted_point Weighted_point;

And now my compiler yields:

main.cpp: In function âvoid regularTriangulation(std::vector<boost::shared_ptr<OneBall>, std::allocator<boost::shared_ptr<OneBall> > >&)â:
main.cpp:143: error: reference to âWeighted_pointâ is ambiguous
common.h:77: error: candidates are: typedef class CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, double> Weighted_point
/CGAL-3.3.1/include/CGAL/Weighted_point.h:27: error:
template<class Pt, class We> class CGAL main.cpp:143: error: reference
to âWeighted_pointâ is ambiguous common.h:77: error: candidates are:
typedef class
CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_ca
rtesian<double> > >, double> Weighted_point
/CGAL-3.3.1/include/CGAL/Weighted_point.h:27: error:
template<class Pt, class We> class CGAL::Weighted_point main.cpp:143:
error: expected `;' before âwpâ main.cpp:144: error: âwpâ was not
declare

Line 77 is:
typedef Regular_triangulation::Weighted_point Weighted_point;

main.cpp line 143 is:
Weighted_point wp((*it)->getCenter(),(*it)->getWeight());

(*it)->getCenter() : returns a Point_3<K>
(*it)->getWeight() : returns a value of type "dbl" (see above)

Any ideas whats wrong? Thank you!

Best regards,
--
,yours Thomas Zangl, Bakk.rer.soc.oec. - [hidden email] -
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -
            - http://blog.tzis.net -
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Ambigous reference to Weighted_Point during compilation

Monique Teillaud
Hi,

I don't understand at first sight.
(the error message mentions an ambiguity while it finds only one candidate)

What if you take the weighted point from
Regular_triangulation_filtered_traits_3 ?
Well, it should be the same, so, the problem should be the same too.

Do you also get the problem
- removing the "with_info" stuff?
- with the non filtered Regular_triangulation_euclidean_traits_3?
That's only brute force suggestions, maybe useless, to try to isolate
the problem when no clue shows up...

        Monique Teillaud

Thomas Zangl - Home wrote:

>  
> Hi!
>
> I have an application, which uses the
> Exact_predicated_exact_constructions kernel. I want to replace it with
> an *_inexact_constructions kernel to run some speed tests (testing the
> impact of the choice of kernel on the applications performance).
>
> I use a regular_triangulation_3 which is defined as follows:
>
> // Kernel
> typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
> typedef K::RT dbl; // this is used for representing floating point
> values
>
> // The types of the regular triangulation
> typedef CGAL::Regular_triangulation_filtered_traits_3<K>  RegtrTraits;
> typedef CGAL::Triangulation_vertex_base_with_info_3<pOneBall, RegtrTraits>      VertexBase;
>
> typedef CGAL::Triangulation_cell_base_with_info_3<pRCellProperty,K>     CellBase;
> typedef CGAL::Triangulation_data_structure_3<VertexBase,CellBase>   TDataStructure;
> typedef CGAL::Regular_triangulation_3<RegtrTraits,TDataStructure> Regular_triangulation;
> typedef Regular_triangulation::Weighted_point Weighted_point;
>
> And now my compiler yields:
>
> main.cpp: In function âvoid regularTriangulation(std::vector<boost::shared_ptr<OneBall>, std::allocator<boost::shared_ptr<OneBall> > >&)â:
> main.cpp:143: error: reference to âWeighted_pointâ is ambiguous
> common.h:77: error: candidates are: typedef class CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> > >, double> Weighted_point
> /CGAL-3.3.1/include/CGAL/Weighted_point.h:27: error:
> template<class Pt, class We> class CGAL main.cpp:143: error: reference
> to âWeighted_pointâ is ambiguous common.h:77: error: candidates are:
> typedef class
> CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_ca
> rtesian<double> > >, double> Weighted_point
> /CGAL-3.3.1/include/CGAL/Weighted_point.h:27: error:
> template<class Pt, class We> class CGAL::Weighted_point main.cpp:143:
> error: expected `;' before âwpâ main.cpp:144: error: âwpâ was not
> declare
>
> Line 77 is:
> typedef Regular_triangulation::Weighted_point Weighted_point;
>
> main.cpp line 143 is:
> Weighted_point wp((*it)->getCenter(),(*it)->getWeight());
>
> (*it)->getCenter() : returns a Point_3<K>
> (*it)->getWeight() : returns a value of type "dbl" (see above)
>
> Any ideas whats wrong? Thank you!
>
> Best regards,

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Ambigous reference to Weighted_Point during compilation

Laurent Rineau (GeometryFactory)
In reply to this post by Thomas Zangl - Home
On Tuesday 01 July 2008 12:24:00 Thomas Zangl - Home wrote:
> main.cpp:143: error: reference
> to âWeighted_pointâ is ambiguous
> common.h:77: error: candidates are:
> typedef class
> CGAL::Weighted_point<CGAL::Point_3<CGAL::Filtered_kernel<CGAL::Simple_ca
> rtesian<double> > >, double> Weighted_point
> /CGAL-3.3.1/include/CGAL/Weighted_point.h:27: error:
> template<class Pt, class We> class CGAL::Weighted_point

> Any ideas whats wrong? Thank you!

Your compiler is wrong, unless you have "using namespace CGAL;" somewhere (in
which case *you* are wrong).

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re:Ambigous reference to Weighted_Point during compilation

Thomas Zangl - Home
 
Am Tue, 1 Jul 2008 13:45:42 +0200, schrieb "Laurent Rineau" <[hidden email]>:

Hi!

>Your compiler is wrong, unless you have "using namespace CGAL;" somewhere (in
>which case *you* are wrong).

100% correct - I had a using namespace CGAL; in it. Removed it - works.

Thank you!

Best regards,
--
,yours Thomas Zangl, Bakk.rer.soc.oec. - [hidden email] -
- Freelancer - IT Consulting & Software Development -
- Student of Software Development-Economy (Master) -
            - http://blog.tzis.net -
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Ambigous reference to Weighted_Point during compilation

Laurent Rineau (GeometryFactory)
On Tuesday 01 July 2008 17:08:31 Thomas Zangl - Home wrote:
> Am Tue, 1 Jul 2008 13:45:42 +0200, schrieb "Laurent Rineau"
> <[hidden email]>:
>
> Hi!
>
> >Your compiler is wrong, unless you have "using namespace CGAL;" somewhere
> > (in which case *you* are wrong).
>
> 100% correct - I had a using namespace CGAL; in it. Removed it - works.

The other solution, if you still want to use "using namespace CGAL;",  is to
rename your typedef. :-)

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss