[arrayfire] 105/408: BUGFIX: median of all elements is now fixed
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:11:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.
commit 5b49f07e382651aceccd18daa6d895b3a111bfd0
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Sat Jul 4 18:21:29 2015 -0400
BUGFIX: median of all elements is now fixed
---
src/api/c/median.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/api/c/median.cpp b/src/api/c/median.cpp
index f53b180..e91425d 100644
--- a/src/api/c/median.cpp
+++ b/src/api/c/median.cpp
@@ -26,14 +26,15 @@ using af::dim4;
template<typename T>
static double median(const af_array& in)
{
- const Array<T> input = getArray<T>(in);
- dim_t nElems = input.elements();
+ dim_t nElems = getInfo(in).elements();
double mid = (nElems + 1) / 2;
af_seq mdSpan[1]= {af_make_seq(mid-1, mid, 1)};
dim4 dims(nElems, 1, 1, 1);
af_array temp = 0;
AF_CHECK(af_moddims(&temp, in, 1, dims.get()));
+ const Array<T> input = getArray<T>(temp);
+
Array<T> sortedArr = sort<T, true>(input, 0);
double result;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list