Skip to content

Commit

Permalink
Vector_isall, Vector_isequal added
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Feb 13, 2019
1 parent 5ee13aa commit 742d732
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Source/Utility/LAGraph_Vector_isall.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GrB_Info LAGraph_Vector_isall // return GrB_SUCCESS if successful
}

// C = A .* B, where the pattern of C is the intersection of A and B
LAGRAPH_OK (GrB_Vector_new (&C, GrB_BOOL, nrows1, ncols1)) ;
LAGRAPH_OK (GrB_Vector_new (&C, GrB_BOOL, nrows1)) ;
LAGRAPH_OK (GrB_eWiseMult (C, NULL, NULL, op, A, B, NULL)) ;

// ensure C has the same number of entries as A and B
Expand Down
16 changes: 8 additions & 8 deletions Test/BFS/bfs2_n36000.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

function [a m s q] = bfs2_n36000
q( 1) = 1 ;a( 1) = 1.973007e-06 ; m( 1) = 1.503062e-05 ; s( 1) = 2.081972e-06 ;
q( 2) = 479 ;a( 2) = 5.378854e-06 ; m( 2) = 7.111831e-04 ; s( 2) = 4.976057e-06 ;
q( 3) = 3072 ;a( 3) = 3.053341e-05 ; m( 3) = 3.853102e-03 ; s( 3) = 1.346506e-05 ;
q( 4) = 7634 ;a( 4) = 8.220505e-05 ; m( 4) = 8.521032e-03 ; s( 4) = 1.653982e-05 ;
q( 5) = 10237 ;a( 5) = 1.043123e-04 ; m( 5) = 1.079219e-02 ; s( 5) = 1.603039e-05 ;
q( 6) = 9836 ;a( 6) = 1.027151e-04 ; m( 6) = 9.423401e-03 ; s( 6) = 8.667819e-06 ;
q( 7) = 4584 ;a( 7) = 4.909188e-05 ; m( 7) = 3.806226e-03 ; s( 7) = 2.170913e-06 ;
q( 8) = 157 ;a( 8) = 5.367212e-06 ; m( 8) = 5.420428e-04 ; s( 8) = 4.260801e-07 ;
q( 1) = 1 ;a( 1) = 1.144383e-03 ; m( 1) = 8.596009e-01 ; s( 1) = 6.239000e-05 ;
q( 2) = 479 ;a( 2) = 1.083507e-03 ; m( 2) = 9.976129e-01 ; s( 2) = 2.656240e-04 ;
q( 3) = 3072 ;a( 3) = 1.159420e-03 ; m( 3) = 1.034550e+00 ; s( 3) = 6.785350e-04 ;
q( 4) = 7634 ;a( 4) = 1.310781e-03 ; m( 4) = 9.932737e-01 ; s( 4) = 9.596780e-04 ;
q( 5) = 10237 ;a( 5) = 1.477960e-03 ; m( 5) = 9.887382e-01 ; s( 5) = 1.074806e-03 ;
q( 6) = 9836 ;a( 6) = 1.614413e-03 ; m( 6) = 1.010738e+00 ; s( 6) = 4.871250e-04 ;
q( 7) = 4584 ;a( 7) = 1.246748e-03 ; m( 7) = 1.002097e+00 ; s( 7) = 6.658500e-05 ;
q( 8) = 157 ;a( 8) = 1.142443e-03 ; m( 8) = 9.071497e-01 ; s( 8) = 8.950000e-06 ;
12 changes: 6 additions & 6 deletions Test/BFS/bfs2_n67.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

