S3L_conv_setup sets up the initial conditions necessary for computation of the convolution C = A conv B. It returns an integer setup value that can be used by a subsequent call to S3L_conv.
S3L array handles A, B, and C each describe a parallel array that can be either one- or two-dimensional. The extents of C along each axis i, must be such that they are greater than or equal to two times the sum of the corresponding extents of A and B, minus 1.
The C and Fortran syntax for S3L_conv_setup are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_conv_setup(A, B, C, setup_id) S3L_array_t A S3L_array_t B S3L_array_t C int *setup_id |
include `s3l/s3l-f.h' include `s3l/s3l_errno-f.h' subroutine S3L_conv_setup(A, B, C, setup_id, ier) integer*8 A integer*8 B integer*8 C integer*4 setup_id integer*4 ier |
where <type> is real*4 or real*8 for both C/C++ and F77/F90.
A - S3L array handle describing a parallel array of size ma (1D case) or ma x na (2D) case. A contains the input signal that will be convolved.
B - S3L array handle describing a parallel array that contains the convolution filter.
C - S3L array handle describing a parallel array in which the convolved signal is stored. Its length must be at least ma+mb-1 (1D case) or ma+mb-1 x na+nb-1 (2D case).
This function uses the following arguments for output:
setup_id - Integer value retuned by this function. Use this value for the setup_id argument in subsequent calls to S3_conv and S3L_conv_free_setup.
ier (Fortran only) - When called from a Fortran program, this function returns error status in ier.
On success, S3L_conv_setup returns S3L_SUCCESS.
S3L_conv_setup performs generic checking 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 cause the function to terminate and return one of the following codes:
S3L_ERR_ARG_RANK - The rank of one of the array arguments is not 1 or 2.
S3L_ERR_MATCH_RANK - The array arguments are not all of the same rank.
S3L_ERR_MATCH_DTYPE - The array arguments are not all of the same type.
S3L_ERR_ARG_EXTENTS - The extents of c are less two times the sum of the corresponding extents of A and B minus 1.
../examples/s3l/conv/ex_conv.c ../examples/s3l/conv-f/ex_conv.f
S3L_conv(3) S3L_conv_free_setup(3)