VEC_MSUM(ARG1, ARG2, ARG3)

Purpose

Returns a vector containing the results of performing a multiply-sum operation using the given vectors.

Class

Elemental function

Argument type and attributes

ARG1
An INTENT(IN) INTEGER(1) vector, INTEGER(2) vector, UNSIGNED(1) vector, or UNSIGNED(2) vector.
ARG2
An INTENT(IN) vector. If ARG1 is an INTEGER(1) vector, then ARG2 is an UNSIGNED(1) vector. Otherwise, ARG2 is of the same type as ARG1.
ARG3
An INTENT(IN) vector. If ARG1 is an integer vector, then ARG3 is an INTEGER(4) vector. If ARG1 is an unsigned vector, then ARG3 is an UNSIGNED(4) vector.

Result type and attributes

The result is a vector of the same type as ARG3.

Result value

Assume that the elements of each vector are numbered beginning with 0. If ARG1 is an INTEGER(1) vector or an UNSIGNED(1) vector, then let m be 4. Otherwise, let m be 2. For each element n of the result vector, the value is obtained in the following way: For p = mn to mn+m-1, multiply element p of ARG1 by element p of ARG2. Add the sum of these products to element n of ARG3. All additions are performed using 32-bit modular arithmetic.