Skip to content

Commit 84a120e

Browse files
DrTimothyAldenDavisdperry17
authored andcommitted
setting e<!lvl> = empty
1 parent 5d17fa8 commit 84a120e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

experimental/algorithm/LAGr_MaxFlow.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static GrB_Info LG_augment_maxflow
109109
GrB_free(&GrB_CreateResidualForward); \
110110
GrB_free(&GrB_CreateResidualBackward); \
111111
GrB_free(&zero); \
112+
GrB_free(&empty); \
112113
GrB_free(&Re); \
113114
GrB_free(&invariant); \
114115
GrB_free(&GrB_InvariantCheck); \
@@ -631,6 +632,7 @@ int LAGr_MaxFlow(double* f, LAGraph_Graph G, GrB_Index src, GrB_Index sink, char
631632

632633
//scalars
633634
GrB_Scalar zero = NULL ;
635+
GrB_Scalar empty = NULL ;
634636

635637
//invariant
636638
GrB_Vector invariant = NULL ;
@@ -736,6 +738,7 @@ int LAGr_MaxFlow(double* f, LAGraph_Graph G, GrB_Index src, GrB_Index sink, char
736738
//create scalars
737739
GRB_TRY(GrB_Scalar_new(&zero, GrB_FP64));
738740
GRB_TRY(GrB_Scalar_setElement(zero, 0));
741+
GRB_TRY(GrB_Scalar_new (&empty, GrB_FP64)) ;
739742

740743
if(n > INT32_MAX){
741744

@@ -943,13 +946,18 @@ int LAGr_MaxFlow(double* f, LAGraph_Graph G, GrB_Index src, GrB_Index sink, char
943946

944947
// FIXME: simplify this to 1 call to GrB_assign [
945948
// e<!lvl,struct> = empty
949+
#if 0
946950
GRB_TRY(GrB_assign(e, lvl, NULL,
947951
-1, GrB_ALL, n, GrB_DESC_SC));
948952
GRB_TRY(GrB_select(e, NULL,
949953
NULL, GrB_VALUEGT_FP64, /* FLOP */
950954
e, -1, NULL));
955+
#else
956+
GrB_assign (e, lvl, NULL, empty, GrB_ALL, n, GrB_DESC_SC) ;
957+
#endif
951958
// ]
952959

960+
953961
GrB_free(&lvl);
954962
LG_TRY(LAGraph_Delete(&res_graph, msg));
955963
GRB_TRY(GrB_Vector_nvals(&n_active, e));
@@ -1030,7 +1038,17 @@ int LAGr_MaxFlow(double* f, LAGraph_Graph G, GrB_Index src, GrB_Index sink, char
10301038
++iter;
10311039

10321040
}
1033-
1041+
1042+
#if 0
1043+
if (*F_handle != NULL)
1044+
{
1045+
F = new matrix, type double
1046+
F = R.flow, that is:
1047+
F(i,j) = R(i,j).flow
1048+
drop values <= 0 from F
1049+
}
1050+
#endif
1051+
10341052
LG_FREE_ALL;
10351053
return GrB_SUCCESS;
10361054
}

0 commit comments

Comments
 (0)