Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions experimental/test/test_diameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

//------------------------------------------------------------------------------

// FIXME: need to check the results with correct their values
// FIXME: vector results (peripheral, eccentricity, level, and parent) are not
// checked with exact values

#include <stdio.h>
#include <acutest.h>
Expand All @@ -39,24 +40,25 @@ char filename [LEN+1] ;

typedef struct
{
int diameter ;
bool symmetric ;
const char *name ;
}
matrix_info ;

const matrix_info files [ ] =
{
{ 1, "A.mtx" },
{ 1, "jagmesh7.mtx" },
{ 0, "west0067.mtx" }, // unsymmetric
{ 1, "bcsstk13.mtx" },
{ 1, "karate.mtx" },
{ 1, "ldbc-cdlp-undirected-example.mtx" },
{ 1, "ldbc-undirected-example-bool.mtx" },
{ 1, "ldbc-undirected-example-unweighted.mtx" },
{ 1, "ldbc-undirected-example.mtx" },
{ 1, "ldbc-wcc-example.mtx" },
{ 0, "" },
{ 2, 1, "A.mtx" },
{ 60, 1, "jagmesh7.mtx" },
{ 6, 0, "west0067.mtx" }, // unsymmetric
{ 11, 1, "bcsstk13.mtx" },
{ 5, 1, "karate.mtx" },
{ 4, 1, "ldbc-cdlp-undirected-example.mtx" },
{ 4, 1, "ldbc-undirected-example-bool.mtx" },
{ 4, 1, "ldbc-undirected-example-unweighted.mtx" },
{ 4, 1, "ldbc-undirected-example.mtx" },
{ 3, 1, "ldbc-wcc-example.mtx" },
{ 0, 0, "" },
} ;

#undef OK
Expand Down Expand Up @@ -109,7 +111,9 @@ void test_diameter (void)
OK (LAGraph_ExactDiameter (&diameter, &peripheral, &eccentricity,
G, 8, msg)) ;

printf ("\ndiameter: %" PRIu64 "\n", diameter) ;
printf ("\n%s exact diameter: %" PRIu64 "\n", aname, diameter) ;
TEST_CHECK (diameter == files [k].diameter) ;

printf ("\nperipheral:\n") ;
OK (LAGraph_Vector_Print (peripheral, pr, stdout, msg)) ;
printf ("\neccentricity:\n") ;
Expand Down
Loading