function [a m s q] = bfs2_n67
q( 1) = 1 ;a( 1) = 1.480803e-06 ; m( 1) = 4.599802e-06 ; s( 1) = 7.301569e-07 ;
q( 2) = 3 ;a( 2) = 6.221235e-07 ; m( 2) = 3.862195e-06 ; s( 2) = 2.719462e-07 ;
q( 3) = 10 ;a( 3) = 6.500632e-07 ; m( 3) = 4.223082e-06 ; s( 3) = 2.733432e-07 ;
q( 4) = 22 ;a( 4) = 7.641502e-07 ; m( 4) = 6.036833e-06 ; s( 4) = 2.710149e-07 ;
q( 5) = 25 ;a( 5) = 7.809140e-07 ; m( 5) = 6.142072e-06 ; s( 5) = 2.230518e-07 ;
q( 6) = 6 ;a( 6) = 5.941838e-07 ; m( 6) = 4.848000e-06 ; s( 6) = 2.556480e-07 ;
q( 1) = 1 ;a( 1) = 1.757300e-05 ; m( 1) = 7.232100e-05 ; s( 1) = 1.761000e-05 ;
q( 2) = 3 ;a( 2) = 1.363100e-05 ; m( 2) = 7.438500e-05 ; s( 2) = 1.602800e-05 ;
q( 3) = 10 ;a( 3) = 1.349600e-05 ; m( 3) = 7.850200e-05 ; s( 3) = 1.726700e-05 ;
q( 4) = 22 ;a( 4) = 1.505100e-05 ; m( 4) = 8.481600e-05 ; s( 4) = 1.776100e-05 ;
q( 5) = 25 ;a( 5) = 1.453200e-05 ; m( 5) = 8.574400e-05 ; s( 5) = 1.510000e-05 ;
q( 6) = 6 ;a( 6) = 1.385500e-05 ; m( 6) = 7.375400e-05 ; s( 6) = 8.698000e-06 ;
8 changes: 4 additions & 4 deletions Test/BFS/bfs2_n7.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

function [a m s q] = bfs2_n7
q( 1) = 1 ;a( 1) = 1.472887e-06 ; m( 1) = 4.570000e-06 ; s( 1) = 7.129274e-07 ;
q( 2) = 2 ;a( 2) = 5.937181e-07 ; m( 2) = 3.388152e-06 ; s( 2) = 2.416782e-07 ;
q( 3) = 2 ;a( 3) = 5.518086e-07 ; m( 3) = 3.178138e-06 ; s( 3) = 2.188608e-07 ;
q( 4) = 2 ;a( 4) = 5.401671e-07 ; m( 4) = 3.160909e-06 ; s( 4) = 2.440065e-07 ;
q( 1) = 1 ;a( 1) = 2.378000e-05 ; m( 1) = 4.697200e-05 ; s( 1) = 1.776100e-05 ;
q( 2) = 2 ;a( 2) = 9.886000e-06 ; m( 2) = 2.736600e-05 ; s( 2) = 1.328100e-05 ;
q( 3) = 2 ;a( 3) = 9.633000e-06 ; m( 3) = 2.480400e-05 ; s( 3) = 1.248500e-05 ;
q( 4) = 2 ;a( 4) = 9.567000e-06 ; m( 4) = 2.660500e-05 ; s( 4) = 8.302000e-06 ;
14 changes: 7 additions & 7 deletions Test/BFS/bfs2_n9000.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

