BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/compare_vertices.h
Go to the documentation of this file.
00001 // Copyright (c) 1999  Martin-Luther-University Halle-Wittenberg (Germany).
00002 // All rights reserved.
00003 //
00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under
00005 // the terms of the Q Public License version 1.0.
00006 // See the file LICENSE.QPL distributed with CGAL.
00007 //
00008 // Licensees holding a valid commercial license may use this file in
00009 // accordance with the commercial license agreement provided with the software.
00010 //
00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 //
00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Point_set_2/include/CGAL/compare_vertices.h $
00015 // $Id: compare_vertices.h 30322 2006-04-14 15:07:17Z lsaboret $
00016 // 
00017 //
00018 // Author(s)     : Matthias Baesken
00019 
00020 #ifndef CGAL_COMPARE_VERTICES_H
00021 #define CGAL_COMPARE_VERTICES_H
00022 
00023 CGAL_BEGIN_NAMESPACE
00024 
00025 namespace CGALi {
00026 
00027 // compare function objects for the priority queues used in nearest neighbor search
00028 template<class VP, class NT,class MAP_TYPE>
00029 class compare_vertices {
00030  public:
00031   //std::map<VP,NT,std::less<VP> > *pmap;
00032   MAP_TYPE* pmap;
00033   
00034   compare_vertices(MAP_TYPE *p){ pmap=p; }
00035   
00036   bool operator()(VP e1, VP e2)
00037   // get the priorities from the map and return result of comparison ...
00038   { NT& v1 = (*pmap)[e1];
00039     NT& v2 = (*pmap)[e2];
00040     return (v1 > v2);
00041   }
00042 };
00043 
00044 
00045 } // namespace CGALi
00046 
00047 
00048 CGAL_END_NAMESPACE
00049 
00050 #endif // CGAL_COMPARE_VERTICES_H
00051 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines