Skip to content

Commit

Permalink
BC updated to new variant (FP64, and LAGraph_Pattern)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Feb 15, 2021
1 parent cb5560f commit d15c597
Show file tree
Hide file tree
Showing 5 changed files with 584 additions and 362 deletions.
306 changes: 0 additions & 306 deletions Experimental2/Algorithm/LAGraph_B2.c

This file was deleted.

29 changes: 1 addition & 28 deletions Experimental2/Algorithm/LAGraph_VertexCentrality_Betweenness.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ int LAGraph_VertexCentrality_Betweenness // vertex betweenness-centrality
// S [depth] = pattern of frontier
//----------------------------------------------------------------------

GrB_TRY (GrB_Matrix_new (&(S [depth]), GrB_BOOL, ns, n)) ;
GrB_TRY (GrB_apply (S [depth], NULL, NULL, GxB_ONE_BOOL, frontier,
NULL)) ;
LAGraph_TRY (LAGraph_Pattern (&(S [depth]), frontier, msg)) ;

//----------------------------------------------------------------------
// Accumulate path counts: paths += frontier
Expand All @@ -192,25 +190,6 @@ int LAGraph_VertexCentrality_Betweenness // vertex betweenness-centrality
GrB_TRY (GrB_assign (paths, NULL, GrB_PLUS_FP64, frontier, GrB_ALL, n,
GrB_ALL, ns, NULL)) ;

#if 0
{
GrB_Matrix crud ;
GrB_Matrix_new (&crud, GrB_BOOL, ns, n) ;
GrB_apply (crud, NULL, NULL, GxB_ISINF_FP64, paths, NULL) ;
int64_t infcount = 0 ;
GrB_reduce (&infcount, NULL, GrB_PLUS_MONOID_INT64, crud, NULL) ;
GrB_free (&crud) ;
GrB_Matrix_new (&crud, GrB_BOOL, ns, n) ;
GrB_apply (crud, NULL, NULL, GxB_ISNAN_FP64, paths, NULL) ;
int64_t nancount = 0 ;
GrB_reduce (&nancount, NULL, GrB_PLUS_MONOID_INT64, crud, NULL) ;
GrB_free (&crud) ;
if (infcount > 0 || nancount > 0) printf ("%5ld: inf %ld nan %ld\n",
depth, infcount, nancount) ;
}
#endif


//----------------------------------------------------------------------
// Update frontier: frontier<!paths> = frontier*A
//----------------------------------------------------------------------
Expand Down Expand Up @@ -248,12 +227,6 @@ int LAGraph_VertexCentrality_Betweenness // vertex betweenness-centrality

GrB_TRY (GrB_free (&frontier)) ;

#if 0
double maxpath ;
GrB_TRY (GrB_reduce (&maxpath, NULL, GrB_MAX_MONOID_FP64, paths, NULL)) ;
printf ("max(paths): %g\n", maxpath) ;
#endif

// =========================================================================
// === Betweenness centrality computation phase ============================
// =========================================================================
Expand Down
Loading

0 comments on commit d15c597

Please sign in to comment.