Skip to content

Commit c023057

Browse files
add comments to random # generator. Simpler handling of !LAGRAPH_SUITESPARSE case
1 parent 2182be1 commit c023057

37 files changed

+104
-170
lines changed

experimental/algorithm/LAGr_EdgeBetweennessCentrality.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
#define useAssign
2727
// #define debug
2828

29-
#if LAGRAPH_SUITESPARSE
30-
3129
#define LG_FREE_WORK \
3230
{ \
31+
printf ("free work\n") ; \
3332
GrB_free (&frontier) ; \
3433
GrB_free (&J_vec) ; \
3534
GrB_free (&I_vec) ; \
@@ -60,7 +59,6 @@
6059
LG_FREE_WORK ; \
6160
GrB_free (centrality) ; \
6261
}
63-
#endif
6462

6563
#include "LG_internal.h"
6664
#include <LAGraphX.h>
@@ -497,6 +495,7 @@ int LAGr_EdgeBetweennessCentrality
497495
// === finalize the centrality =============================================
498496
// =========================================================================
499497

498+
printf ("bye\n") ; \
500499
LG_FREE_WORK ;
501500
return (GrB_SUCCESS) ;
502501
#else

experimental/algorithm/LAGr_MarkovClustering.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
// FIXME: ready to consider for src
1919

20-
#if LAGRAPH_SUITESPARSE
21-
2220
#define LG_FREE_WORK \
2321
{ \
2422
GrB_free(&T_prev); \
@@ -38,7 +36,6 @@
3836
LG_FREE_WORK; \
3937
GrB_free(c_f); \
4038
}
41-
#endif
4239

4340
#include "LG_internal.h"
4441
#include <LAGraphX.h>

experimental/algorithm/LAGr_Modularity.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
// https://arxiv.org/abs/0906.0612 pp. 15-16
3737

38-
#if LAGRAPH_SUITESPARSE
39-
4038
#define LG_FREE_WORK \
4139
{ \
4240
GrB_free(&l); \
@@ -59,8 +57,6 @@
5957
LG_FREE_WORK; \
6058
}
6159

62-
#endif
63-
6460
#include "LG_internal.h"
6561
#include <LAGraphX.h>
6662

experimental/algorithm/LAGr_PartitionQuality.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
// https://arxiv.org/abs/0906.0612 pp. 15
3232

