I was making a small package for dual numbers (dual numbers are
similar to complex number except that the square of the dual unit
epsilon is 0 instead of -1). I used the quaternion package from the
Maple documentation as an example (see ?overload). I overloaded the
`*` operator. So far it works well.
Now I also want to use matrices whose entries are dual numbers.
Problem is that when I try to multiply two such matrices, the `.`
operator uses the standard `*` operator instead of my overloaded one.
I searched this newsgroup and came up with this thread, which explains
that this behaviour is because `.` was defined before I overloaded `*`
Is there a way to make the standard `.` operator use my overloaded `*`
operator? Of course I could write my own `.`, but then I would have to
write own versions of lots of standard procedures (I need more than
just `.`).
Best regards,
Martin
May be that is not the way you want to (have not tried it myself):
Why don't work with the algebra A = k[X]/(X^2) = k[eps], eps^2 = 0?
This is the algebraic definition of dual numbers over k, k a field.