Skip to content
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

Merged
merged 15 commits into from
Apr 17, 2024

Conversation

cquil11
Copy link

@cquil11 cquil11 commented Apr 12, 2024

No description provided.

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);
Copy link
Author

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);
Copy link
Author

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));
Copy link
Author

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; \
Copy link
Author

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
Copy link
Author

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)
Copy link
Author

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??

@cquil11
Copy link
Author

cquil11 commented Apr 12, 2024

I still need to add the tests.

@cquil11 cquil11 marked this pull request as ready for review April 17, 2024 14:15
@DrTimothyAldenDavis DrTimothyAldenDavis merged commit 7ebd378 into GraphBLAS:v1.2 Apr 17, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants