experimental/utility/LAGraph_Random.c
GrB_Info LAGraph_Random_FP64    // random double vector
(
    // output
    GrB_Vector X,       // already allocated on input
    // input/output
    GrB_Vector Seed,
    char *msg
)
{
    // check inputs
    LG_CLEAR_MSG ;
    if (Seed == NULL || X == NULL) return (-1) ;
    // X = xget (Seed)
    GrB_TRY (GrB_Vector_apply (X,    NULL, NULL, LG_rand_xget64_op, Seed,
        NULL)) ;
    // Seed = next (Seed)
    GrB_TRY (GrB_Vector_apply (Seed, NULL, NULL, LG_rand_next_op, Seed, NULL)) ;
    return (0) ;
}
// The sparsity pattern of the result X is the same as the Seed vector.
// The Seed vector is updated to advance to the next set of seeds.
The sparsity pattern of the result X is the same as the Seed vector.
The Seed vector is updated to advance to the next set of seeds.
The sparsity pattern of the result X is the same as the Seed vector . The Seed vector is updated to advance to the next set of seeds .
GrB_Info LAGraph_Random_FP64    
(
    GrB_Vector X,       
    GrB_Vector Seed,
    char *msg
)
{
    LG_CLEAR_MSG ;
    if (Seed == NULL || X == NULL) return (-1) ;
    GrB_TRY (GrB_Vector_apply (X,    NULL, NULL, LG_rand_xget64_op, Seed,
        NULL)) ;
    GrB_TRY (GrB_Vector_apply (Seed, NULL, NULL, LG_rand_next_op, Seed, NULL)) ;
    return (0) ;
}
GrB_Info LAGraph_Random_FP64 ( GrB_Vector X , GrB_Vector Seed , char * msg ) { LG_CLEAR_MSG ; if ( Seed == NULL || X == NULL ) return ( -1 ) ; GrB_TRY ( GrB_Vector_apply ( X , NULL , NULL , LG_rand_xget64_op , Seed , NULL ) ) ; GrB_TRY ( GrB_Vector_apply ( Seed , NULL , NULL , LG_rand_next_op , Seed , NULL ) ) ; return ( 0 ) ; }
The sparsity pattern of the result X is the same as the Seed vector.
The sparsity pattern of the result X is the same as the Seed vector .
// random double vector // output // already allocated on input // input/output // check inputs // X = xget (Seed) // Seed = next (Seed)