1zmu(1)                           User Commands                          zmu(1)
2
3
4

NAME

6       zmu - multiply matrices or permutations
7

SYNOPSIS

9       zmu [OPTIONS] <A> <B> <Result>
10

DESCRIPTION

12       This  program reads two matrices or permutations and writes their prod‐
13       uct to Result.
14
15       The input files must contain two compatible objects, i.e., their  prod‐
16       uct  must  be  defined.   Currently,  zmu can handle the following data
17       types:
18
19       · Both files are matrices over the same field, and the number  of  col‐
20         umns  of  A equals the number of rows of B.  In this case, zmu calcu‐
21         lates the standard matrix product.
22
23       · One of the operands is a one by one matrix,  and  the  other  is  any
24         matrix  over  the same field.  In this case, the one by one matrix is
25         interpreted as a scalar, and the program calculates the corresponding
26         multiple of the matrix.
27
28       · Both  input  files  are permutations of degree a and b, respectively.
29         The result is a permutation C of degree max(a,b), which is defined by
30         C(x)  =  B(A(x)).   If the permutations are of different degrees, the
31         smaller permutation is extended to the larger degree by adding  fixed
32         points.
33
34       · A  is  a matrix, B is a permutation and the degree of the permutation
35         equals the number of columns of the matrix.  The result is  a  matrix
36         of the same size which is calculated from the input matrix by permut‐
37         ing the marks of each row in the following way: The ith mark  of  the
38         row is stored as the kth mark of the result if the permutation maps i
39         to k.
40
41       · A is a permutation of degree m, and B is  an  m  by  n  matrix.   The
42         result  is  again  an m by n matrix which consists of the rows of the
43         input matrix, rearranged according to the permutation.  If the permu‐
44         tation  maps i to k, then the kth row of the input matrix becomes the
45         ith row of the output matrix.  Here is an example:
46
47                     | 1 1 |     | 2 2 |
48         (1 2 3)  *  | 2 2 |  =  | 3 3 |
49                     | 3 3 |     | 1 1 |
50
51       With these conventions, products between matrices and permutations  are
52       defined  in  a  consistent  way.  The associative law a(bc)=(ab)c holds
53       whenever ab and bc are defined (a,b,c being matrices or  permutations).
54       A  permutation  matrix  created  with  zcv  or  zcf, if multiplied with
55       another matrix, produces the same result as the original permutation.
56
57   Blockwise Matrix Multiplication
58       In the case of two matrices, a blockwise  multiplication  can  be  per‐
59       formed  using  the  -r and -c options.  If one or both of these options
60       are specified on the command line, zmu will read only some  rows  of  A
61       and/or some columns of B.  Multiplying the two pieces together yields a
62       rectangular piece of the result.  By default the result is divided into
63       4  pieces  of  (almost)  equal  size. To calculate the 4 pieces succes‐
64       sively, type
65
66         zmu -r 1 -c 1 m1 m2 tmp11
67         zmu -r 1 -c 2 m1 m2 tmp12
68         zmu -r 2 -c 1 m1 m2 tmp21
69         zmu -r 2 -c 2 m1 m2 tmp22
70
71       The resulting matrices `tmpXX' can then be pasted together using zpt:
72
73         zpt -R 2 -C 2 result tmp
74
75       This procedure can be used in a multi-processor environment where  each
76       piece of the result is computed on a separate machine.
77
78       By  adding  an additional parameter to -r and/or -c you can control the
79       number of vertical or horizontal slices.  For example,
80
81         zmu -r 3/5
82
83       means to cut A horizontally into five slices and use  the  third  slice
84       for  multiplication.   The number of slice must not be greater than the
85       number of rows.
86

OPTIONS

88       -Q     Quiet, no messages.
89
90       -V     Verbose, more messages.
91
92       -T <MaxTime>
93              Set CPU time limit
94
95       -r <Row>[.<NRows>]
96              Divide the matrix A horizontally into NRows (default: 2)  slices
97              and  use  the Rowth slice as the left factor.  NRows must not be
98              larger than the number of rows of A.
99
100       -c <Col>[.<NCols>]
101              Divide the matrix B vertically into NCols  (default:  2)  slices
102              and  use the Colth slice as the right factor.  NCols must not be
103              larger than the number of columns of B.
104

INPUT FILES

106       A      Left factor.
107
108       B      Right factor.
109

OUTPUT FILES

111       Result The product.
112

SEE ALSO

114       zcf(1), zcv(1), zpt(1)
115
116
117
118MeatAxe                             2.4.24                              zmu(1)
Impressum