function [a m s q] = bfs2_n9000
q( 1) = 1 ;a( 1) = 2.345070e-06 ; m( 1) = 1.379615e-05 ; s( 1) = 1.444016e-06 ;
q( 2) = 337 ;a( 2) = 3.918074e-06 ; m( 2) = 3.541559e-04 ; s( 2) = 2.486166e-06 ;
q( 3) = 1433 ;a( 3) = 1.490396e-05 ; m( 3) = 1.410723e-03 ; s( 3) = 4.264060e-06 ;
q( 4) = 2531 ;a( 4) = 2.585584e-05 ; m( 4) = 2.481766e-03 ; s( 4) = 4.894100e-06 ;
q( 5) = 2682 ;a( 5) = 2.891198e-05 ; m( 5) = 2.415933e-03 ; s( 5) = 3.030989e-06 ;
q( 6) = 1641 ;a( 6) = 1.814030e-05 ; m( 6) = 1.384660e-03 ; s( 6) = 1.105014e-06 ;
q( 7) = 375 ;a( 7) = 4.824251e-06 ; m( 7) = 2.725148e-04 ; s( 7) = 5.210750e-07 ;
q( 1) = 1 ;a( 1) = 2.863020e-04 ; m( 1) = 2.184644e-01 ; s( 1) = 4.937100e-05 ;
q( 2) = 337 ;a( 2) = 2.807170e-04 ; m( 2) = 2.517480e-01 ; s( 2) = 2.942480e-04 ;
q( 3) = 1433 ;a( 3) = 6.736070e-04 ; m( 3) = 2.727425e-01 ; s( 3) = 4.753690e-04 ;
q( 4) = 2531 ;a( 4) = 6.609710e-04 ; m( 4) = 2.531778e-01 ; s( 4) = 2.570970e-04 ;
q( 5) = 2682 ;a( 5) = 3.613770e-04 ; m( 5) = 2.595035e-01 ; s( 5) = 1.862700e-04 ;
q( 6) = 1641 ;a( 6) = 3.516540e-04 ; m( 6) = 2.456468e-01 ; s( 6) = 6.248600e-05 ;
q( 7) = 375 ;a( 7) = 2.986650e-04 ; m( 7) = 2.426940e-01 ; s( 7) = 1.090900e-05 ;
16 changes: 8 additions & 8 deletions Test/BFS/bfs_pushpull_n36000.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

function [a m s q] = bfs_pushpull_n36000
q( 1) = 1 ;a( 1) = 1.473418e-04 ; m ( 1) = 1.719501e-05 ; s ( 1) = 1.441222e-06 ;
q( 2) = 479 ;a( 2) = 5.424023e-06 ; m ( 2) = 7.188921e-04 ; s ( 2) = 4.974194e-06 ;
q( 3) = 3072 ;a( 3) = 3.054505e-05 ; m ( 3) = 3.869060e-03 ; s ( 3) = 1.371931e-05 ;
q( 4) = 7634 ;a( 4) = 8.172262e-05 ; m ( 4) = 8.504063e-03 ; s ( 4) = 1.705298e-05 ;
q( 5) = 10237 ;a( 5) = 1.065140e-04 ; m ( 5) = 6.310616e-03 ; s ( 5) = 1.680385e-05 ;
q( 6) = 9836 ;a( 6) = 1.022811e-04 ; m ( 6) = 1.058334e-03 ; s ( 6) = 7.347669e-06 ;
q( 7) = 4584 ;a( 7) = 4.593562e-05 ; m ( 7) = 2.555731e-04 ; s ( 7) = 5.881302e-07 ;
q( 8) = 157 ;a( 8) = 2.315268e-06 ; m( 8) = 0 ; s( 8) = 0 ;
q( 1) = 1 ;a( 1) = 4.099662e-03 ; m ( 1) = 9.275269e-01 ; s ( 1) = 5.848000e-05 ;
q( 2) = 479 ;a( 2) = 1.167369e-03 ; m ( 2) = 1.088842e+00 ; s ( 2) = 5.326370e-04 ;
q( 3) = 3072 ;a( 3) = 2.221680e-03 ; m ( 3) = 1.112477e+00 ; s ( 3) = 7.211810e-04 ;
q( 4) = 7634 ;a( 4) = 1.403997e-03 ; m ( 4) = 1.043791e+00 ; s ( 4) = 9.841490e-04 ;
q( 5) = 10237 ;a( 5) = 1.497436e-03 ; m ( 5) = 2.103095e+00 ; s ( 5) = 1.030170e-04 ;
q( 6) = 9836 ;a( 6) = 1.480381e-03 ; m ( 6) = 9.384180e-01 ; s ( 6) = 5.117600e-05 ;
q( 7) = 4584 ;a( 7) = 1.260060e-03 ; m ( 7) = 9.071361e-01 ; s ( 7) = 1.084000e-05 ;
q( 8) = 157 ;a( 8) = 1.137588e-03 ; m( 8) = 0 ; s( 8) = 0 ;
12 changes: 6 additions & 6 deletions Test/BFS/bfs_pushpull_n67.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

