dot_product
- Date:
10-12-2011
NAME
DOT_PRODUCT - Performs dot-product multiplication of numeric or logical vectors
SYNOPSIS
DOT_PRODUCT ([VECTOR_A=]vector_a, [VECTOR_B=]vector_b)
STANDARDS
Fortran
DESCRIPTION
The DOT_PRODUCT intrinsic function performs dot-product multiplication of numeric or logical vectors. It accepts the following arguments:
- vector_a
Must be of numeric type (integer, real, or complex) or of logical type. It must be array valued and of rank one.
- vector_b
Must be of numeric type if vector_a is of numeric type or of type logical if vector_a is of type logical. It must be array valued and of rank one. It must be conformable to vector_a.
DOT_PRODUCT is a transformational function. The name of this intrinsic cannot be passed as an argument.
RETURN VALUES
If the arguments are of numeric type, the type and kind type parameter of the result are those of the expression vector_a * vector_b, determined by the types of the arguments. If the arguments are of type logical, the result is of type logical with the kind type parameter of the expression vector_a .AND. vector_b.
The result is scalar.
If vector_a is of type integer or real, the result has the value SUM(vector_a*vector_b). If the vectors have size zero, the result has the value 0.
If vector_a is of type complex, the result has the value SUM(CONJG(vector_a) *vector_b). If the vectors have size zero, the result has the value 0.
If vector_a is of type logical, the result has the value ANY(vector_a.AND.vector_b). If the vectors have size 0, the result has the value FALSE.
EXAMPLES
DOT_PRODUCT((/1,2,3/),(/2,3,4/)) yields 20.