-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBaseGraph.cpp
48 lines (39 loc) · 1.21 KB
/
BaseGraph.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
///////////////////////////////////////////////////////////////////////////////
/// BaseGraph.cpp
/// <TODO: insert file description here>
///
/// @remarks <TODO: insert remarks here>
///
/// @author Yan Qi @date 6/6/2010
///
/// $Id: BaseGraph.cpp 52 2010-06-14 06:53:06Z yan.qi.asu $
///
///////////////////////////////////////////////////////////////////////////////
#include <limits>
#include <string>
#include <algorithm>
#include "BaseGraph.h"
const double BaseGraph::DISCONNECT = (std::numeric_limits<double>::max)();
void BaseGraph::clear()
{
m_nEdgeNum = 0;
m_nVertexNum = 0;
for(std::map<BaseVertex*, std::set<BaseVertex*>*>::const_iterator pos=m_mpFaninVertices.begin();
pos!=m_mpFaninVertices.end(); ++pos)
{
delete pos->second;
}
m_mpFaninVertices.clear();
for(std::map<BaseVertex*, std::set<BaseVertex*>*>::const_iterator pos=m_mpFanoutVertices.begin();
pos!=m_mpFanoutVertices.end(); ++pos)
{
delete pos->second;
}
m_mpFanoutVertices.clear();
m_mpEdgeCodeWeight.clear();
/*m_stVertices.clear();*/
/*m_mpVertexIndex.clear();*/
//clear the list of vertices objects
for_each(m_vtVertices.begin(), m_vtVertices.end(), DeleteFunc<BaseVertex>());
m_vtVertices.clear();
}