Next: About this document ...
Up: Design and implementation issues
Previous: Robustness, especially complex numbers
  Contents
Both elementwise and matrix functions are very useful in practice. In
Matlab there are two versions of operators: the plain operators (matrix
operation like *) and dot operators (elementwise operations like
.*), and two versions of functions: the plain functions (elementwise
like exp) and m-suffixed functions (matrix functions like
expm).
Two difficulties exist,
- Python do not recognize these ``dot operators''. This may be overcome
by patching the parser like what has been done for the ``augmentation
operators'' += and *=, etc. Discussions and experiments are
underway. Right now A .* B can be invoked by
A.__dotmul__(B)
.
- The default behavior in Matlab is for the symbolic operators like
*, / is different from that for the named functions like exp,
sin. This leaves the function pow potentially confusing. Is
pow(x,2)==x.**2 or pow(x,2)==x**2? The safest approach
appears to be leaving out this function.
Huaiyu Zhu
2002-03-23