()
| 15 | |
| 16 | @tick_execution_time |
| 17 | def handler(): |
| 18 | n = 4 # FIXME: stuck when n is large |
| 19 | # LINPACK benchmarks |
| 20 | ops = (2.0 * n) * n * n / 3.0 + (2.0 * n) * n |
| 21 | |
| 22 | # Create AxA array of random numbers -0.5 to 0.5 |
| 23 | A = random.random_sample((n, n)) - 0.5 |
| 24 | B = A.sum(axis=1) |
| 25 | |
| 26 | # Convert to matrices |
| 27 | A = matrix(A) |
| 28 | B = matrix(B.reshape((n, 1))) |
| 29 | |
| 30 | # Ax = B |
| 31 | x = linalg.solve(A, B) |
| 32 | |
| 33 | @mitosis_bench |
| 34 | def bench(): |