octave-maintainers
[Top][All Lists]
Advanced

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

Re: Algorithmic Differentiation in Octave


From: Olaf Till
Subject: Re: Algorithmic Differentiation in Octave
Date: Sat, 4 Feb 2017 13:48:05 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Jan 28, 2017 at 09:42:43AM +0100, Olaf Till wrote:
> For finding an overall way to fit this into Octave, I still have to
> find out about some issues in your interface which are not clear to
> me. But before asking, I'd like to give it a try, making it compile
> and experimenting with it a bit. Since I have currently some other
> things on my schedule, I guess it'll take a week.

I havn't come very far. The cppad library, compiled according to the
instructions at

https://www.coin-or.org/CppAD/Doc/cmake.htm

with

cd build
cmake -G "Unix Makefiles" -D cppad_prefix=/usr/local ..

with 'make install' only installs headers, no library. And I find no
library even under the build/directory.

swig-cppad compiled an oct-file, after fiddling with Octaves include
files. (BTW: Instead of `octave-config -p INCLUDEDIR`, use `mkoctfile
-p INCFLAGS`, yielding 2 include dirs, with '-I' already prepended.)

swig-cppad compiled this although no cppad library was present
anywhere, and not even the cppad headers were present at this time
(and I don't find them in swig-cppad either)! The resulting oct-file,
according to 'ldd', referenced nothing which looked like a cppad
library, of course. And it segfaulted at the time of loading into
Octave.

So I can only give 'theoretical' notes now.

Let's assume swig-cppad worked as expected. Then, if we took it
unchanged, we'd have to define a wrapper class around it. Doing this
in iterpreted Octave code would yield matrix operations which are too
slow.

I think the best bet would be to generate an Octave type at the c++
level (similar to what swig-cppad currently does) which interfaces to
cppad and already contains overloading of matrix operations.

If the latter is done, I would not like to do it with swig, but rather
try it directly with Octaves API. And the build system of swig-cppad
would have to be changed anyway, IMHO, to make it distributable as an
Octave package.

This would be rather a long term project for me (but maybe others
would be faster). I have difficulties in deducing from swig-cppad the
interaction with the cppad interface. I'd have to learn how to
interface with cppad from the cppad documentation.

Problems are that cppad currently installs no library for me (see
above), and that cppad doesn't seem to be available in current Debian
(i.e. only the headers are available there).

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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