SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TSnap::TSnapDetail::TDelSelfEdges< PGraph, true > Struct Template Reference

#include <alg.h>

Static Public Member Functions

static void Do (const PGraph &Graph)
 

Detailed Description

template<class PGraph>
struct TSnap::TSnapDetail::TDelSelfEdges< PGraph, true >

Definition at line 401 of file alg.h.

Member Function Documentation

template<class PGraph >
static void TSnap::TSnapDetail::TDelSelfEdges< PGraph, true >::Do ( const PGraph &  Graph)
inlinestatic

Definition at line 402 of file alg.h.

References TVec< TVal, TSizeTy >::Add(), IAssert, and TVec< TVal, TSizeTy >::Len().

402  {
403  TIntV EdgeV;
404  for (typename PGraph::TObj::TEdgeI EI = Graph->BegEI(); EI < Graph->EndEI(); EI++) {
405  if (EI.GetSrcNId() == EI.GetDstNId()) {
406  IAssert(EI.GetId() >= 0); // real edge id
407  EdgeV.Add(EI.GetId());
408  }
409  }
410  for (int i = 0; i < EdgeV.Len(); i++) { // delete all edges between a pair of nodes
411  Graph->DelEdge(EdgeV[i]);
412  }
413  }
#define IAssert(Cond)
Definition: bd.h:262
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:


The documentation for this struct was generated from the following file: