Skip to content

Commit 4ba026c

Browse files
Merge pull request #368 from GraphBLAS/with_GraphBLAS_v10
hash matrix: only for GraphBLAS v10
2 parents 75c4144 + e9a7b4e commit 4ba026c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

experimental/utility/LAGraph_Matrix_Hash.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//------------------------------------------------------------------------------
2-
// LAGraph_Random_Matrix: generate a random matrix
2+
// LAGraph_Matrix_Hash: generate a single hash value for an entire matrix
33
//------------------------------------------------------------------------------
44

55
// LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved.
@@ -57,6 +57,7 @@ GrB_Info LAGraph_Hash_Matrix(
5757
const GrB_Matrix A, // matrix to hash
5858
char *msg
5959
) {
60+
#if LG_SUITESPARSE_GRAPHBLAS_V10
6061
GrB_Matrix C = NULL;
6162
GrB_IndexUnaryOp lg_hash_edge = NULL;
6263
GrB_Index nrows, ncols;
@@ -75,12 +76,19 @@ GrB_Info LAGraph_Hash_Matrix(
7576
hash, GrB_BXOR_UINT64, GxB_BXOR_UINT64_MONOID, C, NULL)) ;
7677
LG_FREE_ALL;
7778
return GrB_SUCCESS;
79+
#else
80+
return GrB_NOT_IMPLEMENTED;
81+
#endif
7882
}
7983

8084
GrB_Info LAGraph_Hash_Vector(
8185
uint64_t *hash, // [output] hash
8286
const GrB_Vector v, // Vector to hash
8387
char *msg
8488
) {
89+
#if LG_SUITESPARSE_GRAPHBLAS_V10
8590
return LAGraph_Hash_Matrix(hash, (GrB_Matrix) v, NULL);
91+
#else
92+
return GrB_NOT_IMPLEMENTED;
93+
#endif
8694
}

0 commit comments

Comments
 (0)