S3L_array_scalar_op2 applies a binary operation to each element of an S3L array that involves the element and a scalar.
op determines which operation will be performed. It can be one of:
S3L_OP_MULT - pointwise multiplication.
S3L_OP_DIV - pointwise division.
S3L_OP_PLUS - pointwise addition.
S3L_OP_MINUS - pointwise subtraction.
S3L_OP_ASSIGN - assignment.
The C and Fortran syntax for S3L_array_scalar_op2 are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_array_scalar_op2(a, scalar, op) S3L_array_t a void *scalar int op |
include `s3l/s3l-f.h include `s3l/s3l_errno-f.h' subroutine S3L_array_scalar_op2(a, scalar, op, ier) integer*8 a <type> scalar integer*4 op integer*4 ier |
where <type> is one of: integer*4, integer*8, real*4, real*8, complex*8, or complex*16.
S3L_array_scalar_op2 accepts the following arguments as input:
a - S3L array handle for the parallel array to which the operation will be applied.
scalar - Scalar value used as an operand in the operation applied to each element of a.
op - Predefined constant specifying the operation to be applied. See the Description section for details.
S3L_array_scalar_op2 uses the following argument for output:
ier (Fortran only) - When called from a Fortran program, S3L_array_scalar_op2 returns error status in ier.
On success, S3L_array_scalar_op2 returns S3L_SUCCESS.
S3L_array_scalar_op2 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 condition will cause the function to terminate and return the associated error code:
S3L_ERR_ARG_OP - op is not one of: S3L_OP_MUL, S3L_OP_DIV, S3L_OP_PLUS, S3L_OP_MINUS, or S3L_OP_ASSIGN
../examples/s3l/fft/ex_fft1.c ../examples/s3l/fft-f/ex_fft1.f
S3L_array_op1(3) S3L_array_op2(3) S3L_reduce_scalar(3)