Make java2mat an internal function only?

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

Make java2mat an internal function only?

Rik-4
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

Reply | Threaded
Open this post in threaded view
|

Re: Make java2mat an internal function only?

siko1056
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 | Threaded
Open this post in threaded view
|

Re: Make java2mat an internal function only?

Rik-4
In reply to this post by Rik-4
On 03/28/2018 05:28 AM, [hidden email] wrote:
Subject:
Re: Make java2mat an internal function only?
From:
siko1056 [hidden email]
Date:
03/27/2018 01:36 PM
To:
[hidden email]
List-Post:
[hidden email]
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0
References:
<MTAwMDAyOC5ub21hZA.1522106197@quikprotect>
In-Reply-To:
<MTAwMDAyOC5ub21hZA.1522106197@quikprotect>
Message-ID:
[hidden email]
Content-Type:
text/plain; charset=UTF-8
Message:
2

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".
Okay, I deprecated java2mat and made the C++ function available as __java2mat__.  I put a message in the help text for java2mat to file a bug report if they are using this function and can't find a way to do what they need with other Octave functions.  I doubt anyone is using this, but it is a big world and you never know.

--Rik