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