Matrices of matrices



Welcome to Maxima!

> matrix multiplication calls for a sum of ordinary products instead
> of a sum of non-commutative products.  Is there any way around this?

The addition and multiplication operations used for matrix
multiplication are parameterizable.  For example:

  matrix_element_mult: ".";
  matrix([a,b,c],[d,e,f]) . matrix([q,r]) =>
    matrix([ c . s  +  b . r  +  a . q ],
           [ f . s  +  e . r  +  d . q ] )

Or perhaps more interestingly (a la APL):

  matrix_element_add: 'min;
  matrix_element_mult: 'max;

  matrix([2,minf,4],[5,inf,2]) . matrix([inf,1],[3,minf],[minf,4]) =>
    matrix([ 3, minf ],
           [ 2,  4   ])

Beware: matrix_element_xxx is only used by matrix multiplication and
powers to a positive degree.  Other matrix operations such as inverse
(A^^-1), diagonalization, etc. are COMPLETELY OBLIVIOUS to these
parameters and will give nonsense results.

Hope this helps.

      -s

--------------------------------------------------

 - Variable: MATRIX_ELEMENT_ADD
     default: [+] - May be set to "?"; may also be the name of a
     function, or a LAMBDA expression.  In this way, a rich variety of
     algebraic structures may be simulated.  For more details, do
     DEMO("matrix.dem1"); and DEMO("matrix.dem2");.


 - Variable: MATRIX_ELEMENT_MULT
     default: [*] - May be set to "."; may also be the name of a
     function, or a LAMBDA expression.  In this way, a rich variety of
     algebraic structures may be simulated.  For more details, do
     DEMO("matrix.dem1"); and DEMO("matrix.dem2");


 - Variable: MATRIX_ELEMENT_TRANSPOSE
     default: [FALSE] - Other useful settings are TRANSPOSE and
     NONSCALARS; may also be the name of a function, or a LAMBDA
     expression.  In this way, a rich variety of algebraic structures
     may be simulated.  For more details, do DEMO("matrix.dem1"); and
     DEMO("matrix.dem2");.