[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #37270] Voronoi function fails with duplicate
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #37270] Voronoi function fails with duplicate input points |
Date: |
Tue, 04 Sep 2012 20:52:39 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25 |
URL:
<http://savannah.gnu.org/bugs/?37270>
Summary: Voronoi function fails with duplicate input points
Project: GNU Octave
Submitted by: None
Submitted on: Tue 04 Sep 2012 08:52:38 PM UTC
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Nicholas Musolino
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.2
Operating System: Mac OS
_______________________________________________________
Details:
The voronoi(...) function fails when an two points in the input share (x,y)
coordinates.
x = rand(20,1); y = rand(size(x));
voronoi(x,y); ## works as expected
## Add duplicate points.
x(end+1)= x(end); y(end+1) = y(end);
voronoi(x,y); ## fails with message below.
The error message is:
subscript indices must be either positive integers or logicals
error: evaluating argument list element number 1
error: called from:
error: /opt/share/octave/3.6.2/m/geometry/voronoi.m at line 140, column 9
The code in voronoi.m is:
[p, c, infi] = __voronoi__ ("voronoi",
[[x(:) ; xbox(:)], [y(:); ybox(:)]],
opts{:});
idx = find (! infi);
ll = length (idx);
c = c(idx).';
k = sum (cellfun ("length", c));
edges = cell2mat (cellfun (@(x) [x ; [x(end), x(1:end-1)]], c,
"uniformoutput", false)); # Line 140
I'm not familiar enough with the code to suggest a fix.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?37270>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #37270] Voronoi function fails with duplicate input points,
anonymous <=