Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix median computation #7

Closed
wants to merge 1 commit into from
Closed

Fix median computation #7

wants to merge 1 commit into from

Conversation

spfetsch
Copy link

Existing median implementation assumed a given list of samples was sorted, but
the callers did not sort. Added a sort utility function and sorted the samples
before each use of the median function.

Existing median implementation assumed a given list of samples was sorted, but
the callers did not sort. Added a sort utility function and sorted the samples
before each use of the median function.
@kamrik
Copy link
Contributor

kamrik commented May 11, 2016

Oops, that's an important bug. Thanks!
I'll go with copy + sort inside the median function rather than sorting each time before. Speed is not very important here since we never use the median on large arrays. But printing the lists in the original order into the log is important because one might want to check the numbers against earlier verbose sections of the log per event.

@kamrik kamrik closed this in 517d2e1 May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants