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 |
| 10 | |
| 11 | for f in [vectorized_func, vectorized_func2]: |
| 12 | print(f(1, 2, 3)) |
| 13 | print(f(np.array(1), np.array(2), 3)) |
| 14 | print(f(np.array([1, 3]), np.array([2, 4]), 3)) |
| 15 | print(f(np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3)) |
| 16 | print(np.array([[1, 3, 5], [7, 9, 11]])* np.array([[2, 4, 6], [8, 10, 12]])*3) |