MCPcopy Create free account
hub / github.com/creatale/node-dv / cvGraphRemoveVtxByPtr

Function cvGraphRemoveVtxByPtr

deps/opencv/modules/core/src/datastructs.cpp:2632–2655  ·  view source on GitHub ↗

Remove a vertex from the graph together with its incident edges: */

Source from the content-addressed store, hash-verified

2630
2631/* Remove a vertex from the graph together with its incident edges: */
2632CV_IMPL int
2633cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx )
2634{
2635 int count = -1;
2636
2637 if( !graph || !vtx )
2638 CV_Error( CV_StsNullPtr, "" );
2639
2640 if( !CV_IS_SET_ELEM(vtx))
2641 CV_Error( CV_StsBadArg, "The vertex does not belong to the graph" );
2642
2643 count = graph->edges->active_count;
2644 for( ;; )
2645 {
2646 CvGraphEdge *edge = vtx->first;
2647 if( !edge )
2648 break;
2649 cvGraphRemoveEdgeByPtr( graph, edge->vtx[0], edge->vtx[1] );
2650 }
2651 count -= graph->edges->active_count;
2652 cvSetRemoveByPtr( (CvSet*)graph, vtx );
2653
2654 return count;
2655}
2656
2657
2658/* Remove a vertex from the graph together with its incident edges: */

Callers 1

core_c.hFile · 0.85

Calls 2

cvGraphRemoveEdgeByPtrFunction · 0.85
cvSetRemoveByPtrFunction · 0.85

Tested by

no test coverage detected