octave-maintainers
[Top][All Lists]
Advanced

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

Re: mex function behavior


From: Shai Ayal
Subject: Re: mex function behavior
Date: Tue, 15 May 2007 21:25:25 +0300

oops, it seems I answered the wrong question (but at least I gave the
right answer ,,,)


Sorry,
Shai

On 5/15/07, Shai Ayal <address@hidden> wrote:
You can define multiple DLD functions in the same file. You than have
two choices on how to tell octave where to find the functions. Say you
have the functions f1 and f2 infile ff.oct:
1) symlinking: ln -s ff.oct f1.oct && ln -s ff.oct f2.oct
2) using the autoload function (I don't recall the syntax)

option 1 is backwards compatible with old versions of octave (2.1.x)
while option 2 is much nicer

Shai

On 5/15/07, John Swensen <address@hidden> wrote:
> Using the native method for extending Octave (e.g. DEFUN_DLD) I am able
> to declare multiple functions in a single file.  All of these can access
> the same global data.  With mex functions, on the other hand, it seems
> as if there can only be one declard per file and that I can't simply
> declare a global variable to share between all of them.  I looks like I
> have to wrap a data structure and continually pass it back to
> Matlab/Octave and then back into the mexFunction again.   As an
> alternative, I suppose I could put an object in the global workspace,
> but then I still have to continually wrap it up as a mex variable and
> unwrap it again when I want to use it.
>
> Is there some way to put multiple mex functions in a single source file
> and/or share data between mex functions more easily?
>
> John Swensen
>



reply via email to

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