33-
#if LAGRAPH_SUITESPARSE
3433
#define LG_FREE_WORK \
3534
{ \
3635
GrB_free(&trace); \
@@ -44,7 +43,6 @@
4443
{ \
4544
LG_FREE_WORK; \
4645
}
47-
#endif
4846

4947
#include "LG_internal.h"
5048
#include <LAGraphX.h>

experimental/algorithm/LAGr_PeerPressureClustering.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
// FIXME: define the output vector c that defines the cluster assignment
2020
// FIXME: some unused variables (the vector c)
2121

22-
#if LAGRAPH_SUITESPARSE
23-
2422
#define LG_FREE_WORK \
2523
{ \
2624
GrB_free(&A); \
@@ -49,7 +47,6 @@
4947
LG_FREE_WORK; \
5048
GrB_free(c_f); \
5149
}
52-
#endif
5350

5451
#include "LG_internal.h"
5552
#include <LAGraphX.h>

experimental/algorithm/LAGraph_CFL_reachability.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// Querying Using Linear Algebra", URL:
1616
// https://disser.spbu.ru/files/2022/disser_azimov.pdf
1717

18-
#if LAGRAPH_SUITESPARSE
19-
2018
#define LG_FREE_WORK \
2119
{ \
2220
LAGraph_Free ((void **) &nnzs, msg) ; \
@@ -34,7 +32,6 @@
3432
\
3533
LG_FREE_WORK; \
3634
}
37-
#endif
3835

3936
#include "LG_internal.h"
4037
#include <LAGraphX.h>

experimental/algorithm/LAGraph_Coarsen_Matching.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ This method requires O(n + e) space for an undirected graph with e edges and n n
6363
// #define dbg
6464
// #define burble
6565

66-
#if LAGRAPH_SUITESPARSE
67-
6866
#undef LG_FREE_ALL
6967
#undef LG_FREE_WORK
7068

@@ -277,8 +275,6 @@ static int LAGraph_Parent_to_S
277275

278276
#define OPTIMIZE_PUSH_PULL
279277

280-
#endif
281-
282278
int LAGraph_Coarsen_Matching
283279
(
284280
// outputs:
@@ -317,10 +313,6 @@ int LAGraph_Coarsen_Matching
317313
// check properties (no self-loops, undirected
318314
LG_ASSERT_MSG (G->nself_edges == 0, LAGRAPH_NO_SELF_EDGES_ALLOWED, "G->nself_edges must be zero") ;
319315

320-
#if !LAGRAPH_SUITESPARSE
321-
LG_ASSERT (false, GrB_NOT_IMPLEMENTED) ;
322-
#endif
323-
324316
LG_ASSERT (coarsened != NULL, GrB_NULL_POINTER) ;
325317

326318
//------------------------------------------------------------------------------

experimental/algorithm/LAGraph_EstimateDiameter.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ int LAGraph_EstimateDiameter
9090
char *msg
9191
)
9292
{
93+
#if LAGRAPH_SUITESPARSE
9394

9495
//--------------------------------------------------------------------------
9596
// check inputs
@@ -106,10 +107,6 @@ int LAGraph_EstimateDiameter
106107
GrB_Vector candidateSrcs = NULL ; // work vector for getting sources for the next iteration of the loop
107108
GrB_BinaryOp Mod = NULL ;
108109

109-
#if !LAGRAPH_SUITESPARSE
110-
LG_ASSERT (false, GrB_NOT_IMPLEMENTED) ;
111-
#else
112-
113110
bool compute_periphery = (peripheral != NULL) ;
114111
if (compute_periphery ) (*peripheral) = NULL ;
115112
bool compute_diameter = (diameter != NULL) ;
@@ -257,5 +254,7 @@ int LAGraph_EstimateDiameter
257254
(*diameter ) = d ;
258255
LG_FREE_WORK ;
259256
return (GrB_SUCCESS) ;
257+
#else
258+
return (GrB_NOT_IMPLEMENTED) ;
260259
#endif
261260
}

experimental/algorithm/LAGraph_ExactDiameter.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ int LAGraph_ExactDiameter
5959
char *msg
6060
)
6161
{
62+
#if LAGRAPH_SUITESPARSE
6263

6364
//--------------------------------------------------------------------------
6465
// check inputs
@@ -72,10 +73,6 @@ int LAGraph_ExactDiameter
7273
GrB_Index d ; // diameter
7374
GrB_Vector srcs = NULL ;
7475

75-
#if !LAGRAPH_SUITESPARSE
76-
LG_ASSERT (false, GrB_NOT_IMPLEMENTED) ;
77-
#else
78-
7976
bool compute_periphery = (peripheral != NULL) ;
8077
if (compute_periphery ) (*peripheral) = NULL ;
8178
bool compute_eccentricity = (eccentricity != NULL) ;
@@ -171,5 +168,7 @@ int LAGraph_ExactDiameter
171168
(*diameter) = d;
172169
LG_FREE_WORK ;
173170
return (GrB_SUCCESS) ;
171+
#else
172+
return (GrB_NOT_IMPLEMENTED) ;
174173
#endif
175174
}

experimental/algorithm/LAGraph_FastGraphletTransform.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ int LAGraph_FastGraphletTransform
107107
char *msg
108108
)
109109
{
110+
#if LAGRAPH_SUITESPARSE
111+
110112
LG_CLEAR_MSG ;
111113
GrB_Index const U_inv_I[] = {0, 1, 2, 2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 15} ;
112114
GrB_Index const U_inv_J[] = {0, 1, 2, 4, 3, 4, 4, 5, 9, 10, 12, 13, 14, 15, 6, 10, 11, 12, 13, 14, 15, 7, 9, 10, 13, 14, 15, 8, 11, 14, 15, 9, 13, 15, 10, 13, 14, 15, 11, 14, 15, 12, 13, 14, 15, 13, 15, 14, 15, 15} ;
@@ -165,10 +167,6 @@ int LAGraph_FastGraphletTransform
165167
GrB_Index nvals ;
166168
int64_t ntri ;
167169

168-
#if !LAGRAPH_SUITESPARSE
169-
LG_ASSERT (false, GrB_NOT_IMPLEMENTED) ;
170-
#else
171-
172170
A = G->A ;
173171

174172
GrB_Index n ;
@@ -649,7 +647,8 @@ int LAGraph_FastGraphletTransform
649647
//--------------------------------------------------------------------------
650648

651649
LG_FREE_WORK ;
652-
653-
return (0) ;
650+
return (GrB_SUCCESS) ;
651+
#else
652+
return (GrB_NOT_IMPLEMENTED) ;
654653
#endif
655654
}

0 commit comments

Comments
 (0)