projects and request for comments

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

projects and request for comments

John W. Eaton-6
I'm currently thinking about how to implement the array and matrix
operations more consistently.  For example, it should be possible to
write something like

  A = hilb (3);
  B = A(1:2:3, 1:2:3)++;

in Octave or in C++ using liboctave, though in C++ we have to use a
different method for creating the range variables -- operator
overloading only works up to a point.  There is no way to implement
Octave's colon operator or `.*' or even `**' using operators in C++,
and even when the operators are available, they don't always have the
same precedence in Octave and C++, so it is probably best to avoid
confusion by simply not using them.

So, I'm thinking that the liboctave classes should define a set of
consistently named functions corresponding to all Octave operators,
and then provide operators only in a few cases where it really makes
sense -- probably just for negation (unary -), addition (+),
subtraction (-), matrix multiplication (+), and division of a matrix
by a scalar (/).

Currently there are a number of things that are not implemented in
liboctave, so they are not available in C++.  I plan to try to push as
much functionality to the liboctave level so that it will become
easier to write more powerful .oct files and to convert Octave code to

Comments or suggestions?