zmu man page

zmu — multiply matrices or permutations


zmu [Options] <A> <B> <Result>


This program reads two matrices or permutations and writes their product to Result.

The input files must contain two compatible objects, i.e., their product must be defined.  Currently, zmu can handle the following data types:

             | 1 1 |     | 2 2 |
 (1 2 3)  *  | 2 2 |  =  | 3 3 |

             | 3 3 |     | 1 1 |

With these conventions, products between matrices and permutations are defined in a consistent way.  The associative law a(bc)=(ab)c holds whenever ab and bc are defined (a,b,c being matrices or permutations).  A permutation matrix created with zcv or zcf, if multiplied with another matrix, produces the same result as the original permutation.

Blockwise Matrix Multiplication

In the case of two matrices, a blockwise multiplication can be performed using the -r and -c options.  If one or both of these options are specified on the command line, zmu will read only some rows of A and/or some columns of B.  Multiplying the two pieces together yields a rectangular piece of the result.  By default the result is divided into 4 pieces of (almost) equal size. To calculate the 4 pieces successively, type

zmu -r 1 -c 1 m1 m2 tmp11
zmu -r 1 -c 2 m1 m2 tmp12
zmu -r 2 -c 1 m1 m2 tmp21
zmu -r 2 -c 2 m1 m2 tmp22

The resulting matrices `tmpXX' can then be pasted together using zpt:

zpt -R 2 -C 2 result tmp

This procedure can be used in a multi-processor environment where each piece of the result is computed on a separate machine.

By adding an additional parameter to -r and/or -c you can control the number of vertical or horizontal slices.  For example,

zmu -r 3/5

means to cut A horizontally into five slices and use the third slice for multiplication.  The number of slice must not be greater than the number of rows.



Quiet, no messages.


Verbose, more messages.

-T <MaxTime>

Set CPU time limit

-r <Row>[.<NRows>]

Divide the matrix A horizontally into NRows (default: 2) slices and use the Rowth slice as the left factor.  NRows must not be larger than the number of rows of A.

-c <Col>[.<NCols>]

Divide the matrix B vertically into NCols (default: 2) slices and use the Colth slice as the right factor.  NCols must not be larger than the number of columns of B.

Input Files


Left factor.


Right factor.

Output Files


The product.

See Also

zcf(1), zcv(1), zpt(1)

Referenced By

zqt(1), zsp(1).

2.4.24 MeatAxe User Commands