Compute the polynomial with numpy.memmap.
()
| 103 | |
| 104 | |
| 105 | def compute_memmap(): |
| 106 | """Compute the polynomial with numpy.memmap.""" |
| 107 | # Reopen inputs in read-only mode |
| 108 | x = np.memmap(mpfnames[0], dtype=dtype, mode="r", shape=(N,)) |
| 109 | # Create the array output |
| 110 | r = np.memmap(mpfnames[1], dtype=dtype, mode="w+", shape=(N,)) |
| 111 | |
| 112 | # Do the computation by chunks and store in output |
| 113 | r[:] = eval(expr) # where is stored the result? |
| 114 | # r = eval(expr) # result is stored in-memory |
| 115 | |
| 116 | del x, r # close x and r memmap arrays |
| 117 | print_filesize(mpfnames) |
| 118 | |
| 119 | |
| 120 | def compute_tables(clib, clevel): |
nothing calls this directly
no test coverage detected