octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #48790] javaArray('double',1)


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #48790] javaArray('double',1)
Date: Fri, 19 Aug 2016 01:41:19 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0

Follow-up Comment #3, bug #48790 (project octave):

According to
https://www.mathworks.com/matlabcentral/answers/96483-how-can-i-pass-a-ragged-array-of-java-primitive-types-to-a-java-function-from-matlab

> The ability to create Java primitive types is not available in MATLAB.

And according to https://www.mathworks.com/help/matlab/ref/javaarray.html

> To create an array of primitive Java types, create an array of the
equivalent MATLAB type, shown in the Conversion of MATLAB Types to Java Types
table. See Conversion of MATLAB Argument Data.

So there is no Matlab compatibility issue here, Matlab simply dodges the
issue. I see nothing wrong with what Octave does with this. The normal return
value conversion rules should apply.

If there is any bug here, I think it's this


>> arr = javaArray (__java_get__ ("java.lang.Double", "TYPE"), [3 3])
arr =

<Java object: double[][]>

>> size (arr)
ans =

   3   3



According to
https://www.mathworks.com/help/matlab/matlab_external/handling-data-returned-from-a-java-method.html,
any rectangular array of a primitive type returned by any function should be
converted to the corresponding Octave type. So I would think arr above should
be converted to an Octave double matrix of size [3, 3].

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48790>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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