Add custom equality comparison for SCCs
This commit is contained in:
@@ -17,12 +17,19 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
T representative() { return proxy; };
|
T representative() { return proxy; };
|
||||||
|
|
||||||
|
bool operator==(const SCC& o) const;
|
||||||
private:
|
private:
|
||||||
// Each SCC has a representative vertex that helps
|
// Each SCC has a representative vertex that helps
|
||||||
// answer strong connectivity queries in O(1) time
|
// answer strong connectivity queries in O(1) time
|
||||||
T proxy;
|
T proxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
bool SCC<T>::operator==(const SCC& o) const{
|
||||||
|
return proxy == o.proxy;
|
||||||
|
}
|
||||||
|
|
||||||
}; // namespace graph
|
}; // namespace graph
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user