MEX-functions, extending octave

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MEX-functions, extending octave

Andrew Archibald-3
Hi,

I've managed to install octave here, as an alternative to MATLAB.
Unfortunately, we have a lot of existing code written for MATLAB. The
M-files should be fine, but we have written a lot of MEX C functions
which perform various functions.

Firstly, is it possible to recompile these so octave can use them ---
either dynamically loaded, or by recompiling octave?

Is there an interface by which similar things can be written?

Thanks,
Andrew Archibald
[hidden email]


Reply | Threaded
Open this post in threaded view
|

MEX-functions, extending octave

John W. Eaton-6
On 24-Oct-1996, Andrew Archibald <[hidden email]> wrote:

: I've managed to install octave here, as an alternative to MATLAB.
: Unfortunately, we have a lot of existing code written for MATLAB. The
: M-files should be fine, but we have written a lot of MEX C functions
: which perform various functions.
:
: Firstly, is it possible to recompile these so octave can use them ---
: either dynamically loaded, or by recompiling octave?
:
: Is there an interface by which similar things can be written?

It has always been possible to add new functions written in C++, C, or
Fortran by recompiling Octave.

With version 1.1.1, dynamic linking was possible on some systems using
GNU dld (this is described briefly in the manual, section Dynamically
Linked Functions).

In the next release, support for dld has been dropped and dynamic
linking will work on many more systems using either dlopen() (most
Unix-like systems) or sh_load() (HP/UX systems). The interface for
dynamically-linked functions has also been simplified (conversion from
the old to the new interface is very simple).

The interface is not the same as the Matlab MEX file interface, but I
suppose it might be possible to write a library of compatibility
functions so that your MEX files would work without modification.

Also in the next release, you will be able to define your own data
types (for example, sparse or banded matrix types) and use them pretty
much like you would the built-in types.

jwe

Reply | Threaded
Open this post in threaded view
|

fsolve

Guoqiang Lu
In reply to this post by Andrew Archibald-3
I am using fsolve to find the solution for F(X)=[0 0 ...0]'. The
solution may or may not exist. When there is no solution, I would
like to find X0 such that Norm[F(X),2] is minimized. How do I solve this
using octave? Also, I get info=3 using [X,info]=fsolve(F, X0).

Based on what criteria does fsolve stop the interaction?

Thanks.

guoqiang