[Top][All Lists]

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

[Octave-bug-tracker] [bug #54567] median(uint8) gives bad results

From: Rik
Subject: [Octave-bug-tracker] [bug #54567] median(uint8) gives bad results
Date: Mon, 27 Aug 2018 19:44:43 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #16, bug #54567 (project octave):

I implemented many of the ideas in the various comments in to a patch which is
attached.  The case for int64 is not ideal since it warns when there is
potential loss of accuracy, but should just calculate an accurate result.  The
code is tricky enough that maybe Dan's suggestion of using mean() would be
better.  First, fix mean() to handle every single case and then let median
call mean.

One possibility is to use the algorithm that Dan suggested in comment #11. 
One could use permute ahead of the algorithm in order to guarantee that the
correct dimension was lined up the way the algorithm expects.  After
calculating the median one would then use ipermute to reverse the change.

(file #44882)

Additional Item Attachment:

File name: 54567.cset                     Size:2 KB


Reply to this item at:


  Message sent via Savannah

reply via email to

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