00001
00002
00003 #ifndef _coord_h
00004 #define _coord_h
00005
00006 #include <math.h>
00007 #include "hash_map.h"
00008
00009 typedef std::pair<double, double> coordPair;
00010
00016 const static double ctol = 1.0e-14;
00017
00018 size_t coordHash(coordPair P);
00019
00020 HASHMAP_NAMESPACE_BEGIN
00022 template<>
00023 struct hash<coordPair>
00024 {
00026 size_t operator()(coordPair s) const
00027 {
00028 return coordHash(s);
00029 }
00030 };
00031 HASHMAP_NAMESPACE_END
00032
00034 struct eqcoord
00035 {
00037 bool operator()(coordPair c1, coordPair c2) const
00038 {
00039 return ( fabs(c1.first - c2.first ) < ctol &&
00040 fabs(c1.second - c2.second) < ctol );
00041 }
00042 };
00043
00044
00045 #endif