-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning up clustering code for v1.2 branch #250
Conversation
GRB_TRY(GrB_reduce(w, NULL, NULL, GrB_PLUS_MONOID_FP32, T_temp, | ||
GrB_DESC_T0)); | ||
GRB_TRY(GrB_apply(w, NULL, NULL, GrB_MINV_FP32, w, NULL)); | ||
if (D != NULL) GrB_free(&D); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is necessary, I was getting memory leaks if this check was not done though
|
||
// Set T to the previous iteration | ||
if (T != NULL) GrB_free(&T); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not entirely sure if a deep copy is needed here
n = nrows; | ||
|
||
// All types of input matrices get cast to type FP32 for this algorithm | ||
GRB_TRY(GrB_Matrix_new(&A, GrB_FP32, n, n)); | ||
GRB_TRY(GrB_apply(A, NULL, NULL, GrB_IDENTITY_FP32, G->A, NULL)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this okay to do again?
LG_FREE_WORK; \ | ||
#define LG_FREE_ALL \ | ||
{ \ | ||
LG_FREE_WORK; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not freeing the double pointer handles, not sure if I need to or if that's just for GB objects
|
||
m = out_degree_sum; | ||
double norm = 1.0 / (m * m); | ||
|
||
// Compute modularity | ||
// compute modularity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need input on if there needs to be a distinction between undirected and directed. I feel like there should be, however I get consistent results with this code.
|
||
// Now we need to find *which* cluster(s) cast the highest votes, for this we need argmax code | ||
// taken from T. Davis SS User Guide p. 286 | ||
if (D != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this again, to avoid memory leaks. needed??
I still need to add the tests. |
No description provided.