octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

projects and request for comments


From: John W. Eaton
Subject: projects and request for comments
Date: Thu, 3 Apr 1997 16:34:14 -0600

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
C++.

Comments or suggestions?

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]