示例#1
0
文件: Graph.cpp 项目: daajoe/htd
bool htd::Graph::isEdge(const htd::ConstCollection<htd::vertex_t> & elements) const
{
    bool ret = false;

    if (elements.size() == 2)
    {
        ret = base_->isEdge(elements);
    }

    return ret;
}
示例#2
0
文件: Graph.cpp 项目: daajoe/htd
htd::ConstCollection<htd::id_t> htd::Graph::associatedEdgeIds(const htd::ConstCollection<htd::vertex_t> & elements) const
{
    htd::VectorAdapter<htd::id_t> ret;

    if (elements.size() == 2)
    {
        auto & result = ret.container();

        for (const htd::Hyperedge & edge : hyperedges())
        {
            if (std::equal(edge.begin(), edge.end(), elements.begin()))
            {
                result.push_back(edge.id());
            }
        }
    }

    return htd::ConstCollection<htd::id_t>::getInstance(ret);
}
示例#3
0
 inline bool operator==(const htd::ConstCollection<T> & rhs) const
 {
     return size() == rhs.size() && std::equal(begin(), end(), rhs.begin());
 }