bugGNU Octave - Bugs: bug #38013, convhulln returns incorrect...

 
 

bug #38013: convhulln returns incorrect results in some cases

Submitter:  None
Submitted:  Wed 02 Jan 2013 09:21:20 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 03 Jan 2013 04:21:41 PM UTC, comment #2: 

Thanks for finding this solution.  I patched on stable and merged with the default branch.

John W. Eaton <jwe>
Group administrator
Thu 03 Jan 2013 03:52:29 PM UTC, comment #1: 

According to following code in libqhull (io.c / qh_printafacet), the setting of facet->simplicial doesn't matters in 2D case.


  case qh_PRINTincidences:
  case qh_PRINToff:
  case qh_PRINTtriangles:
    if (qh hull_dim == 3 && format != qh_PRINTtriangles)
      qh_printfacet3vertex(fp, facet, format);
    else if (facet->simplicial || qh hull_dim == 2 || format == qh_PRINToff)
      qh_printfacetNvertex_simplicial(fp, facet, format);
    else
      qh_printfacetNvertex_nonsimplicial(fp, facet, qh printoutvar++, format);
    break;



So I prepared a little patch. Hope it doesn't break others cases.

Anonymous
Wed 02 Jan 2013 09:21:20 AM UTC, original submission:  

convhulln returns incorrect results in following example:


a=[0 0; 1 1; 1 0; 1 2];
h = convhulln (a);
assert (size (h), [3 2]);


It returns a 3x3 matrix instead of 3x2.

qhull commandline returns correct result:


echo "
2
4
0 0
1 1
1 0
1 2
" | qhull Qt i


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27193:  qhull_2d.patch added by None (693B - text/x-patch - convhulln patch for 2D case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-03 jwe StatusNone Fixed
        Open/ClosedOpen Closed
    2013-01-03 None Attached File- Added qhull_2d.patch, #27193
    2013-01-02 jordigh Summaryconvhulln returns incorrect results in same cases convhulln returns incorrect results in some cases

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code