octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54622] test importdata fails in dev octave wi


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #54622] test importdata fails in dev octave with windows
Date: Thu, 6 Sep 2018 14:44:42 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #12, bug #54622 (project octave):

@Philip, I see the code.  Without looking at it too much, my guess is that
these are two different issues.  Consider reposting the finding at the
histcounts report:

https://savannah.gnu.org/patch/?8801

The thing is, that fail involves random data and it could be that something
like the following floor() function isn't quite right with regards to
numerical approach:


+  if (equidistant)
+    bin = 1 + floor ((x - min_val) / binwidths(1)); % compute bin indices in
O(Nx)
+  else
+    bin = lookup (edges, x); % compute bin indices in O(Nx*log(nbins)), all x
< edges(1) will be zero
+  endif
+  bin(x > edges(end)) = 0;                % set too large entries to zero
+  idx = bin(bin != 0);                    % remove all out-of-scope entries
+  n = accumarray (idx, 1, [nbins+1, 1])'; % cout number of identical indices
to get the histogram, in O(Nx)
+  n = [n(1:end-2), n(end-1)+n(end)];      % last bin should also contain
right edge
+  % xx = edges(1:end-1) + binwidths/2;    % place bin centers half-way
between the 'edges'


That is, when the floating point calculation of the bins and normalization is
done, it could be that the max_val (or min value) goes epsilon beyond the edge
border.  Don't know, as I didn't investigate much.  Could try simply running
the histcounts BIST a hundred times with nothing before or after and see if it
fails somewhere with a different random set of data.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54622>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]