@@ -129,6 +129,44 @@ char msg[LAGRAPH_MSG_LEN] ;
129129#include <stdbool.h>
130130#include <stdio.h>
131131
132+ void cardinality_lor (GrB_Index * Crr , GrB_Index * Ccr , GrB_Index Arr , GrB_Index Acr , GrB_Index Brr , GrB_Index Bcr , GrB_Index dim , GrB_Index Annz , GrB_Index Bnnz ) {
133+ GrB_Index Crr_result , Ccr_result ;
134+
135+ * Crr = Crr_result ;
136+ * Ccr = Ccr_result ;
137+ };
138+
139+ void cardinality_concat (GrB_Index * Crr , GrB_Index * Ccr , GrB_Index Arr , GrB_Index Acr , GrB_Index Brr , GrB_Index Bcr , GrB_Index dim , GrB_Index Annz , GrB_Index Bnnz ) {
140+ GrB_Index Crr_result , Ccr_result ;
141+
142+ * Crr = Crr_result ;
143+ * Ccr = Ccr_result ;
144+ };
145+
146+ void cardinality_kleene (GrB_Index * Crr , GrB_Index * Ccr , GrB_Index Arr , GrB_Index Acr , GrB_Index Brr , GrB_Index Bcr , GrB_Index dim , GrB_Index Annz , GrB_Index Bnnz ) {
147+ GrB_Index Crr_result , Ccr_result ;
148+
149+ * Crr = Crr_result ;
150+ * Ccr = Ccr_result ;
151+ };
152+
153+ GrB_Info LAGraph_RPQMatrix_reduce (GrB_Index * res , GrB_Matrix mat , uint8_t reduce_type ){
154+ GrB_Index nvals ;
155+ GrB_Vector reduce ;
156+ if (reduce_type == 0 )
157+ {
158+ GrB_Matrix_reduce_Monoid (reduce ,NULL ,NULL ,GxB_ANY_BOOL_MONOID ,mat ,NULL ) ;
159+ }
160+ else if (reduce_type == 1 )
161+ {
162+ GrB_Matrix_reduce_Monoid (reduce , NULL ,NULL ,GxB_ANY_BOOL_MONOID ,mat ,GrB_DESC_T0 ) ;
163+ }
164+ GrB_Vector_nvals (& nvals ,reduce ) ;
165+ * res = nvals ;
166+ return (GrB_SUCCESS ) ;
167+ }
168+
169+
132170GrB_Info LAGraph_RPQMatrix_check (RPQMatrixPlan * plan , GrB_Index * dimension , char * msg )
133171{
134172 if (plan == NULL )
@@ -137,7 +175,7 @@ GrB_Info LAGraph_RPQMatrix_check(RPQMatrixPlan *plan, GrB_Index *dimension, char
137175 }
138176 if (plan -> op == RPQ_MATRIX_OP_LABEL )
139177 {
140- LG_ASSERT (plan -> mat != NULL , GrB_NULL_POINTER );
178+ LG_ASSERT (plan -> mat != NULL , GrB_NULL_POINTER ) ;
141179 GrB_Index nrows , ncols ;
142180 OK (GrB_Matrix_nrows (& nrows , plan -> mat )) ;
143181 OK (GrB_Matrix_ncols (& ncols , plan -> mat )) ;
@@ -224,7 +262,12 @@ static GrB_Info LAGraph_RPQMatrixLor(RPQMatrixPlan *plan, char *msg)
224262 GRB_TRY (GrB_eWiseAdd (res , GrB_NULL , GrB_NULL ,
225263 op , lhs_mat , rhs_mat , GrB_DESC_R )) ;
226264 plan -> res_mat = res ;
227-
265+ // GrB_Index n ;
266+ // GrB_Matrix_ncols(&n, lhs_mat) ;
267+ // GrB_Index Annz, Bnnz;
268+ // GrB_Matrix_nvals(&Annz, lhs_mat) ;
269+ // GrB_Matrix_nvals(&Bnnz, rhs_mat) ;
270+ // cardinality_lor(plan->row_reduce, plan->col_reduce, lhs->row_reduce, lhs->col_reduce, rhs->row_reduce, rhs->col_reduce, n, Annz, Bnnz) ;
228271 return (GrB_SUCCESS ) ;
229272}
230273
@@ -254,6 +297,12 @@ static GrB_Info LAGraph_RPQMatrixConcat(RPQMatrixPlan *plan, char *msg)
254297 GRB_TRY (GrB_mxm (res , GrB_NULL , GrB_NULL ,
255298 sr , lhs_mat , rhs_mat , GrB_DESC_R )) ;
256299 plan -> res_mat = res ;
300+ // GrB_Index n ;
301+ // GrB_Matrix_ncols(&n, lhs_mat) ;
302+ // GrB_Index Annz, Bnnz;
303+ // GrB_Matrix_nvals(&Annz, lhs_mat) ;
304+ // GrB_Matrix_nvals(&Bnnz, rhs_mat) ;
305+ // cardinality_concat(plan->row_reduce, plan->col_reduce, lhs->row_reduce, lhs->col_reduce, rhs->row_reduce, rhs->col_reduce, n, Annz, Bnnz) ;
257306
258307 return (GrB_SUCCESS ) ;
259308}
0 commit comments