function [a m s q] = bfs_pushpull_n67
q( 1) = 1 ;a( 1) = 2.836343e-06 ; m ( 1) = 4.261732e-06 ; s ( 1) = 3.343448e-07 ;
q( 2) = 3 ;a( 2) = 6.188639e-07 ; m ( 2) = 3.932044e-06 ; s ( 2) = 2.598390e-07 ;
q( 3) = 10 ;a( 3) = 6.640330e-07 ; m ( 3) = 4.434027e-06 ; s ( 3) = 2.700835e-07 ;
q( 4) = 22 ;a( 4) = 7.809140e-07 ; m ( 4) = 5.954877e-06 ; s ( 4) = 2.579764e-07 ;
q( 5) = 25 ;a( 5) = 7.767230e-07 ; m ( 5) = 5.793292e-06 ; s ( 5) = 2.351590e-07 ;
q( 6) = 6 ;a( 6) = 5.778857e-07 ; m( 6) = 0 ; s( 6) = 0 ;
q( 1) = 1 ;a( 1) = 2.842000e-05 ; m ( 1) = 7.173300e-05 ; s ( 1) = 1.551700e-05 ;
q( 2) = 3 ;a( 2) = 1.385900e-05 ; m ( 2) = 3.045730e-04 ; s ( 2) = 3.810400e-04 ;
q( 3) = 10 ;a( 3) = 1.418600e-05 ; m ( 3) = 3.217340e-04 ; s ( 3) = 8.567800e-05 ;
q( 4) = 22 ;a( 4) = 1.041360e-04 ; m ( 4) = 2.997080e-04 ; s ( 4) = 6.072630e-04 ;
q( 5) = 25 ;a( 5) = 2.085400e-05 ; m ( 5) = 8.986000e-05 ; s ( 5) = 2.017000e-05 ;
q( 6) = 6 ;a( 6) = 5.327400e-05 ; m( 6) = 0 ; s( 6) = 0 ;
8 changes: 4 additions & 4 deletions Test/BFS/bfs_pushpull_n7.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

function [a m s q] = bfs_pushpull_n7
q( 1) = 1 ;a( 1) = 2.454966e-06 ; m ( 1) = 4.193280e-06 ; s ( 1) = 3.105961e-07 ;
q( 2) = 2 ;a( 2) = 5.927868e-07 ; m ( 2) = 3.320165e-06 ; s ( 2) = 2.500601e-07 ;
q( 3) = 2 ;a( 3) = 5.518086e-07 ; m ( 3) = 3.139023e-06 ; s ( 3) = 2.328306e-07 ;
q( 4) = 2 ;a( 4) = 5.601905e-07 ; m( 4) = 0 ; s( 4) = 0 ;
q( 1) = 1 ;a( 1) = 2.071500e-05 ; m ( 1) = 3.492100e-05 ; s ( 1) = 1.622900e-05 ;
q( 2) = 2 ;a( 2) = 1.142100e-05 ; m ( 2) = 2.841800e-05 ; s ( 2) = 1.451200e-05 ;
q( 3) = 2 ;a( 3) = 1.105900e-05 ; m ( 3) = 2.795000e-05 ; s ( 3) = 1.405100e-05 ;
q( 4) = 2 ;a( 4) = 1.051500e-05 ; m( 4) = 0 ; s( 4) = 0 ;
14 changes: 7 additions & 7 deletions Test/BFS/bfs_pushpull_n9000.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

