Speedup/Refaktoring loop? Extended...
John W. Eaton
jwe at bevo.che.wisc.edu
Wed Aug 27 11:09:02 CDT 2008
On 27-Aug-2008, Andreas Romeyke wrote:
| Thanks for your explanation. But I did not see the reason, why the
| transpose-operator and the transpose function will be evaluated
| differently? Should it not be the same in internal representation of
| Octaves's interpreter? I thought Octave uses an AST to walk on it?
Yes, but for historical reasons, operators are handled internally by
the interpreter and function calls are handled differently. The
interpreter does not currently translate .' to a call to the transpose
function. However, I think this may need to change to properly handle
operator overloading for classes. For example, so you can define an
@double/transpose.m function to overload the behavior of the transpose
operator with your own function (of course, doing that will be slow,
so I don't guess you speed demons care about that too much, right?).
jwe
More information about the Help-octave
mailing list