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

Function test_RGMatrix_mxm

tests/unit/test_rg_matrix.c:1372–1456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370}
1371
1372void test_RGMatrix_mxm() {
1373 GrB_Type t = GrB_BOOL;
1374 RG_Matrix A = NULL;
1375 RG_Matrix B = NULL;
1376 RG_Matrix C = NULL;
1377 RG_Matrix D = NULL;
1378 GrB_Matrix C_M = NULL;
1379 GrB_Matrix D_M = NULL;
1380 GrB_Info info = GrB_SUCCESS;
1381 GrB_Index nrows = 100;
1382 GrB_Index ncols = 100;
1383 bool sync = false;
1384
1385 info = RG_Matrix_new(&A, t, nrows, ncols);
1386 TEST_ASSERT(info == GrB_SUCCESS);
1387
1388 info = RG_Matrix_new(&B, t, nrows, ncols);
1389 TEST_ASSERT(info == GrB_SUCCESS);
1390
1391 info = RG_Matrix_new(&C, t, nrows, ncols);
1392 TEST_ASSERT(info == GrB_SUCCESS);
1393
1394 info = RG_Matrix_new(&D, t, nrows, ncols);
1395 TEST_ASSERT(info == GrB_SUCCESS);
1396
1397 // set elements
1398 info = RG_Matrix_setElement_BOOL(A, 0, 1);
1399 TEST_ASSERT(info == GrB_SUCCESS);
1400 info = RG_Matrix_setElement_BOOL(A, 2, 3);
1401 TEST_ASSERT(info == GrB_SUCCESS);
1402 info = RG_Matrix_setElement_BOOL(B, 1, 2);
1403 TEST_ASSERT(info == GrB_SUCCESS);
1404 info = RG_Matrix_setElement_BOOL(B, 3, 4);
1405 TEST_ASSERT(info == GrB_SUCCESS);
1406
1407 //--------------------------------------------------------------------------
1408 // flush matrix, sync
1409 //--------------------------------------------------------------------------
1410
1411 // wait, force sync
1412 sync = true;
1413 RG_Matrix_wait(A, sync);
1414 RG_Matrix_wait(B, sync);
1415
1416 //--------------------------------------------------------------------------
1417 // set pending changes
1418 //--------------------------------------------------------------------------
1419
1420 // remove element at position 0,0
1421 info = RG_Matrix_removeElement_BOOL(B, 1, 2);
1422 TEST_ASSERT(info == GrB_SUCCESS);
1423
1424 // set element at position 2,2
1425 info = RG_Matrix_setElement_BOOL(B, 1, 3);
1426 TEST_ASSERT(info == GrB_SUCCESS);
1427
1428 //--------------------------------------------------------------------------
1429 // mxm matrix

Callers

nothing calls this directly

Calls 7

RG_Matrix_newFunction · 0.85
RG_Matrix_waitFunction · 0.85
RG_mxmFunction · 0.85
ASSERT_GrB_Matrices_EQFunction · 0.85
RG_Matrix_freeFunction · 0.85

Tested by

no test coverage detected