Question: Overloading "."

I am trying to overload the "." operator (noncommutative product) to handle objects I have implemented as records. Each record contains a matrix R and a parameter l. A.B will produce a new record where l is l_A+l_B and R is R_A.R_B, "." here being the normal matrix product (and I use LinearAlgebra:-Multiply in the body of my procedure for this). The objects A and B are of type 'Element', which I have defined (using AddType) and which works.

I implemented the procedure with two arguments, each one to be of type 'Element'. I get it to work for the above example in a straightforward manner (process the parameters of each record in the right way and returning a record with the result).

It does not work for A.B.C. I read that this becomes `.`(A,B,C) so I reimplemented my procedure with a seq as the argument list, i.e. `.`:=proc(elements::seq(Element)) option overload: and then loop for element in [elements] etc.

This again works right for two arguments but the third one seems to be ignored.

Any hint?

Thanks, Mac Dude.

Please Wait...