Approved for inclusion in a future ANSI M[UMPS] language standard as part of the library for Matrix Mathematics.

This function subtracts two (sparse) matrices.

3 5 7 1 2 3 2 3 4 8 5 2 - 3 2 1 = 5 3 1 8 8 8 1 2 3 7 6 5

Cells that were not defined in the source matrices will not be defined in the result matrices (sparsity is retained) (a cell containing "#" means no defined value):

# 5 7 1 2 # -1 3 4 8 # 2 - 3 # 1 = 5 # 1 8 8 # # 2 3 8 6 -3

**KILL** FIRST,SECOND

**SET** FIRST(1,2)=5,FIRST(1,3)=7

**SET** FIRST(2,1)=8,FIRST(2,3)=2

**SET** FIRST(3,1)=8,FIRST(3,2)=8

**SET** SECOND(1,1)=1,SECOND(1,2)=2

**SET** SECOND(2,1)=3,SECOND(2,3)=1

**SET** SECOND(3,2)=2,SECOND(3,3)=3

**SET** X=**$%MTXSUB^MATH**(.FIRST,.SECOND,.RESULT,3,3)

performs the math that is depicted in the second example above. The
result in array `RESULT` will be that:

`RESULT(1,1)=-1`, `RESULT(1,2)=5`, `RESULT(1,3)=4`

`RESULT(2,1)=5`, `RESULT(2,2)` is not defined,
`RESULT(2,3)=1`

`RESULT(3,1)=8`, `RESULT(3,2)=6`, `RESULT(3,3)=-3`

The MDC has approved code to approximate the return value of this function. Implementors are encouraged to provide more accurate and efficient code). Click here to view or download the code for this function. Click here to view or download the code for all M[UMPS] Library Functions.

This document is © Ed de Moel, 1995-2005.

It is part of a book by Ed de Moel that is published
under the title "M[UMPS] by Example" (ISBN 0-918118-42-5).

Printed copies of the book are no longer available.

This document describes the various library functions that are defined for the M[UMPS] programming language.

*The information in this document is NOT authoritative
and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an
authoritative definition.*

*In this document, information is included that will
appear in
future standards.
The MDC cannot guarantee that these 'next'
standards will indeed appear.*