gpt4 book ai didi

c++ - 卡在 boost 邻接列表清除

转载 作者:行者123 更新时间:2023-11-28 07:45:55 24 4
gpt4 key购买 nike

我尝试使用用 C++ ( https://sites.google.com/site/roboticssaurav/strokewidthnokia ) 编写的文本检测应用程序,但代码挂起。我发现这个问题的根源是其中一个函数使用了 50K 顶点和 150K 边的大图,并且所有代码都卡在调用邻接列表“clear”的地方。

std::vector< std::vector<Point2d> >
findLegallyConnectedComponents (IplImage * SWTImage,
std::vector<Ray> & rays)
{
...
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> Graph;
...
Graph g(num_of_vertices);
...
}

离开这个函数后,g.clear() 将被调用,程序就此挂起。我怎样才能摆脱这个错误?谢谢。

最佳答案

所以这个问题在 Release模式下就消失了,所以这就是解决方案。

关于c++ - 卡在 boost 邻接列表清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14883377/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com