bugGNU Octave - Bugs: bug #31536, demos for patch and isosurface fail

 
 

bug #31536: demos for patch and isosurface fail

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Wed 03 Nov 2010 02:39:32 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 04 Nov 2010 12:39:45 AM UTC, comment #5:

Fixed in this changeset from Ben (http://hg.savannah.gnu.org/hgweb/octave/rev/0a8e554494c9). Closing bug.

Rik <rik5>
Project Administrator
Wed 03 Nov 2010 09:26:03 PM UTC, comment #4:

Ok, I missed the significance of the second argument to the find function.. My objection is withdrawn

D.

David Bateman <dbateman>
Project Member
Wed 03 Nov 2010 09:07:00 PM UTC, comment #3:

Oh no, I hope I'm not abusing the poor defenseless comma-separated lists. :)

Actually, I might not understand the example well enough and I did look only briefly, but I think I avoid cs-lists altogether.

What looks potentially weak to me is that if there are no matches then find returns the empty matrix and there is the reliance on '[] + 1 == []'

Rik <rik5>
Project Administrator
Wed 03 Nov 2010 08:28:02 PM UTC, comment #2:

Opps, I was trying the address the code like

patch(..., "cdata", c1, ...., "cdata", c2, ....)

where cdata should be taken to be c2. I didn't treat the case where its not at all defined. I like Rik proposal, but it (and Ben's proposal for tht matter) abuses cs-lists to get the right functionally. Consider a code snippet like

c = {[1,2,3],[4,5,6]}
c{[2,1]}
cdata = c{[2,1]}

The line c{[2,1]} returns a two element cs-list, whereas cdata=c{[1,2]} only has a single argument on the LHS and so the second element of the cs-list is ignored. Its a bit of a nasty trick in my opinion to get the right behavior, but without making the code much more complex I don't see a way of getting the right behavior and avoiding indexing into null arrays. I'd say push a changeset based on Rik's suggestion

D.

David Bateman <dbateman>
Project Member
Wed 03 Nov 2010 07:31:15 PM UTC, comment #1:

Using 'hg bisect' I find the problem was introduced in this changeset:

changeset: 11160:131d56b6d9a3
user: David Bateman <dbateman@free.fr>
date: Thu Oct 28 01:56:14 2010 +0200
summary: Set cdata from facevertexcdata and visa versa for patch at all times

I've only briefly glanced at your patch. We should definitely avoid indexing into null arrays, which is what your patch does. However it does it for only 2 of the 4 occurrences of this code construct. Would it be better to do it for all 4? Also, the strcmp functions now work perfectly well on cell arrays so I think the code could eliminate the anonymous function call for legibility. Sample below:

Otherwise, the patch works for me.

Rik <rik5>
Project Administrator
Wed 03 Nov 2010 02:39:32 PM UTC, original submission:

The 3rd and 4th patch demos, and the isosurface demo, are failing.

This may be due to the recent changeset below (I'm just guessing).

http://hg.savannah.gnu.org/hgweb/octave/rev/c0a95a5c6d25

I've attached a chageset which fixes the problem, but as I'm not sure this is the proper solution I won't push it until someone takes a closer look.

Ben Abbott <bpabbott>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dbateman (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by rik5
  • -unavailable- added by bpabbott (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 04 Nov 2010 12:39:45 AM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 03 Nov 2010 07:31:15 PM UTCrik5Item GroupNone=>Incorrect Result
      StatusNone=>Confirmed
      Carbon-Copy-=>Added -unavailable-
    Wed 03 Nov 2010 02:39:32 PM UTCbpabbottAttached File-=>Added changeset.patch, #21913

    Back to the top


    Powered by Savane 3.1-cleanup1