]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/matmul.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / matmul.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: MATMUL, matrix multiplication, product, matrix
7
8 .. _matmul:
9
10 MATMUL --- matrix multiplication
11 ********************************
12
13 .. function:: MATMUL(MATRIX_A, MATRIX_B)
14
15 Performs a matrix multiplication on numeric or logical arguments.
16
17 :param MATRIX_A:
18 An array of ``INTEGER``,
19 ``REAL``, ``COMPLEX``, or ``LOGICAL`` type, with a rank of
20 one or two.
21
22 :param MATRIX_B:
23 An array of ``INTEGER``,
24 ``REAL``, or ``COMPLEX`` type if :samp:`{MATRIX_A}` is of a numeric
25 type; otherwise, an array of ``LOGICAL`` type. The rank shall be one
26 or two, and the first (or only) dimension of :samp:`{MATRIX_B}` shall be
27 equal to the last (or only) dimension of :samp:`{MATRIX_A}`.
28 :samp:`{MATRIX_A}` and :samp:`{MATRIX_B}` shall not both be rank one arrays.
29
30 :return:
31 The matrix product of :samp:`{MATRIX_A}` and :samp:`{MATRIX_B}`. The type and
32 kind of the result follow the usual type and kind promotion rules, as
33 for the ``*`` or ``.AND.`` operators.
34
35 Standard:
36 Fortran 90 and later
37
38 Class:
39 Transformational function
40
41 Syntax:
42 .. code-block:: fortran
43
44 RESULT = MATMUL(MATRIX_A, MATRIX_B)