src/test/test_Property_Degree.c
void check_degree
(
    GrB_Vector Degree,
    GrB_Index n,
    const int *degree
)
{
    GrB_Index n2 ;
    OK (GrB_Vector_size (&n2, Degree)) ;
    TEST_CHECK (n == n2) ;
    for (int k = 0 ; k < n ; k++)
    {
        int64_t degk ;
        GrB_Info info = GrB_Vector_extractElement (&degk, Degree, k) ;
        if (info == GrB_NO_VALUE)
        {
            TEST_CHECK (degree [k] == 0) ;
        }
        else if (info == GrB_SUCCESS)
        {
            TEST_CHECK (degree [k] == degk) ;
        }
        else
        {
            TEST_CHECK (false) ;
        }
    }
}
//------------------------------------------------------------------------------
// check_degree: check a row or column degree vector
//------------------------------------------------------------------------------
check a row or column degree vector
check a row or column degree vector
void check_degree
(
    GrB_Vector Degree,
    GrB_Index n,
    const int *degree
)
{
    GrB_Index n2 ;
    OK (GrB_Vector_size (&n2, Degree)) ;
    TEST_CHECK (n == n2) ;
    for (int k = 0 ; k < n ; k++)
    {
        int64_t degk ;
        GrB_Info info = GrB_Vector_extractElement (&degk, Degree, k) ;
        if (info == GrB_NO_VALUE)
        {
            TEST_CHECK (degree [k] == 0) ;
        }
        else if (info == GrB_SUCCESS)
        {
            TEST_CHECK (degree [k] == degk) ;
        }
        else
        {
            TEST_CHECK (false) ;
        }
    }
}
void check_degree ( GrB_Vector Degree , GrB_Index n , const int * degree ) { GrB_Index n2 ; OK ( GrB_Vector_size ( & n2 , Degree ) ) ; TEST_CHECK ( n == n2 ) ; for ( int k = 0 ; k < n ; k ++ ) { int64_t degk ; GrB_Info info = GrB_Vector_extractElement ( & degk , Degree , k ) ; if ( info == GrB_NO_VALUE ) { TEST_CHECK ( degree [ k ] == 0 ) ; } else if ( info == GrB_SUCCESS ) { TEST_CHECK ( degree [ k ] == degk ) ; } else { TEST_CHECK ( false ) ; } } }
check_degree: check a row or column degree vector
check_degree : check a row or column degree vector