octave-maintainers
[Top][All Lists]
Advanced

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

Re: JIT - automated mexing


From: Jaroslav Hajek
Subject: Re: JIT - automated mexing
Date: Mon, 26 Jul 2010 19:53:45 +0200

On Mon, Jul 26, 2010 at 5:54 PM, Judd Storrs <address@hidden> wrote:
> On Mon, Jul 26, 2010 at 11:42 AM, Alexander Barth
> <address@hidden> wrote:
>>
>> function x = foo(a,b)
>> %oct-type a,x double
>> %oct-type b int
>> x = a+b
>
> But return types in octave are very unruly. For example how would you
> declare the return type of sort()?
> Also, none come immediately to mind but can't functions return different
> types based on the number of input and output arguments that are used?
>


Definitely, yes. log2, for instance. Another thing is functions like
sqrt() which can return double or complex results depending on the
input.
Most importantly, many m-functions are designed to be type-generic,
i.e. they will compute in double if passed double inputs, single with
single inputs, integers, complex, characters etc. How would you
reflect that with declarations?

best regards


-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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