function [a m s q] = bfs_pushpull_n9000
q( 1) = 1 ;a( 1) = 3.864616e-05 ; m ( 1) = 1.554284e-05 ; s ( 1) = 1.353212e-06 ;
q( 2) = 337 ;a( 2) = 3.842171e-06 ; m ( 2) = 3.689821e-04 ; s ( 2) = 2.566725e-06 ;
q( 3) = 1433 ;a( 3) = 1.487276e-05 ; m ( 3) = 1.453187e-03 ; s ( 3) = 4.760921e-06 ;
q( 4) = 2531 ;a( 4) = 2.655014e-05 ; m ( 4) = 6.896675e-03 ; s ( 4) = 4.956964e-06 ;
q( 5) = 2682 ;a( 5) = 2.870709e-05 ; m ( 5) = 1.008539e-03 ; s ( 5) = 2.812129e-06 ;
q( 6) = 1641 ;a( 6) = 1.673074e-05 ; m ( 6) = 1.318194e-04 ; s ( 6) = 8.139759e-07 ;
q( 7) = 375 ;a( 7) = 4.215166e-06 ; m( 7) = 0 ; s( 7) = 0 ;
q( 1) = 1 ;a( 1) = 9.114810e-04 ; m ( 1) = 2.353136e-01 ; s ( 1) = 4.477500e-05 ;
q( 2) = 337 ;a( 2) = 3.049160e-04 ; m ( 2) = 2.451028e-01 ; s ( 2) = 1.421030e-04 ;
q( 3) = 1433 ;a( 3) = 3.341560e-04 ; m ( 3) = 2.552599e-01 ; s ( 3) = 2.266150e-04 ;
q( 4) = 2531 ;a( 4) = 3.655980e-04 ; m ( 4) = 5.388723e-01 ; s ( 4) = 5.034400e-05 ;
q( 5) = 2682 ;a( 5) = 5.113290e-04 ; m ( 5) = 2.244978e-01 ; s ( 5) = 2.263400e-05 ;
q( 6) = 1641 ;a( 6) = 3.329160e-04 ; m ( 6) = 2.280917e-01 ; s ( 6) = 1.830800e-05 ;
q( 7) = 375 ;a( 7) = 4.239190e-04 ; m( 7) = 0 ; s( 7) = 0 ;
15 changes: 5 additions & 10 deletions Test/BFS/bfs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,33 +258,29 @@ int main (int argc, char **argv)
// TODO: you can't typecast from vectors to matrices ... (except in
// SuiteSparse:GraphBLAS). Need a function LAGraph_Vector_isequal.

LAGRAPH_OK (LAGraph_isequal (&isequal, (GrB_Matrix) v, (GrB_Matrix) v2,
NULL)) ;
LAGRAPH_OK (LAGraph_Vector_isequal (&isequal, v, v2, NULL)) ;
if (!isequal)
{
fprintf (stderr, "ERROR! simple and method2 differ\n") ;
ok = false ;
}

/*
LAGRAPH_OK (LAGraph_isequal (&isequal, (GrB_Matrix) v, (GrB_Matrix) v4,
NULL)) ;
LAGRAPH_OK (LAGraph_Vector_isequal (&isequal, v, v4, NULL)) ;
if (!isequal)
{
fprintf (stderr, "ERROR! simple and PULL differ\n") ;
}
*/

LAGRAPH_OK (LAGraph_isequal (&isequal, (GrB_Matrix) v, (GrB_Matrix) v5,
NULL)) ;
LAGRAPH_OK (LAGraph_Vector_isequal (&isequal, v, v5, NULL)) ;
if (!isequal)
{
fprintf (stderr, "ERROR! simple and best differ\n") ;
ok = false ;
}

LAGRAPH_OK (LAGraph_isequal (&isequal, (GrB_Matrix) v, (GrB_Matrix) v3,
NULL)) ;
LAGRAPH_OK (LAGraph_Vector_isequal (&isequal, v, v3, NULL)) ;
if (!isequal)
{
GxB_fprint (v, 2, stderr) ;
Expand All @@ -293,8 +289,7 @@ int main (int argc, char **argv)
ok = false ;
}

LAGRAPH_OK (LAGraph_isequal (&isequal, (GrB_Matrix) v, (GrB_Matrix) v6,
NULL)) ;
LAGRAPH_OK (LAGraph_Vector_isequal (&isequal, v, v6, NULL)) ;
if (!isequal)
{
GxB_fprint (v, 2, stderr) ;
Expand Down

0 comments on commit 742d732

Please sign in to comment.