02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Intrinsic procedures<br />

Intrinsic procedure specifications<br />

Result type,<br />

type parameters,<br />

and shape<br />

552<br />

If MATRIX_A has rank one, MATRIX_B must have rank two. If MATRIX_B has<br />

rank one, MATRIX_A must have rank two. The size of the first (or only)<br />

dimension of MATRIX_B must equal the size of the last (or only) dimension of<br />

MATRIX_A.<br />

If the arguments are of numeric type, the type and kind type parameter of the result are<br />

determined by the types of MATRIX_A and MATRIX_B.<br />

If the arguments are of type logical, the result is of type logical with the kind type parameter<br />

of the arguments.<br />

The shape of the result depends on the shapes of the arguments as follows:<br />

Case 1 If MATRIX_A has shape [n, m] andMATRIX_B has shape [m, k], the result has<br />

shape [n, k].<br />

Case 2 If MATRIX_A has shape [m] andMATRIX_B has shape [m, k], the result has<br />

shape [k].<br />

Case 3 If MATRIX_A has shape [n, m] andMATRIX_B has shape [m], the result has<br />

shape [n].<br />

Result value<br />

Case 1 Element (i, j) of the result has the value SUM(MATRIX_A(i,:) *<br />

MATRIX_B(:, j)) if the arguments are of numeric type and has the value<br />

ANY(MATRIX_A(i, :) .AND. MATRIX_B(:, j)) if the arguments are of<br />

logical type.<br />

Case 2 Element (j) oftheresulthasthevalueSUM(MATRIX_A(:) * MATRIX_B(:,<br />

j)) iftheargumentsareofnumerictypeandhasthevalue<br />

ANY(MATRIX_A(:) .AND. MATRIX_B(:, j)) if the arguments are of logical<br />

type.<br />

Case 3 Element (i) oftheresulthasthevalueSUM(MATRIX_A(i, :) *<br />

MATRIX_B(:)) if the arguments are of numeric type and has the value<br />

ANY(MATRIX_A(i, :) .AND. MATRIX_B(:)) if the arguments are of logical<br />

type.<br />

Chapter 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!