#include <circles.h>
Definition at line 5 of file circles.h.
TGraphAttributes::TGraphAttributes |
( |
PUNGraph |
G, |
|
|
const char * |
nodeFeaturePath, |
|
|
const char * |
groundtruthPath |
|
) |
| |
- Parameters
-
G | the graph on which to run community detection |
nodeFeaturePath | the path of the file containing node attributes |
Definition at line 194 of file circles.h.
198 FILE* f = fopen(NodeFeaturePath,
"r");
201 fscanf(f,
"%d %d", &NNodes, &nF);
204 for (
int i = 0; i < NNodes; i++) {
206 fscanf(f,
"%d", &nid);
208 if (!G->IsNode(nid)) {
209 printf(
"Warning: %d is not a node in G.\n", nid);
212 for (
int x = 0; x < nF; x++) {
219 if (G->IsNode(nid)) {
225 f = fopen(GroundTruthPath,
"r");
227 printf(
"Groundtruth file %s not found.\n", GroundTruthPath);
230 char* CircleName =
new char [1000];
231 while (fscanf(f,
"%s", CircleName) == 1)
236 fscanf(f,
"%d", &nid);
241 if (c ==
'\n')
break;
242 if (c >=
'0' && c <=
'9') {
247 if (c ==
'\n')
break;
251 delete [] CircleName;
263 TInt k = it.GetKey();
266 diff = abs(it.GetDat() -
NodeFeatures.GetDat(nj).GetDat(k));
268 diff = abs(it.GetDat());
276 TInt k = it.GetKey();
279 diff = abs(it.GetDat() -
NodeFeatures.GetDat(ni).GetDat(k));
281 diff = abs(it.GetDat());
TPair< TInt, TInt > TIntPr
TSizeTy Len() const
Returns the number of elements in the vector.
THash< TInt, TIntIntH > NodeFeatures
THash< TIntPr, TIntIntH > EdgeFeatures
int AddKey(const TKey &Key)
TVec< TIntSet > GroundTruth
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
TGraphAttributes::~TGraphAttributes |
( |
| ) |
|
|
inline |
TCRef TGraphAttributes::CRef |
TInt TGraphAttributes::NFeatures |
The documentation for this class was generated from the following file: