Skip to content
Snippets Groups Projects
Commit 2bb80853 authored by Stefen Guzik's avatar Stefen Guzik
Browse files

new != operator
removed some unused functors
parent cbc673c1
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,14 @@ class MEdge {
}
};
//--Operators for comparing edges
inline bool operator!=(const MEdge &e1, const MEdge &e2)
{
return (e1.getMinVertex() != e2.getMinVertex() ||
e1.getMaxVertex() != e2.getMaxVertex());
}
//--The following function objects compare the addresses of the mesh vertices.
//--Equal, Less, and a Hash are defined.
......@@ -76,14 +84,6 @@ struct Equal_Edge : public std::binary_function<MEdge, MEdge, bool> {
}
};
struct Equal_EdgePtr : public std::binary_function<MEdge*, MEdge*, bool> {
bool operator()(const MEdge *const e1, const MEdge *const e2) const
{
return (e1->getMinVertex() == e2->getMinVertex() &&
e1->getMaxVertex() == e2->getMaxVertex());
}
};
struct Less_Edge : public std::binary_function<MEdge, MEdge, bool> {
bool operator()(const MEdge &e1, const MEdge &e2) const
{
......@@ -94,16 +94,6 @@ struct Less_Edge : public std::binary_function<MEdge, MEdge, bool> {
}
};
struct Less_EdgePtr : public std::binary_function<MEdge*, MEdge*, bool> {
bool operator()(const MEdge *const e1, const MEdge *const e2) const
{
if(e1->getMinVertex() < e2->getMinVertex()) return true;
if(e1->getMinVertex() > e2->getMinVertex()) return false;
if(e1->getMaxVertex() < e2->getMaxVertex()) return true;
return false;
}
};
struct Hash_Edge : public std::unary_function<MEdge, size_t> {
size_t operator()(const MEdge &e) const
{
......@@ -114,14 +104,4 @@ struct Hash_Edge : public std::unary_function<MEdge, size_t> {
}
};
struct Hash_EdgePtr : public std::unary_function<MEdge*, size_t> {
size_t operator()(const MEdge *const e) const
{
const MVertex *v[2];
v[0] = e->getMinVertex();
v[1] = e->getMaxVertex();
return HashFNV1a<sizeof(MVertex*[2])>::eval(v);
}
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment