Sun S3L 3.0 Programming and Reference Guide

S3L_rand_sparse

Description

S3L_rand_sparse creates a random sparse matrix with random sparsity pattern in either the Coordinate format or the Compressed Sparse Row format. Upon successful completion, it returns an S3L array handle in A representing this random sparse matrix.

Syntax

The C and Fortran syntax for S3L_rand_sparse are shown below.

C/C++ Syntax


Example 8-15

#include <s3l/s3l-c.h>
#include <s3l/s3l_errno-c.h>
int
S3L_rand_sparse(A, spfmt, stype, m, n, density, type, seed)
    S3L_array_t               *A
    S3L_sparse_storage_t      spfmt
    sparse_rand_t             stype
    int                       m
    int                       m
    real4                     density
    S3L_data_type             type
    int                       seed

F77/F90 Syntax


Example 8-16

include `s3l/s3l-f.h'
include `s3l/s3l_errno-f.h'
subroutine
S3L_rand_sparse(A, spfmt, stype, m, n, density, type, seed, ier)
    integer*8               A
    integer*4               spfmt
    integer*4               stype
    integer*4               m
    integer*4               n
    real*4                  density
    integer*4               type
    integer*4               seed
    integer*4               ier

Input

Output

This function uses the following arguments for output:

Error Handling

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:

Examples

../examples/s3l/iter/ex_iter.c
../examples/s3l/iter-f/ex_iter.f

Related Functions

S3L_declare_sparse(3)
S3L_matvec_sparse(3)
S3L_read_sparse(3)