HP Fortran Programmer's Reference (September 2007)

Intrinsic procedures
Intrinsic procedure specifications
Chapter 11 587
If MATRIX_A has rank one, MATRIX_B must have rank two. If MATRIX_B has
rank one, MATRIX_A must have rank two. The size of the first (or only)
dimension of MATRIX_B must equal the size of the last (or only) dimension of
MATRIX_A.
Result type,
type parameters,
and shape
If the arguments are of numeric type, the type and kind type parameter of the result are
determined by the types of MATRIX_A and MATRIX_B.
If the arguments are of type logical, the result is of type logical with the kind type parameter
of the arguments.
The shape of the result depends on the shapes of the arguments as follows:
Case 1 If MATRIX_A has shape [
n
,
m
] and MATRIX_B has shape [
m
,
k
], the result has
shape [
n
,
k
].
Case 2 If MATRIX_A has shape [
m
] and MATRIX_B has shape [
m
,
k
], the result has
shape [
k
].
Case 3 If MATRIX_A has shape [
n
,
m
] and MATRIX_B has shape [
m
], the result has
shape [
n
].
Result value
Case 1 Element (
i
,
j
) of the result has the value SUM(MATRIX_A(
i
,:) *
MATRIX_B(:,
j
)) if the arguments are of numeric type and has the value
ANY(MATRIX_A(
i
, :) .AND. MATRIX_B(:,
j
)) if the arguments are of
logical type.
Case 2 Element (
j
) of the result has the value SUM(MATRIX_A(:) * MATRIX_B(:,
j
)) if the arguments are of numeric type and has the value
ANY(MATRIX_A(:) .AND. MATRIX_B(:,
j
)) if the arguments are of logical
type.
Case 3 Element (
i
) of the result has the value SUM(MATRIX_A(
i
, :) *
MATRIX_B(:)) if the arguments are of numeric type and has the value
ANY(MATRIX_A(
i
, :) .AND. MATRIX_B(:)) if the arguments are of logical
type.