octave-maintainers
[Top][All Lists]
Advanced

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

Re: Make java2mat an internal function only?


From: siko1056
Subject: Re: Make java2mat an internal function only?
Date: Tue, 27 Mar 2018 13:36:11 -0700 (MST)

Rik-4 wrote
> All,
> 
> I notice that java2mat has no documentation, just "Undocumented internal
> function".
> 
> Using grep, I can't see that it is used anywhere in the core either. 
> Should we rename this to "__java2mat__" to indicate that it really is an
> internal function?  Eventually we could even deprecate it if no one is
> using it, but I would start with renaming it.
> 
> --Rik

Agree to rename this to "__java2mat__".  This function is there since the
integration of the java package to core [1].  I cannot figure out a
meaningful purpose.  It seems to somehow extract an double array to Octave
using the C++ function "box_more", that is not undocumented as well, and
only used from "java2mat".

>> N = 5;

>> dblArray = javaArray ("java.lang.Double", N)

dblArray =

<Java object: java.lang.Double[]>

>> for i = 1:N

  dblArray(i) = i;  % auto conversion

endfor

>> java2mat (dblArray)

ans =

<Java object: java.lang.Double[]>

>> dblArray(2)  % auto conversion

ans =  2

Maybe it is just outdated code, used before the auto conversion was
implemented...

Kai

[1] https://hg.savannah.gnu.org/hgweb/octave/rev/acf0addfc610#l17.1570



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html



reply via email to

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