From: Paul K. <pki...@us...> - 2003-01-12 07:08:04
|
I've added dispatch.cc to octave-forge/main/miscellaneous. This adds the ability to overload functions in octave. E.g., mark_as_command dispatch dispatch sin string g function g,'g',end sin('x') # ==> g sin(3) # ==> 0.14112 dispatch min string g min([1 2 3]) # ==> 1 min('x') # ==> g dispatch reshape string g reshape(1:6,2,3) # ==> [1 3 5; 2 4 6 ] reshape('x',2,3) # ==> g help sin # ==> sin is a builtin function - Mapping Function: sin (X) Compute the sin of each element of X. Overloaded function string:g If you are using octave 2.1.40 compile it with mkoctfile -DOCTAVE2140 dispatch.cc, otherwise use octave 2.1.43. Now we need PKG_ADD to contain the appropriate dispatch functions for octave forge, such as "dispatch find sparse spfind". Paul Kienzle pki...@us... |