taskGNU Octave - Tasks: task #12601, Octave/Matlab differences...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

task #12601: Octave/Matlab differences regarding Java

Submitted by:  Rik <rik5>
Submitted on:  Sat 04 May 2013 10:35:40 PM UTC  
 
Should Start On: Sat 04 May 2013 07:00:00 AM UTCShould be Finished on: Sat 04 May 2013 07:00:00 AM UTC
Category: WishPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenFixed Release: None
Planned Release: None

Thu 01 May 2014 10:26:14 PM UTC, comment #3:

Another useful thing to add would be load/save support for Java objects. This would require providing implementations for the virtual functions save_binary and load_binary in ov-java.cc.

A very reasonable approach would be to call the Serialize method of the java object itself and then just store the data.

I just tried this and it worked out fine:

The first time I read the object it just returned a double of 3.1416. I think this is probably caused by Octave auto-converting the result from a Java object to a double. The second time I called the Java constructor with the results of the readObject call and it returned a true Java object with the full value of pi.

Rik <rik5>
Project Administrator
Thu 01 May 2014 09:36:12 PM UTC, comment #2:

javachk.m has been submitted in patch #8438

Philip Nienhuis <philipnienhuis>
Project Member
Sat 19 Apr 2014 07:54:53 PM UTC, comment #1:

As to:
/SUPPORT for method(obj) syntax.
Matlab supports either obj.method() or method(obj) without use of javaMethod call./

The obj.method() variant has worked since at least OF Java package 1.2.x, method(obj) to some extent. The OF io package is pervaded by these call types. E.g., in <io>/inst/private/__UNO_oct2spsh__.m:

where only wsh, sheets and sh_names are Octave types.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 04 May 2013 10:35:40 PM UTC, original submission:

This is a list of incompatibilities between the Java implementation in Matlab and the current implementation in the development version of core Octave (not the Java package from Octave Forge). This is a laundry list which I haven't prioritized.

im2java() function is missing

javaaddpath (-end) functionality
Requires 'clear -java' to clear out any old objects

javaclasspath (path) functionality.
path is string or cell array of strings
path is converted to absolute from relative.
Requires 'clear -java' to clear out any old objects
javaclasspath (path1, path2) functionality.

java/dlgtest.m should be removed and tests put in %!demo or %!test blocks
for each dialog class (warning, error, etc.)

Need to figure out how to call
x = java.lang.Double (4.2) directly
This would probable be a parser change and might have to wait until the classdef branch is merged to default.

box C++ routine needs to support JavaArrays such as listdlg returning []int.

Is linear indexing of Java Array allowed by Matlab?
When indexing a Java Array is a vector of the same dimension as the original matrix returned?
x = javaArray ('java.lang.Boolean', [2 3])
y = x(1)
size (y)
Should size be 1x3 as in original array, or does it not matter and 3x1 (current value) is fine.

unbox routine, does it correctly handle signed versus unsigned?

resize() method for java_object arrays needed in ov-java.cc.

disp() for primitive objects should be better. For example, Matlab is able to display a javaArray when the type is of type java.lang.Double.

SUPPPORT for method(obj) syntax.
Matlab supports either obj.method() or method(obj) without use of javaMethod call.

clear needs a '-java' option
clear needs a '-mex' option

javachk.m needs implementation
http://www.mathworks.com/help/matlab/ref/javachk.html

The following routines need to be overloaded in ov-java.cc.
double (jobj) needs to be overloaded
char (job) needs to be overloaded for arrays of strings/stringbuffers.
It currently returns a cellstr which is awfully close to what is required.
struct (job) needs to be overloaded
cell (javaArray) needs to be overloaded

exist needs to be overloaded to return 8 for Java class

which expanded to cover Java methods

Rik <rik5>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Submitted the item)
  • -unavailable- added by rik5
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 04 May 2013 10:35:40 PM UTCrik5Carbon-Copy-=>Added jwe

    Back to the top


    Powered by Savane 3.1-cleanup