$SPAD/src/input matrix22.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool matrix22.output
)set message test on
)set message auto off
)clear all

———-

This file shows nesting of matrices — * —

--S 1 of 8
m:SQMATRIX(2,INT) := squareMatrix matrix [[0,1],[-1,0]]
--R
--R
--R        + 0   1+
--R   (1)  |      |
--R        +- 1  0+
--R                                                Type: SquareMatrix(2,Integer)
--E 1

———-

This determinant can be computed — * —

--S 2 of 8
determinant m
--R
--R
--R   (2)  1
--R                                                        Type: PositiveInteger
--E 2
--S 3 of 8
n:SQMATRIX(2,SQMATRIX(2,INT)) :=
  squareMatrix matrix [[m,m**2],[m**3,m**4]]
--R
--R
--R        ++ 0   1+  +- 1   0 ++

--R        ||      |  |        ||
--R        |+- 1  0+  + 0   - 1+|
--R   (3)  |                    |
--R        |+0  - 1+    +1  0+  |
--R        ||      |    |    |  |
--R        ++1   0 +    +0  1+  +
--R                                Type: SquareMatrix(2,SquareMatrix(2,Integer))
--E 3

———-

This determinant cannot be computed by Scratchpad II because there is no function that computes the determinant of a matrix whose entries belong to a noncommutative ring

— * —

)set mes test off
--S 4 of 8
determinant n
--R
--R   There are 3 exposed and 1 unexposed library operations named
--R      determinant having 1 argument(s) but none was determined to be
--R      applicable. Use HyperDoc Browse, or issue
--R                           )display op determinant
--R      to learn more about the available operations. Perhaps
--R      package-calling the operation or using coercions on the arguments
--R      will allow you to apply the operation.
--R
--R   Cannot find a definition or applicable library operation named
--R      determinant with argument type(s)
--R                   SquareMatrix(2,SquareMatrix(2,Integer))
--R
--R      Perhaps you should use "@" to indicate the required return type,
--R      or "$" to specify which version of the function you need.
--E 4
)set mes test on

———-

Another level of matrix — * —

--S 5 of 8
o:SQMATRIX(2,SQMATRIX(2,SQMATRIX(2,INT))) :=
   squareMatrix matrix [[n,n**2],[n**3,n**4]]
--R
--R
--R        +++ 0   1+  +- 1   0 ++  ++- 1   1 +  +- 1  - 1+++
--R        |||      |  |        ||  ||        |  |        |||
--R        ||+- 1  0+  + 0   - 1+|  |+- 1  - 1+  + 1   - 1+||
--R        ||                    |  |                      ||
--R        ||+0  - 1+    +1  0+  |  | +1  - 1+    + 1   1+ ||

--R        |||      |    |    |  |  | |      |    |      | ||
--R        |++1   0 +    +0  1+  +  + +1   1 +    +- 1  1+ +|
--R   (4)  |                                                |
--R        |++- 2   0 +  +0  - 2++  ++- 2  - 2+   +2  - 2+ +|
--R        |||        |  |      ||  ||        |   |      | ||
--R        ||+ 0   - 2+  +2   0 +|  |+ 2   - 2+   +2   2 + ||
--R        ||                    |  |                      ||
--R        ||  +2  0+    + 0   2+|  | + 2   2+   +- 2   2 +||
--R        ||  |    |    |      ||  | |      |   |        |||
--R        ++  +0  2+    +- 2  0++  + +- 2  2+   +- 2  - 2+++
--R                Type: SquareMatrix(2,SquareMatrix(2,SquareMatrix(2,Integer)))
--E 5
--S 6 of 8
o ** 2
--R
--R
--R        +++- 1  - 3+   +3  - 1+ +  + +2  - 4+    + 4   2+ ++
--R        |||        |   |      | |  | |      |    |      | ||
--R        ||+ 3   - 1+   +1   3 + |  | +4   2 +    +- 2  4+ ||
--R        ||                      |  |                      ||
--R        || + 1   3+   +- 3   1 +|  |+- 2   4 +  +- 4  - 2+||
--R        || |      |   |        ||  ||        |  |        |||
--R        |+ +- 3  1+   +- 1  - 3++  ++- 4  - 2+  + 2   - 4++|
--R   (5)  |                                                  |
--R        |+ +6  - 2+    + 2   6+ +  + + 8   4+   +- 4   8 ++|
--R        || |      |    |      | |  | |      |   |        |||
--R        || +2   6 +    +- 6  2+ |  | +- 4  8+   +- 8  - 4+||
--R        ||                      |  |                      ||
--R        ||+- 6   2 +  +- 2  - 6+|  |+- 8  - 4+   +4  - 8+ ||
--R        |||        |  |        ||  ||        |   |      | ||
--R        +++- 2  - 6+  + 6   - 2++  ++ 4   - 8+   +8   4 + ++
--R                Type: SquareMatrix(2,SquareMatrix(2,SquareMatrix(2,Integer)))
--E 6

———-

Add 2 to this matrix — * —

--S 7 of 8
% + 2
--R
--R
--R        + ++1  - 3+   +3  - 1+ +   + +2  - 4+    + 4   2+ ++
--R        | ||      |   |      | |   | |      |    |      | ||
--R        | |+3   1 +   +1   3 + |   | +4   2 +    +- 2  4+ ||
--R        | |                    |   |                      ||
--R        | |+ 1   3+  +- 1   1 +|   |+- 2   4 +  +- 4  - 2+||
--R        | ||      |  |        ||   ||        |  |        |||

--R        | ++- 3  1+  +- 1  - 1++   ++- 4  - 2+  + 2   - 4++|
--R   (6)  |                                                  |
--R        |+ +6  - 2+    + 2   6+ +  ++10   4 +   +- 4   8 ++|
--R        || |      |    |      | |  ||       |   |        |||
--R        || +2   6 +    +- 6  2+ |  |+- 4  10+   +- 8  - 4+||
--R        ||                      |  |                      ||
--R        ||+- 6   2 +  +- 2  - 6+|  |+- 8  - 4+   +6  - 8+ ||
--R        |||        |  |        ||  ||        |   |      | ||
--R        +++- 2  - 6+  + 6   - 2++  ++ 4   - 8+   +8   6 + ++
--R                Type: SquareMatrix(2,SquareMatrix(2,SquareMatrix(2,Integer)))
--E 7

———-

What is 2 as a matrix?

— * —

--S 8 of 8
o := 2
--R
--R
--R        +++2  0+  +0  0++  ++0  0+  +0  0+++
--R        |||    |  |    ||  ||    |  |    |||
--R        ||+0  2+  +0  0+|  |+0  0+  +0  0+||
--R        ||              |  |              ||
--R        ||+0  0+  +2  0+|  |+0  0+  +0  0+||
--R        |||    |  |    ||  ||    |  |    |||
--R        |++0  0+  +0  2++  ++0  0+  +0  0++|
--R   (7)  |                                  |
--R        |++0  0+  +0  0++  ++2  0+  +0  0++|
--R        |||    |  |    ||  ||    |  |    |||
--R        ||+0  0+  +0  0+|  |+0  2+  +0  0+||
--R        ||              |  |              ||
--R        ||+0  0+  +0  0+|  |+0  0+  +2  0+||
--R        |||    |  |    ||  ||    |  |    |||
--R        +++0  0+  +0  0++  ++0  0+  +0  2+++
--R                Type: SquareMatrix(2,SquareMatrix(2,SquareMatrix(2,Integer)))
--E 8
)spool
)lisp (bye)

———-

References^{[1] nothing}

7