Wenzel Jakob | 5708221 | 2015-09-04 23:42:12 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | from __future__ import print_function |
Wenzel Jakob | d4258ba | 2015-07-26 16:33:49 +0200 | [diff] [blame] | 3 | import sys |
| 4 | sys.path.append('.') |
| 5 | |
| 6 | import example |
| 7 | import numpy as np |
| 8 | |
| 9 | from example import vectorized_func |
| 10 | from example import vectorized_func2 |
Wenzel Jakob | 43398a8 | 2015-07-28 16:12:20 +0200 | [diff] [blame] | 11 | from example import vectorized_func3 |
| 12 | |
| 13 | print(vectorized_func3(np.array(3+7j))) |
Wenzel Jakob | d4258ba | 2015-07-26 16:33:49 +0200 | [diff] [blame] | 14 | |
| 15 | for f in [vectorized_func, vectorized_func2]: |
| 16 | print(f(1, 2, 3)) |
| 17 | print(f(np.array(1), np.array(2), 3)) |
| 18 | print(f(np.array([1, 3]), np.array([2, 4]), 3)) |
| 19 | print(f(np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3)) |
| 20 | print(np.array([[1, 3, 5], [7, 9, 11]])* np.array([[2, 4, 6], [8, 10, 12]])*3) |