[python-arrayfire] 79/250: BUGFFIX: in join for num inputs > 2
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:33 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.
commit 8567b961fbd382f278712bbbc57f1844c0d5eaa4
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Mon Aug 31 06:57:37 2015 -0400
BUGFFIX: in join for num inputs > 2
- Added relevant tests
---
arrayfire/data.py | 9 +++++----
tests/simple_data.py | 4 ++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arrayfire/data.py b/arrayfire/data.py
index ad7bb6e..be04bc4 100644
--- a/arrayfire/data.py
+++ b/arrayfire/data.py
@@ -118,16 +118,17 @@ def join(dim, first, second, third=None, fourth=None):
if (third is None and fourth is None):
safe_call(clib.af_join(ct.pointer(out.arr), dim, first.arr, second.arr))
else:
- ct.c_array_vec = dim4(first, second, 0, 0)
+ c_void_p_4 = ct.c_void_p * 4
+ c_array_vec = c_void_p_4(first.arr, second.arr, 0, 0)
num = 2
if third is not None:
- ct.c_array_vec[num] = third.arr
+ c_array_vec[num] = third.arr
num+=1
if fourth is not None:
- ct.c_array_vec[num] = fourth.arr
+ c_array_vec[num] = fourth.arr
num+=1
- safe_call(clib.af_join_many(ct.pointer(out.arr), dim, num, ct.pointer(ct.c_array_vec)))
+ safe_call(clib.af_join_many(ct.pointer(out.arr), dim, num, ct.pointer(c_array_vec)))
return out
diff --git a/tests/simple_data.py b/tests/simple_data.py
index c5c0ff8..9bc407f 100755
--- a/tests/simple_data.py
+++ b/tests/simple_data.py
@@ -43,8 +43,12 @@ af.display(c)
af.display(af.diag(b, extract = False))
af.display(af.diag(c, 1, extract = False))
+af.display(af.join(0, a, a))
+af.display(af.join(1, a, a, a))
+
af.display(af.tile(a, 2, 2))
+
af.display(af.reorder(a, 1, 0))
af.display(af.shift(a, -1, 1))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git
More information about the debian-science-commits
mailing list