|
98 | 98 |
|
99 | 99 | #if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS )
|
100 | 100 | // use SuiteSparse, and its GxB* extensions
|
101 |
| - #if GxB_IMPLEMENTATION < GxB_VERSION (10,0,3) |
102 |
| - #error "If using SuiteSparse::GraphBLAS, version 10.0.3 or later is required" |
| 101 | + #if GxB_IMPLEMENTATION < GxB_VERSION (9,0,0) |
| 102 | + #error "If using SuiteSparse::GraphBLAS, version 9.0.0 or later is required" |
103 | 103 | #endif
|
104 | 104 | #define LAGRAPH_SUITESPARSE 1
|
105 | 105 | #else
|
@@ -2021,6 +2021,58 @@ int LAGraph_Vector_IsEqualOp
|
2021 | 2021 | char *msg
|
2022 | 2022 | ) ;
|
2023 | 2023 |
|
| 2024 | +//------------------------------------------------------------------------------ |
| 2025 | +// Random number generator |
| 2026 | +//------------------------------------------------------------------------------ |
| 2027 | + |
| 2028 | +// FIXME: rename these methods? |
| 2029 | + |
| 2030 | +/** LAGraph_Random_Seed creates a random vector. On input, its values are |
| 2031 | + * ignored but its structure is used. On output, all entries that were in |
| 2032 | + * the original structure are assigned random values, depending on the scalar |
| 2033 | + * seed value. Each entry is considered its own pseudo-random number stream, |
| 2034 | + * with the overall seed value being revised for each entry in the vector, |
| 2035 | + * depending on their index in the vector. |
| 2036 | + * |
| 2037 | + * @param[out,out] State vector to initialize with random numbers. |
| 2038 | + * @param[in] seed scalar seed value. |
| 2039 | + * @param[in,out] msg any error messages. |
| 2040 | + * |
| 2041 | + * @retval GrB_SUCCESS if successful. |
| 2042 | + * @retval GrB_NULL_POINTER if State is NULL. |
| 2043 | + * @returns any GraphBLAS errors that may have been encountered. |
| 2044 | + */ |
| 2045 | + |
| 2046 | +LAGRAPH_PUBLIC |
| 2047 | +int LAGraph_Random_Seed // construct a random State vector |
| 2048 | +( |
| 2049 | + // input/output: |
| 2050 | + GrB_Vector State, // vector of random number States, normally GrB_UINT64 |
| 2051 | + // input: |
| 2052 | + uint64_t seed, // scalar input seed |
| 2053 | + char *msg |
| 2054 | +) ; |
| 2055 | + |
| 2056 | +/** LAGraph_Random_Next takes as input a vector previously initialized by |
| 2057 | + * LAGraph_Random_Seed, and modifies all of them so that they take on their |
| 2058 | + * next value in its pseudo-random number stream. |
| 2059 | + * |
| 2060 | + * @param[out,out] State vector with random numbers to be advanced. |
| 2061 | + * @param[in,out] msg any error messages. |
| 2062 | + * |
| 2063 | + * @retval GrB_SUCCESS if successful. |
| 2064 | + * @retval GrB_NULL_POINTER if State is NULL. |
| 2065 | + * @returns any GraphBLAS errors that may have been encountered. |
| 2066 | + */ |
| 2067 | + |
| 2068 | +LAGRAPH_PUBLIC |
| 2069 | +int LAGraph_Random_Next // advance to next random vector |
| 2070 | +( |
| 2071 | + // input/output: |
| 2072 | + GrB_Vector State, // vector of random number States, normally GrB_UINT64 |
| 2073 | + char *msg |
| 2074 | +) ; |
| 2075 | + |
2024 | 2076 | //==============================================================================
|
2025 | 2077 | // LAGraph Basic algorithms
|
2026 | 2078 | //==============================================================================
|
|
0 commit comments