MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _print_matrix

Function _print_matrix

tests/unit/test_algebraic_expression.c:202–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void _print_matrix(GrB_Matrix mat) {
203 GrB_Index ncols, nrows, nvals;
204 GrB_Matrix_ncols(&ncols, mat);
205 GrB_Matrix_nrows(&nrows, mat);
206 GrB_Matrix_nvals(&nvals, mat);
207#ifdef __aarch64__
208 printf("ncols: %llu, nrows: %llu, nvals: %llu\n", ncols, nrows, nvals);
209#else
210 printf("ncols: %lu, nrows: %lu, nvals: %lu\n", ncols, nrows, nvals);
211#endif
212
213 GrB_Index I[nvals]; // array for returning row indices of tuples
214 GrB_Index J[nvals]; // array for returning col indices of tuples
215 bool X[nvals]; // array for returning values of tuples
216
217 GrB_Matrix_extractTuples_BOOL(I, J, X, &nvals, mat);
218 for(int i = 0; i < nvals; i++) {
219 printf("[%lu,%lu,%d]\n", I[i], J[i], X[i]);
220 }
221}
222
223bool _compare_matrices(GrB_Matrix expected, RG_Matrix actual) {
224 GrB_Matrix a = expected;

Callers 1

_compare_matricesFunction · 0.85

Calls 3

GrB_Matrix_ncolsFunction · 0.85
GrB_Matrix_nrowsFunction · 0.85
GrB_Matrix_nvalsFunction · 0.85

Tested by

no test coverage detected