@@ -67,8 +67,14 @@ static GrB_Info LAGraph_RpqMatrixLor(RpqMatrixPlan *plan, char *msg)
6767 GrB_Matrix lhs_mat = lhs -> res_mat ;
6868 GrB_Matrix rhs_mat = rhs -> res_mat ;
6969
70- GRB_TRY (GrB_eWiseAdd (plan -> res_mat , GrB_NULL , GrB_NULL ,
71- op , lhs_mat , rhs_mat , GrB_DESC_R ));
70+ GrB_Index width , height ;
71+ GrB_Matrix_nrows (& height , rhs_mat );
72+ GrB_Matrix_ncols (& width , lhs_mat );
73+ GrB_Matrix res ;
74+ GrB_Matrix_new (& res , GrB_BOOL , height , width );
75+ GRB_TRY (GrB_eWiseAdd (res , GrB_NULL , GrB_NULL ,
76+ GrB_LOR , lhs_mat , rhs_mat , GrB_DESC_R ));
77+ plan -> res_mat = res ;
7278
7379 return (GrB_SUCCESS );
7480}
@@ -83,11 +89,6 @@ static GrB_Info LAGraph_RpqMatrixConcat(RpqMatrixPlan *plan, char *msg)
8389 RpqMatrixPlan * lhs = plan -> lhs ;
8490 RpqMatrixPlan * rhs = plan -> rhs ;
8591
86- GrB_Index nvalsA , nvalsB ;
87- GrB_Matrix_nvals (& nvalsA , lhs -> mat );
88- GrB_Matrix_nvals (& nvalsB , rhs -> mat );
89- fprintf (stderr , "\nDEBUG: A:%lu and B:%lu in Concat\n" , nvalsA , nvalsB );
90-
9192 LG_ASSERT (lhs != NULL , GrB_NULL_POINTER );
9293 LG_ASSERT (rhs != NULL , GrB_NULL_POINTER );
9394
@@ -97,22 +98,15 @@ static GrB_Info LAGraph_RpqMatrixConcat(RpqMatrixPlan *plan, char *msg)
9798 GrB_Matrix lhs_mat = lhs -> res_mat ;
9899 GrB_Matrix rhs_mat = rhs -> res_mat ;
99100
100- GrB_Matrix_nvals (& nvalsA , lhs_mat );
101- GrB_Matrix_nvals (& nvalsB , rhs_mat );
102- fprintf (stderr , "\nDEBUG: A:%lu and B:%lu in Concat after traversal\n" , nvalsA , nvalsB );
103- fprintf (stderr , "\nDEBUG: before mxm\n" );
104-
105101 GrB_Index width , height ;
106102 GrB_Matrix_nrows (& height , rhs_mat );
107103 GrB_Matrix_ncols (& width , lhs_mat );
108104 GrB_Matrix res ;
109105 GrB_Matrix_new (& res , GrB_BOOL , height , width );
110106 GRB_TRY (GrB_mxm (res , GrB_NULL , GrB_NULL ,
111- sr , lhs_mat , rhs_mat , GrB_DESC_R ));
107+ GrB_LOR_LAND_SEMIRING_BOOL , lhs_mat , rhs_mat , GrB_DESC_R ));
112108 // GrB_mxm(plan->res_mat, GrB_NULL, GrB_NULL, GrB_LOR_LAND_SEMIRING_BOOL, lhs_mat, rhs_mat, GrB_NULL);
113109 plan -> res_mat = res ;
114- GrB_Matrix_nvals (& nvalsA , plan -> res_mat );
115- fprintf (stderr , "\nDEBUG: A:%lu after mxm in Concat\n" , nvalsA );
116110
117111 return (GrB_SUCCESS );
118112}
@@ -152,19 +146,20 @@ static GrB_Info LAGraph_RpqMatrixKleene(RpqMatrixPlan *plan, char *msg)
152146 GrB_Matrix BPE ;
153147 GRB_TRY (GrB_Matrix_new (& BPE , GrB_BOOL , n , n ));
154148 GRB_TRY (GrB_eWiseAdd (BPE , GrB_NULL , GrB_NULL ,
155- op , B , E , GrB_DESC_R ));
149+ GrB_LOR , B , E , GrB_DESC_R ));
156150 // S <- S x (B + E)
157151 GrB_Matrix S , T ;
158152 GRB_TRY (GrB_Matrix_dup (& S , E ));
159153
160154 bool changed = true;
161155 GrB_Index nnz_S = n , nnz_T = 0 ;
156+
162157 while (changed )
163158 {
164159 // T = S * (B + E)
165160 GRB_TRY (GrB_Matrix_new (& T , GrB_BOOL , n , n ));
166161 GRB_TRY (GrB_mxm (T , GrB_NULL , GrB_NULL ,
167- sr , S , BPE , GrB_DESC_R ));
162+ GrB_LOR_LAND_SEMIRING_BOOL , S , BPE , GrB_DESC_R ));
168163
169164 GRB_TRY (GrB_Matrix_nvals (& nnz_T , T ));
170165 if (nnz_T != nnz_S )
@@ -191,19 +186,13 @@ GrB_Info LAGraph_RPQMatrix(RpqMatrixPlan *plan, char *msg)
191186{
192187 if (plan -> res_mat != NULL )
193188 {
194- GrB_Index result ;
195- GrB_Matrix_nvals (& result , plan -> res_mat );
196- fprintf (stderr , "\nDEBUG: res_mat in LAGraph_RPQMatrix: %lu" , result );
197189 return (GrB_SUCCESS );
198190 }
199191
200192 switch (plan -> op )
201193 {
202194 case RPQ_MATRIX_OP_LABEL :
203195 LG_ASSERT (plan -> lhs == NULL && plan -> rhs == NULL , GrB_INVALID_VALUE );
204- GrB_Index result ;
205- GrB_Matrix_nvals (& result , plan -> mat );
206- fprintf (stderr , "\nDEBUG: res_mat in LAGraph_RPQMatrix switch: %lu" , result );
207196 plan -> res_mat = plan -> mat ;
208197 return (GrB_SUCCESS );
209198 case RPQ_MATRIX_OP_LOR :
@@ -215,14 +204,11 @@ GrB_Info LAGraph_RPQMatrix(RpqMatrixPlan *plan, char *msg)
215204 default :
216205 LG_ASSERT (false, GrB_INVALID_VALUE );
217206 }
218- GrB_Index result ;
219- GrB_Matrix_nvals (& result , plan -> res_mat );
220- fprintf (stderr , "\nDEBUG: res_mat in LAGraph_RPQMatrix end: %lu" , result );
221207 return (GrB_SUCCESS );
222208}
223209
224210GrB_Info LAGraph_RpqMatrix_initialize ()
225211{
226- sr = LAGraph_any_one_bool ;
227- op = GxB_ANY_BOOL_MONOID ;
212+ sr = GrB_LOR_LAND_SEMIRING_BOOL ;
213+ op = GrB_LOR ;
228214}
0 commit comments