octave-maintainers
[Top][All Lists]
Advanced

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

Re-implementation of inline functions


From: David Bateman
Subject: Re-implementation of inline functions
Date: Tue, 3 Aug 2004 13:54:36 +0200
User-agent: Mutt/1.4.1i

Dear All,

Coming back to the Octave 3.0 ToDo list, the things on it that haven't
yet been addressed are

  * some support for MPI
  * sparse matrices
  * finish implementation of cell arrays and struct arrays:
      -- cell(idx) = [] to delete elements
      -- a(1).x = 1; a(2).x = 2; a.x => c.s. list, [a.x] => num array
      -- allow [x{:}] = f (...) to work
      -- and other little details like this...
  * inline functions
  * private functions
  * bring the manual up to date

Two of the things on this list that interest me, are inline and
private functions [I hope that someone else has some interest
in the other points :-) ].

As I don't understand all that needs to be done for private functions
yet, I thought I'd attack the question of inline functions and see
what I could do. There is already a reasonable implementation within
octave-forge, but it has the disadvantage that it defines as many user
defined functions in the symbol table as there are inline functions,
and can implement the argnames and vectorize functions in a matlab
compatiable manner.

I re-implemented the same ideas in version in octave-forge as an
octave_value class. However, to get the function I extract its
definition as an octave_value from the symbol table, before deleting
it for the symbol table. In this way I need a single unique name for
the function that the user should never see (except in the case of a
parse error).

I also included all of the missing functions such as vectorize and
argnames that were missing. The only missing feature is the extraction
of the argument name from a single argument call to "inline", as what
matlab does seems a bit dumb to me. Also, as fsolve hasn't been
adapted to allow function handles, and perhaps other functions, you
can't yet do something fsolve(inline("1-x"),0).

At the moment this is implementaed as a oct-file. So it might either go
into octave-forge as is, or be adapated and included as part of octave
itself.

Can you comment on the attached implementation and suggest what should
be done with it.

Regarsd
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

Attachment: ov-fcn-inline.cc
Description: Text document

Attachment: ov-fcn-inline.h
Description: Text document


reply via email to

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