SHAD(3S)SHAD(3S)NAME
SHAD, DHAD, CHAD, ZHAD - Computes the Hadamard product of two vectors
SYNOPSIS
Single precision
Fortran:
CALL SHAD (n, alpha, x, incx, y, incy, beta, z, incz)
C/C++:
#include <scsl_blas.h>
void shad(int n, float alpha, float *x, int incx, float *y, int
incy, float beta, float *z, int incz);
Double precision
Fortran:
CALL DHAD (n, alpha, x, incx, y, incy, beta, z, incz)
C/C++:
#include <scsl_blas.h>
void shad(int n, double alpha, double *x, int incx, double *y,
int incy, double beta, double *z, int incz);
Single precision complex
Fortran:
CALL CHAD (n, alpha, x, incx, y, incy, beta, z, incz)
C/C++
#include <scsl_blas.h>
void shad(int n, scsl_complex *alpha, scsl_complex *x, int
incx, scsl_complex *y, int incy, scsl_complex *beta,
scsl_complex *z, int incz);
C/C++ STL:
#include <complex.h>
#include <scsl_blas.h>
void shad(int n, complex<float> *alpha, complex<float> *x, int
incx, complex<float> *y, int incy, complex<float> *beta,
complex<float> *z, int incz);
Double precision complex
Fortran:
CALL ZHAD (n, alpha, x, incx, y, incy, beta, z, incz)
C/C++:
#include <scsl_blas.h>
void shad(int n, scsl_zomplex *alpha, scsl_zomplex *x, int
incx, scsl_zomplex *y, int incy, scsl_zomplex *beta,
Page 1
SHAD(3S)SHAD(3S)
scsl_zomplex *z, int incz);
C/C++ STL:
#include <complex.h>
#include <scsl_blas.h>
void shad(int n, complex<double> *alpha, complex<double> *x,
int incx, complex<double> *y, int incy, complex<double> *beta,
complex<double> *z, int incz);
IMPLEMENTATION
These routines are part of the SCSL Scientific Library and can be loaded
using either the -lscs or the -lscs_mp option. The -lscs_mp option
directs the linker to use the multi-processor version of the library.
When linking to SCSL with -lscs or -lscs_mp, the default integer size is
4 bytes (32 bits). Another version of SCSL is available in which integers
are 8 bytes (64 bits). This version allows the user access to larger
memory sizes and helps when porting legacy Cray codes. It can be loaded
by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
only one of the two versions; 4-byte integer and 8-byte integer library
calls cannot be mixed.
The C and C++ prototypes shown above are appropriate for the 4-byte
integer version of SCSL. When using the 8-byte integer version, the
variables of type int become long long and the <scsl_blas_i8.h> header
file should be included.
DESCRIPTION
These routines compute the Hadamard product of two vectors x and y,
storing the results in a vector z.
z <- alpha * x * y + beta * z , i = 1, . . . n
i i i i
alpha = 0.0 is recognized as a special case. beta = 0.0 or beta = 1.0 is
also recognized as a special case.
These routines accept the following arguments:
n Integer. (input)
The number of elements in each vector.
alpha Scalar alpha. (input)
SHAD: Single precision.
DHAD: Double precision.
CHAD: Single precision complex.
ZHAD: Double precision complex.
For C/C++, a pointer to this scalar is passed when alpha is
complex; otherwise, alpha is passed by value.
Page 2
SHAD(3S)SHAD(3S)
x Array of dimension (1 + (n-1) * incx). (input)
SHAD: Single precision array.
DHAD: Double precision array.
CHAD: Single precision complex array.
ZHAD: Double precision complex array.
The vector x.
If incx > 0, the ith element of the vector x is located in x(1
+ (i-1) * incx) for Fortran and in x[(i-1) * incx] for C/C++.
If incx < 0, the ith element of the vector x is located in x(1
+ (n-i) * |incx|) for Fortran, x[(n-i) * |incx|] for C/C++.
incx Integer. (input)
The increment between elements of the vector x.
incx must not = 0.
y Array of dimension (1 + (n-1) * incy). (input)
SHAD: Single precision array.
DHAD: Double precision array.
CHAD: Single precision complex array.
ZHAD: Double precision complex array.
The vector y.
If incy > 0, the ith element of the vector y is located in
y(1+(i-1) * incy) for Fortran, and in y[(i-1) * incy] for
C/C++.
If incy < 0, the ith element of the vector y is located in y(1
+ (n-i) * |incy|) for Fortran, y[(n-i) * |incy|] for C/C++.
incy Integer. (input)
The increment between elements of the vector y. incy must not
be 0.
beta The scalar beta. (input)
SHAD: Single precision.
DHAD: Double precision.
CHAD: Single precision complex.
ZHAD: Double precision complex.
For C/C++, a pointer to this scalar is passed when beta is
complex; otherwise, beta is passed by value.
z Array of dimension (1 + (n-1) * incz). (input/output)
SHAD: Single precision array.
DHAD: Double precision array.
CHAD: Single precision complex array.
ZHAD: Double precision complex array.
On entry, the vector z.
Page 3
SHAD(3S)SHAD(3S)
If incz > 0, the ith element of the vector z is located in z(1
+ (i-1) * incz) for Fortran, z[(i-1) * incz] for C/C++.
If incz < 0, the ith element of the vector z is located in z(1
+ (n-i) * |incz|) for Fortran, z[(n-i) * incz] for C/C++.
On exit, z is overwritten with the Hadamard product.
incz Integer. (input)
The increment between elements of the vector z. incz must not
be 0.
NOTES
These routines are extensions to the Level 1 Basic Linear Algebra
Subprograms (Level 1 BLAS).
Data Types
The following data types are described in this documentation:
Term Used Data type
Fortran:
Array dimensioned n x(n)
Integer INTEGER (INTEGER*8 for -lscs_i8[_mp])
Single precision REAL
Double precision DOUBLE PRECISION
Single precision complex COMPLEX
Double precision complex DOUBLE COMPLEX
C/C++:
Array dimensioned n x[n]
Integer int (long long for -lscs_i8[_mp])
Single precision float
Double precision double
Single precision complex scsl_complex
Double precision complex scsl_zomplex
C++ STL:
Page 4
SHAD(3S)SHAD(3S)
Array dimensioned n x[n]
Integer int (long long for -lscs_i8[_mp])
Single precision float
Double precision double
Single precision complex complex<float>
Double precision complex complex<double>
SEE ALSOINTRO_SCSL(3S), INTRO_BLAS1(3S)INTRO_CBLAS(3S) for information about using the C interface to Fortran 77
Basic Linear Algebra Subprograms (legacy BLAS) set forth by the Basic
Linear Algebra Subprograms Technical Forum.
Page 5