SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gio.cpp
Go to the documentation of this file.
1 namespace TSnap {
2 
3 // Reads the schema from the file (that is being parsed), and fills the SrcColId, DstColId, and the vectors with the index,
4 // within a given line, at which the source/destination nodes and edge attributes can be found in the file.
5 // The schema must have the format specified in WriteEdgeSchemaToFile.
6 int ReadEdgeSchemaFromFile(TSsParser& Ss, const char& Separator, int& SrcColId, int& DstColId, TStrIntH& IntAttrEVals, TStrIntH& FltAttrEVals, TStrIntH& StrAttrEVals) {
7  if (EDGES_START != Ss.GetFld(0)) return -1;
8  for (int i = 1; i < Ss.GetFlds(); i++) {
9  if (SRC_ID_NAME == Ss.GetFld(i)) {
10  SrcColId = i-1;
11  continue;
12  }
13  if (DST_ID_NAME == Ss.GetFld(i)) {
14  DstColId = i-1;
15  continue;
16  }
17  TStr Attr(Ss.GetFld(i));
18  TStr AttrType;
19  TStr AttrName;
20  Attr.SplitOnCh(AttrType, ':', AttrName);
21  if (AttrType == INT_TYPE_PREFIX) {
22  IntAttrEVals.AddDat(AttrName, i-1);
23  } else if (AttrType == FLT_TYPE_PREFIX) {
24  FltAttrEVals.AddDat(AttrName, i-1);
25  } else if (AttrType == STR_TYPE_PREFIX) {
26  StrAttrEVals.AddDat(AttrName, i-1);
27  } else {
28  return -1;
29  }
30  }
31  return 0;
32 }
33 
34 // Reads the edges from the file being parsed and adds the nodes/edges and edge attributes
35 // at the positions specified by SrcColId, DstColId, IntAttrEVal, etc. to the Graph.
36 // Continues going through the file until it hits the sentinel line END_SENTINEL, the end of the file,
37 // or a schema line. Returns a bool indicating whether the current line in the TSsParser is a schema line.
38 bool ReadEdgesFromFile(TSsParser& Ss, const char& Separator, PNEANet& Graph, int& SrcColId, int& DstColId, TStrIntH& IntAttrEVals, TStrIntH& FltAttrEVals, TStrIntH& StrAttrEVals) {
39  int SrcNId, DstNId;
40  while (Ss.Next()) {
41  if (Ss.GetFlds() == 0) continue;
42  if (END_SENTINEL == Ss.GetFld(0)) { return false; }
43  if (EDGES_START == Ss.GetFld(0)) { return true; }
44  if (NODES_START == Ss.GetFld(0)) { return true; }
45  if (Ss.GetFld(0)[0] == '#') { continue; }
46  if (! Ss.GetInt(SrcColId, SrcNId) || ! Ss.GetInt(DstColId, DstNId)) { continue; }
47  if (! Graph->IsNode(SrcNId)) { Graph->AddNode(SrcNId); }
48  if (! Graph->IsNode(DstNId)) { Graph->AddNode(DstNId); }
49  int EId = Graph->AddEdge(SrcNId, DstNId);
50  double FltAttrVal;
51  for (TStrIntH::TIter it = FltAttrEVals.BegI(); it < FltAttrEVals.EndI(); it++) {
52  if (Ss.GetFlt(it.GetDat(), FltAttrVal)) {
53  Graph->AddFltAttrDatE(EId, FltAttrVal, it.GetKey());
54  }
55  }
56  int IntAttrVal;
57  for (TStrIntH::TIter it = IntAttrEVals.BegI(); it < IntAttrEVals.EndI(); it++) {
58  if (Ss.GetInt(it.GetDat(), IntAttrVal)) {
59  Graph->AddIntAttrDatE(EId, IntAttrVal, it.GetKey());
60  }
61  }
62  char* StrAttrVal;
63  for (TStrIntH::TIter it = StrAttrEVals.BegI(); it < StrAttrEVals.EndI(); it++) {
64  StrAttrVal = Ss.GetFld(it.GetDat());
65  if (NULL_VAL != StrAttrVal) {
66  Graph->AddStrAttrDatE(EId, TStr(StrAttrVal), it.GetKey());
67  }
68  }
69  }
70  return false;
71 }
72 
73 
74 // Reads the node schema from the file, and fills the NId and the vectors with the index,
75 // within a given line, at which the node id and attributes can be found in the file.
76 // The schema must have the format specified in WriteNodeSchemaToFile.
77 int ReadNodeSchemaFromFile(TSsParser& Ss, const char& Separator, int& NId, TStrIntH& IntAttrNVals, TStrIntH& FltAttrNVals, TStrIntH& StrAttrNVals) {
78  if (NODES_START != Ss.GetFld(0)) return -1;
79  for (int i = 1; i < Ss.GetFlds(); i++) {
80  if (NID_NAME == Ss.GetFld(i)) {
81  NId = i-1;
82  continue;
83  }
84  TStr Attr(Ss.GetFld(i));
85  TStr AttrType;
86  TStr AttrName;
87  Attr.SplitOnCh(AttrType, ':', AttrName);
88  if (AttrType == INT_TYPE_PREFIX) {
89  IntAttrNVals.AddDat(AttrName, i-1);
90  } else if (AttrType == FLT_TYPE_PREFIX) {
91  FltAttrNVals.AddDat(AttrName, i-1);
92  } else if (AttrType == STR_TYPE_PREFIX) {
93  StrAttrNVals.AddDat(AttrName, i-1);
94  } else {
95  return -1;
96  }
97  }
98  return 0;
99 }
100 
101 // Reads the nodes from the file being parsed and adds the nodes and node attributes
102 // at the positions specified by NColId, IntAttrEVal, etc. to the Graph.
103 // Continues going through the file until it hits the sentinel line END_SENTINEL, the end of the file,
104 // or a schema line. Returns a bool indicating whether the current line in the TSsParser is a schema line.
105 bool ReadNodesFromFile(TSsParser& Ss, const char& Separator, PNEANet& Graph, int& NColId, TStrIntH& IntAttrNVals, TStrIntH& FltAttrNVals, TStrIntH& StrAttrNVals) {
106  int NId;
107  while (Ss.Next()) {
108  if (Ss.GetFlds() == 0) continue;
109  if (END_SENTINEL == Ss.GetFld(0)) { return false; }
110  if (EDGES_START == Ss.GetFld(0)) { return true; }
111  if (NODES_START == Ss.GetFld(0)) { return true; }
112  if (Ss.GetFld(0)[0] == '#') { continue; }
113  if (! Ss.GetInt(NColId, NId)) { continue; }
114  if (! Graph->IsNode(NId)) { Graph->AddNode(NId); }
115  double FltAttrVal;
116  for (TStrIntH::TIter it = FltAttrNVals.BegI(); it < FltAttrNVals.EndI(); it++) {
117  if (Ss.GetFlt(it.GetDat(), FltAttrVal)) {
118  Graph->AddFltAttrDatN(NId, FltAttrVal, it.GetKey());
119  }
120  }
121  int IntAttrVal;
122  for (TStrIntH::TIter it = IntAttrNVals.BegI(); it < IntAttrNVals.EndI(); it++) {
123  if (Ss.GetInt(it.GetDat(), IntAttrVal)) {
124  Graph->AddIntAttrDatN(NId, IntAttrVal, it.GetKey());
125  }
126  }
127  char* StrAttrVal;
128  for (TStrIntH::TIter it = StrAttrNVals.BegI(); it < StrAttrNVals.EndI(); it++) {
129  StrAttrVal = Ss.GetFld(it.GetDat());
130  if (NULL_VAL != StrAttrVal) {
131  Graph->AddStrAttrDatN(NId, TStr(StrAttrVal), it.GetKey());
132  }
133  }
134  }
135  return false;
136 }
137 
138 PNEANet LoadEdgeListNet(const TStr& InFNm, const char& Separator) {
139  PNEANet Graph = PNEANet::New();
140  TSsParser Ss(InFNm, Separator, true, false, false);
141  bool isSchemaLine = false;
142 
143  while (isSchemaLine || Ss.Next()) {
144  isSchemaLine = false;
145  if (Ss.GetFlds() == 0) continue;
146  if (NODES_START == Ss.GetFld(0)) {
147  // Map node attribute names to column number in the file.
148  TStrIntH IntAttrNVals;
149  TStrIntH FltAttrNVals;
150  TStrIntH StrAttrNVals;
151  int NColId = -1;
152  ReadNodeSchemaFromFile(Ss, Separator, NColId, IntAttrNVals, FltAttrNVals, StrAttrNVals);
153  isSchemaLine = ReadNodesFromFile(Ss, Separator, Graph, NColId, IntAttrNVals, FltAttrNVals, StrAttrNVals);
154  } else if (EDGES_START == Ss.GetFld(0)) {
155  // Map edge attribute names to column number in the file.
156  TStrIntH IntAttrEVals;
157  TStrIntH FltAttrEVals;
158  TStrIntH StrAttrEVals;
159  int SrcColId = -1;
160  int DstColId = -1;
161  ReadEdgeSchemaFromFile(Ss, Separator, SrcColId, DstColId, IntAttrEVals, FltAttrEVals, StrAttrEVals);
162  isSchemaLine = ReadEdgesFromFile(Ss, Separator, Graph, SrcColId, DstColId, IntAttrEVals, FltAttrEVals, StrAttrEVals);
163  }
164  }
165 
166  return Graph;
167 }
168 
169 // Writes the schema out to the file, which consists of the NId and node attributes, separated by tabs.
170 // Node attributes are written in the format <Type>:<Name>, where Type is either Int, Flt, or Str.
171 void WriteNodeSchemaToFile(FILE *F, TStrV &IntAttrNNames, TStrV &FltAttrNNames, TStrV &StrAttrNNames) {
172  fprintf(F, "%s\t%s", NODES_START.CStr(), NID_NAME.CStr());
173  for(int i = 0; i < IntAttrNNames.Len(); i++) {
174  fprintf(F, "\t%s:%s", INT_TYPE_PREFIX.CStr(), IntAttrNNames[i].CStr());
175  }
176  for(int i = 0; i < FltAttrNNames.Len(); i++) {
177  fprintf(F, "\t%s:%s", FLT_TYPE_PREFIX.CStr(), FltAttrNNames[i].CStr());
178  }
179  for(int i = 0; i < StrAttrNNames.Len(); i++) {
180  fprintf(F, "\t%s:%s", STR_TYPE_PREFIX.CStr(), StrAttrNNames[i].CStr());
181  }
182  fprintf(F, "\n");
183 }
184 
185 // Writes nodes out to the file. Each line consists of the node id followed by the
186 // int attributes in the order specified by the TStrV IntAttrNNames, the float attributes
187 // in the order specified by FltAttrNNames, and the string attributes specified by StrAttrNNames.
188 void WriteNodesToFile(FILE *F, const PNEANet& Graph, TStrV &IntAttrNNames, TStrV &FltAttrNNames, TStrV &StrAttrNNames) {
189  for (TNEANet::TNodeI NI = Graph->BegNI(); NI < Graph->EndNI(); NI++) {
190  fprintf(F, "%d", NI.GetId());
191  for(int i = 0; i < IntAttrNNames.Len(); i++) {
192  if (Graph->IsIntAttrDeletedN(NI.GetId(), IntAttrNNames[i])) {
193  fprintf(F, "\t%s", NULL_VAL.CStr());
194  continue;
195  }
196  int AttrIntVal = Graph->GetIntAttrDatN(NI.GetId(), IntAttrNNames[i]);
197  fprintf(F, "\t%d", AttrIntVal);
198  }
199  for(int i = 0; i < FltAttrNNames.Len(); i++) {
200  if (Graph->IsFltAttrDeletedN(NI.GetId(), FltAttrNNames[i])) {
201  fprintf(F, "\t%s", NULL_VAL.CStr());
202  continue;
203  }
204  double AttrFltVal = Graph->GetFltAttrDatN(NI.GetId(), FltAttrNNames[i]);
205  fprintf(F, "\t%f", AttrFltVal);
206  }
207  for(int i = 0; i < StrAttrNNames.Len(); i++) {
208  if (Graph->IsStrAttrDeletedN(NI.GetId(), StrAttrNNames[i])) {
209  fprintf(F, "\t%s", NULL_VAL.CStr());
210  continue;
211  }
212  char * AttrStrVal = Graph->GetStrAttrDatN(NI.GetId(), StrAttrNNames[i]).CStr();
213  fprintf(F, "\t%s", AttrStrVal);
214  }
215  fprintf(F, "\n");
216  }
217 }
218 
219 // Writes the schema out to the file, which consists of the SrcNId, DstNId, and edge attributes, separated by tabs.
220 // Edge attributes are written in the format <Type>:<Name>, where Type is either Int, Flt, or Str.
221 void WriteEdgeSchemaToFile(FILE *F, TStrV &IntAttrENames, TStrV &FltAttrENames, TStrV &StrAttrENames) {
222  fprintf(F, "%s\t%s\t%s", EDGES_START.CStr(), SRC_ID_NAME.CStr(), DST_ID_NAME.CStr());
223  for(int i = 0; i < IntAttrENames.Len(); i++) {
224  fprintf(F, "\t%s:%s", INT_TYPE_PREFIX.CStr(), IntAttrENames[i].CStr());
225  }
226  for(int i = 0; i < FltAttrENames.Len(); i++) {
227  fprintf(F, "\t%s:%s", FLT_TYPE_PREFIX.CStr(), FltAttrENames[i].CStr());
228  }
229  for(int i = 0; i < StrAttrENames.Len(); i++) {
230  fprintf(F, "\t%s:%s", STR_TYPE_PREFIX.CStr(), StrAttrENames[i].CStr());
231  }
232  fprintf(F, "\n");
233 }
234 
235 // Writes edges out to the file. Each line consists of the SrcNId and DstNId followed by the
236 // int attributes in the order specified by the TStrV IntAttrENames, the float attributes
237 // in the order specified by FltAttrENames, and the string attributes specified by StrAttrENames.
238 void WriteEdgesToFile(FILE *F, const PNEANet& Graph, TStrV &IntAttrENames, TStrV &FltAttrENames, TStrV &StrAttrENames) {
239  for (TNEANet::TEdgeI EI = Graph->BegEI(); EI < Graph->EndEI(); EI++) {
240  fprintf(F, "%d\t%d", EI.GetSrcNId(), EI.GetDstNId());
241  for(int i = 0; i < IntAttrENames.Len(); i++) {
242  if (Graph->IsIntAttrDeletedE(EI.GetId(), IntAttrENames[i])) {
243  fprintf(F, "\t%s", NULL_VAL.CStr());
244  continue;
245  }
246  int AttrIntVal = Graph->GetIntAttrDatE(EI.GetId(), IntAttrENames[i]);
247  fprintf(F, "\t%d", AttrIntVal);
248  }
249  for(int i = 0; i < FltAttrENames.Len(); i++) {
250  if (Graph->IsFltAttrDeletedE(EI.GetId(), FltAttrENames[i])) {
251  fprintf(F, "\t%s", NULL_VAL.CStr());
252  continue;
253  }
254  double AttrFltVal = Graph->GetFltAttrDatE(EI.GetId(), FltAttrENames[i]);
255  fprintf(F, "\t%f", AttrFltVal);
256  }
257  for(int i = 0; i < StrAttrENames.Len(); i++) {
258  if (Graph->IsStrAttrDeletedE(EI.GetId(), StrAttrENames[i])) {
259  fprintf(F, "\t%s", NULL_VAL.CStr());
260  continue;
261  }
262  char * AttrStrVal = Graph->GetStrAttrDatE(EI.GetId(), StrAttrENames[i]).CStr();
263  fprintf(F, "\t%s", AttrStrVal);
264  }
265  fprintf(F, "\n");
266  }
267 }
268 
269 void SaveEdgeListNet(const PNEANet& Graph, const TStr& OutFNm, const TStr& Desc) {
270  FILE *F = fopen(OutFNm.CStr(), "wt");
271  fprintf(F, "# Directed network: %s \n", OutFNm.CStr());
272  if (! Desc.Empty()) { fprintf(F, "# %s\n", Desc.CStr()); }
273  fprintf(F, "# Nodes: %d Edges: %d\n", Graph->GetNodes(), Graph->GetEdges());
274 
275  TStrV IntAttrNNames;
276  TStrV FltAttrNNames;
277  TStrV StrAttrNNames;
278  Graph->GetAttrNNames(IntAttrNNames, FltAttrNNames, StrAttrNNames);
279  WriteNodeSchemaToFile(F, IntAttrNNames, FltAttrNNames, StrAttrNNames);
280  WriteNodesToFile(F, Graph, IntAttrNNames, FltAttrNNames, StrAttrNNames);
281  fprintf(F, "%s\n", END_SENTINEL.CStr());
282 
283  TStrV IntAttrENames;
284  TStrV FltAttrENames;
285  TStrV StrAttrENames;
286  Graph->GetAttrENames(IntAttrENames, FltAttrENames, StrAttrENames);
287  WriteEdgeSchemaToFile(F, IntAttrENames, FltAttrENames, StrAttrENames);
288  WriteEdgesToFile(F, Graph, IntAttrENames, FltAttrENames, StrAttrENames);
289  fprintf(F, "%s\n", END_SENTINEL.CStr());
290 
291  fclose(F);
292 }
293 
294 
296 PNGraph LoadDyNet(const TStr& FNm) {
298  THashSet<TStr> NIdStr;
299  while (XmlLx.GetSym()!=xsyEof) {
300  if (XmlLx.Sym==xsySTag && XmlLx.TagNm=="network") {
301  PNGraph G = TNGraph::New();
302  XmlLx.GetSym();
303  while (XmlLx.TagNm=="link") {
304  TStr Str1, Val1, Str2, Val2;
305  XmlLx.GetArg(0, Str1, Val1); XmlLx.GetArg(1, Str2, Val2);
306  IAssert(Str1=="source" && Str2=="target");
307  NIdStr.AddKey(Val1); NIdStr.AddKey(Val2);
308  const int src=NIdStr.GetKeyId(Val1);
309  const int dst=NIdStr.GetKeyId(Val2);
310  if (! G->IsNode(src)) { G->AddNode(src); }
311  if (! G->IsNode(dst)) { G->AddNode(dst); }
312  G->AddEdge(src, dst);
313  XmlLx.GetSym();
314  }
315  return G;
316  }
317  }
318  return PNGraph();
319 }
320 
324  TVec<PNGraph> GraphV;
325  THashSet<TStr> NIdStr;
326  while (XmlLx.GetSym()!=xsyEof) {
327  if (XmlLx.Sym==xsySTag && XmlLx.TagNm=="network") {
328  PNGraph G = TNGraph::New();
329  GraphV.Add(G);
330  XmlLx.GetSym();
331  while (XmlLx.TagNm=="link") {
332  TStr Str1, Val1, Str2, Val2;
333  XmlLx.GetArg(0, Str1, Val1); XmlLx.GetArg(1, Str2, Val2);
334  IAssert(Str1=="source" && Str2=="target");
335  NIdStr.AddKey(Val1); NIdStr.AddKey(Val2);
336  const int src=NIdStr.GetKeyId(Val1);
337  const int dst=NIdStr.GetKeyId(Val2);
338  if (! G->IsNode(src)) { G->AddNode(src); }
339  if (! G->IsNode(dst)) { G->AddNode(dst); }
340  G->AddEdge(src, dst);
341  XmlLx.GetSym();
342  }
343  }
344  }
345  return GraphV;
346 }
347 
348 }; // namespace TSnap
#define IAssert(Cond)
Definition: bd.h:262
const TStr EDGES_START
Definition: gio.h:6
TXmlLxSym GetSym()
Definition: xml.cpp:757
TStr TagNm
Definition: xml.h:141
void GetArg(const int &ArgN, TStr &ArgNm, TStr &ArgVal) const
Definition: xml.h:166
void SaveEdgeListNet(const PNEANet &Graph, const TStr &OutFNm, const TStr &Desc)
Saves a network into a text file. Each line encodes either an edge or a node, along with its attribut...
Definition: gio.cpp:269
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New().
Definition: graph.h:477
Definition: xml.h:94
int GetKeyId(const TKey &Key) const
Definition: shash.h:1328
const TStr STR_TYPE_PREFIX
Definition: gio.h:14
static TPt New()
Definition: bd.h:479
int ReadNodeSchemaFromFile(TSsParser &Ss, const char &Separator, int &NId, TStrIntH &IntAttrNVals, TStrIntH &FltAttrNVals, TStrIntH &StrAttrNVals)
Definition: gio.cpp:77
static bool IsZipFNm(const TStr &FNm)
Check whether the file extension of FNm is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).
Definition: zipfl.h:56
TIter BegI() const
Definition: hash.h:213
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:575
Definition: ss.h:72
const TStr NID_NAME
Definition: gio.h:11
int AddNode(int NId=-1)
Adds a node of ID NId to the graph.
Definition: graph.cpp:236
bool GetInt(const int &FldN, int &Val) const
If the field FldN is an integer its value is returned in Val and the function returns true...
Definition: ss.cpp:447
Node iterator. Only forward iteration (operator++) is supported.
Definition: network.h:1792
TIter EndI() const
Definition: hash.h:218
int GetFlds() const
Returns the number of fields in the current line.
Definition: ss.h:116
bool ReadNodesFromFile(TSsParser &Ss, const char &Separator, PNEANet &Graph, int &NColId, TStrIntH &IntAttrNVals, TStrIntH &FltAttrNVals, TStrIntH &StrAttrNVals)
Definition: gio.cpp:105
int ReadEdgeSchemaFromFile(TSsParser &Ss, const char &Separator, int &SrcColId, int &DstColId, TStrIntH &IntAttrEVals, TStrIntH &FltAttrEVals, TStrIntH &StrAttrEVals)
Definition: gio.cpp:6
static PSIn New(const TStr &FNm)
Definition: zipfl.cpp:122
const char * GetFld(const int &FldN) const
Returns the contents of the field at index FldN.
Definition: ss.h:129
const TStr DST_ID_NAME
Definition: gio.h:10
TVec< PNGraph > LoadDyNetGraphV(const TStr &FNm)
For more info see ORA Network Analysis Data (http://www.casos.cs.cmu.edu/computational_tools/data2.php)
Definition: gio.cpp:322
void SplitOnCh(TStr &LStr, const char &SplitCh, TStr &RStr) const
Definition: dt.cpp:901
const TStr FLT_TYPE_PREFIX
Definition: gio.h:13
static PSIn New(const TStr &FNm)
Definition: fl.cpp:290
PNEANet LoadEdgeListNet(const TStr &InFNm, const char &Separator)
Loads a network from the text file InFNm with 1 node/edge per line ('Separator' separated columns...
Definition: gio.cpp:138
int AddEdge(const int &SrcNId, const int &DstNId)
Adds an edge from node SrcNId to node DstNId to the graph.
Definition: graph.cpp:321
Definition: xml.h:98
const TStr NODES_START
Definition: gio.h:7
void WriteEdgesToFile(FILE *F, const PNEANet &Graph, TStrV &IntAttrENames, TStrV &FltAttrENames, TStrV &StrAttrENames)
Definition: gio.cpp:238
const TStr END_SENTINEL
Definition: gio.h:8
bool IsNode(const int &NId) const
Tests whether ID NId is a node.
Definition: graph.h:542
TPt< TNGraph > PNGraph
Pointer to a directed graph (TNGraph)
Definition: graph.h:16
int AddKey(const TKey &Key)
Definition: shash.h:1254
Definition: xml.h:93
bool GetFlt(const int &FldN, double &Val) const
If the field FldN is a float its value is returned in Val and the function returns true...
Definition: ss.cpp:485
void WriteEdgeSchemaToFile(FILE *F, TStrV &IntAttrENames, TStrV &FltAttrENames, TStrV &StrAttrENames)
Definition: gio.cpp:221
Edge iterator. Only forward iteration (operator++) is supported.
Definition: network.h:1867
Definition: dt.h:412
bool Empty() const
Definition: dt.h:488
void WriteNodesToFile(FILE *F, const PNEANet &Graph, TStrV &IntAttrNNames, TStrV &FltAttrNNames, TStrV &StrAttrNNames)
Definition: gio.cpp:188
bool Next()
Loads next line from the input file.
Definition: ss.cpp:412
Definition: bd.h:196
const TStr NULL_VAL
Definition: gio.h:15
PNGraph LoadDyNet(const TStr &FNm)
For more info see ORA Network Analysis Data (http://www.casos.cs.cmu.edu/computational_tools/data2.php)
Definition: gio.cpp:296
TXmlLxSym Sym
Definition: xml.h:139
const TStr INT_TYPE_PREFIX
Definition: gio.h:12
char * CStr()
Definition: dt.h:476
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
const TStr SRC_ID_NAME
Definition: gio.h:9
TDat & AddDat(const TKey &Key)
Definition: hash.h:238
bool ReadEdgesFromFile(TSsParser &Ss, const char &Separator, PNEANet &Graph, int &SrcColId, int &DstColId, TStrIntH &IntAttrEVals, TStrIntH &FltAttrEVals, TStrIntH &StrAttrEVals)
Definition: gio.cpp:38
void WriteNodeSchemaToFile(FILE *F, TStrV &IntAttrNNames, TStrV &FltAttrNNames, TStrV &StrAttrNNames)
Definition: gio.cpp:171