On success, S3L_rand_sparse returns S3L_SUCCESS.
The S3L_rand_sparse routine performs generic checking of the validity of the arrays it accepts as arguments. If an array argument contains an invalid or corrupted value, the function terminates and an error code indicating which value of the array handle was invalid is returned. See Appendix A of this manual for a detailed list of these error codes.
In addition, the following conditions will cause this function to terminate and return the associated error code:
S3L_ERR_SPARSE_FORMAT - Invalid storage format. It must be either S3L_SPARSE_COO or S3L_SPARSE_CSR.
S3L_ERR_ARG_EXTENTS - Invalid m or n. Each must be > 0.
S3L_ERR_DENSITY - Invalid density value. It must be 0.0 < density <= 1.0.
S3L_ERR_ARG_OP - Invalid random pattern. It must be one of: S3L_SPARSE_RAND, S3L_SPARSE_DRND, S3L_SPARSE_SRND, or S3L_SPARSE_DSRN.
S3L_ERR_ARRNOTSQ - Invalid matrix size. When stype does not equal S3L_SPARSE_RAND, m must equal n.