From 7e67b71ab04959b0c34b8a3f966c7f2062da668e Mon Sep 17 00:00:00 2001 From: jmabille Date: Thu, 18 Feb 2016 01:35:42 +0100 Subject: [PATCH] Broadcasting tests added --- example/example10.py | 5 +++++ example/example10.ref | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/example/example10.py b/example/example10.py index 4b01f81f5..0d49fcaa7 100755 --- a/example/example10.py +++ b/example/example10.py @@ -22,3 +22,8 @@ for f in [vectorized_func, vectorized_func2]: print(f(np.array([1, 3]), np.array([2, 4]), 3)) print(f(np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3)) print(np.array([[1, 3, 5], [7, 9, 11]])* np.array([[2, 4, 6], [8, 10, 12]])*3) + print(f(np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2)) + print(np.array([[1, 2, 3], [4, 5, 6]])* np.array([2, 3, 4])* 2) + print(f(np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2)) + print(np.array([[1, 2, 3], [4, 5, 6]])* np.array([[2], [3]])* 2) + diff --git a/example/example10.ref b/example/example10.ref index 517bb9084..9d48d7cfd 100644 --- a/example/example10.ref +++ b/example/example10.ref @@ -16,6 +16,26 @@ my_func(x:int=11, y:float=12, z:float=3) [ 168. 270. 396.]] [[ 6 36 90] [168 270 396]] +my_func(x:int=1, y:float=2, z:float=2) +my_func(x:int=2, y:float=3, z:float=2) +my_func(x:int=3, y:float=4, z:float=2) +my_func(x:int=4, y:float=2, z:float=2) +my_func(x:int=5, y:float=3, z:float=2) +my_func(x:int=6, y:float=4, z:float=2) +[[ 4. 12. 24.] + [ 16. 30. 48.]] +[[ 4 12 24] + [16 30 48]] +my_func(x:int=1, y:float=2, z:float=2) +my_func(x:int=2, y:float=2, z:float=2) +my_func(x:int=3, y:float=2, z:float=2) +my_func(x:int=4, y:float=3, z:float=2) +my_func(x:int=5, y:float=3, z:float=2) +my_func(x:int=6, y:float=3, z:float=2) +[[ 4. 8. 12.] + [ 24. 30. 36.]] +[[ 4 8 12] + [24 30 36]] my_func(x:int=1, y:float=2, z:float=3) 6.0 my_func(x:int=1, y:float=2, z:float=3) @@ -33,3 +53,23 @@ my_func(x:int=11, y:float=12, z:float=3) [ 168. 270. 396.]] [[ 6 36 90] [168 270 396]] +my_func(x:int=1, y:float=2, z:float=2) +my_func(x:int=2, y:float=3, z:float=2) +my_func(x:int=3, y:float=4, z:float=2) +my_func(x:int=4, y:float=2, z:float=2) +my_func(x:int=5, y:float=3, z:float=2) +my_func(x:int=6, y:float=4, z:float=2) +[[ 4. 12. 24.] + [ 16. 30. 48.]] +[[ 4 12 24] + [16 30 48]] +my_func(x:int=1, y:float=2, z:float=2) +my_func(x:int=2, y:float=2, z:float=2) +my_func(x:int=3, y:float=2, z:float=2) +my_func(x:int=4, y:float=3, z:float=2) +my_func(x:int=5, y:float=3, z:float=2) +my_func(x:int=6, y:float=3, z:float=2) +[[ 4. 8. 12.] + [ 24. 30. 36.]] +[[ 4 8 12] + [24 30 36]]