bugGNU Octave - Bugs: bug #51798, concatenate Java objects into Java...

 
 

bug #51798: concatenate Java objects into Java arrays using array bracket syntax

Submitted by:  None
Submitted on:  Sun 20 Aug 2017 02:13:20 AM UTC  
 
Category: InterpreterSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 23 Aug 2017 06:58:21 AM UTC, comment #5:

If Octave is missing some option or feature, has always been missing it, then it is a new feature for Octave, even if it has been a built in part of Matlab for years.

The original post was about creating an array of Java objects with array bracket syntax, this would be done by adding support for horzcat and vertcat on Java objects.

Mike Miller <mtmiller>
Project Administrator
Tue 22 Aug 2017 09:08:18 PM UTC, comment #4:

@philip
Well, I think javaArray is a kind of workaround.
The problem is, that according to
https://www.mathworks.com/help/matlab/matlab_external/how-matlab-represents-java-array.html

matlab treats nested java-arrays as one-dimensional,
whereas octave does not... Bad.
So this workaround does not really work.

In octave:
octave:8> size(javaArray ("java.math.BigDecimal", 3,4))
ans =

3 4

size(...)

ans =
3 1

which is according to the documentation.

Ernst Reissner <ernstreissner>
Tue 22 Aug 2017 09:05:24 PM UTC, comment #3:

@mike I think one cannot just 'interprete' this as a feature request.
The question for me is whether matlab allows
[java_object java_object] or not.
If it does: this is a bug in octave; if not, it is a feature request. ... and if so, i can really drop it,
because i do not want to use octave features breaking matlab compatibility.

The problem is, that i do not have matlab at hand to really decide.

Ernst Reissner <ernstreissner>
Mon 21 Aug 2017 07:53:44 PM UTC, comment #2:

I think this could be interpreted as a feature request to add support for horzcat and vertcat with Java objects, so that something like

would automatically create Java array objects.

That is briefly touched on in https://www.mathworks.com/help/matlab/matlab_external/concatenate-java-arrays.html, so I assume that Matlab supports bracket array construction, cat, horzcat, and vertcat.

Mike Miller <mtmiller>
Project Administrator
Mon 21 Aug 2017 07:45:50 PM UTC, comment #1:

Have you looked at the javaArray function?

Just type:

help javaArray

in the Octave terminal.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 20 Aug 2017 02:13:20 AM UTC, original submission:

I suppose in matlab arrays of java-objects are allowed.
This is not true for octave

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

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 ernstreissner (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    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 project members can vote.

     

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

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Aug 2017 06:58:21 AM UTCmtmillerSeverity3 - Normal=>1 - Wish
      Item GroupNone=>Matlab Compatibility
      StatusNone=>Confirmed
      SummaryArray of java objects =>concatenate Java objects into Java arrays using array bracket syntax

    Back to the top


    Powered by Savane 3.1-cleanup1