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

Function RG_Matrix_checkCompatible

src/graph/rg_matrix/rg_utils.c:32–58  ·  view source on GitHub ↗

check 2 matrices have same type nrows and ncols

Source from the content-addressed store, hash-verified

30
31// check 2 matrices have same type nrows and ncols
32void RG_Matrix_checkCompatible
33(
34 const RG_Matrix M,
35 const RG_Matrix N
36) {
37#if RG_DEBUG
38 GrB_Matrix m = RG_MATRIX_M(M);
39 GrB_Matrix n = RG_MATRIX_M(N);
40
41 GrB_Type m_type;
42 GrB_Type n_type;
43 GxB_Matrix_type(&m_type, m);
44 GxB_Matrix_type(&n_type, n);
45 ASSERT(m_type == n_type);
46
47 GrB_Index m_nrows;
48 GrB_Index m_ncols;
49 GrB_Index n_nrows;
50 GrB_Index n_ncols;
51 GrB_Matrix_nrows(&m_nrows, m);
52 GrB_Matrix_ncols(&m_ncols, m);
53 GrB_Matrix_nrows(&n_nrows, n);
54 GrB_Matrix_ncols(&n_ncols, n);
55 ASSERT(m_nrows == n_nrows);
56 ASSERT(m_ncols == n_ncols);
57#endif
58}
59
60void RG_Matrix_validateState
61(

Callers 1

RG_Matrix_copyFunction · 0.85

Calls 3

GxB_Matrix_typeFunction · 0.85
GrB_Matrix_nrowsFunction · 0.85
GrB_Matrix_ncolsFunction · 0.85

Tested by

no test coverage detected