Function sort

Synopsis

#include <Source/Falcor/Utils/Algorithm/DirectedGraphTraversal.h>

static std::vector< uint32_t > sort(DirectedGraph *pGraph)

Description

No description yet.

Source

Lines 169-188 in Source/Falcor/Utils/Algorithm/DirectedGraphTraversal.h.

static std::vector<uint32_t> sort(DirectedGraph* pGraph)
{
    DirectedGraphTopologicalSort ts(pGraph);
    for (uint32_t i = 0; i < ts.mpGraph->getCurrentNodeId(); i++)
    {
        if (ts.mVisited[i] == false && ts.mpGraph->getNode(i))
        {
            ts.sortInternal(i);
        }
    }
    std::vector<uint32_t> result;
    result.reserve(ts.mStack.size());
    while (ts.mStack.empty() == false)
    {
        result.push_back(ts.mStack.top());
        ts.mStack.pop();
    }
    return result;
}





Add Discussion as Guest

Log in