|
| 1 | +using PrecompileTools |
| 2 | + |
| 3 | +@setup_workload begin |
| 4 | + # Setup code - create minimal test data |
| 5 | + n = 20 # small state dimension |
| 6 | + m = 10 # small number of snapshots |
| 7 | + snapshot_matrix = Float64[sin(i * j / n) for i in 1:n, j in 1:m] |
| 8 | + snapshot_vov = [Float64[sin(i * j / n) for i in 1:n] for j in 1:m] |
| 9 | + |
| 10 | + # Create an orthonormal basis for deim_interpolation_indices |
| 11 | + Q, _ = qr(snapshot_matrix) |
| 12 | + deim_basis = Matrix(Q[:, 1:5]) |
| 13 | + |
| 14 | + @compile_workload begin |
| 15 | + # POD construction with matrix input |
| 16 | + pod_mat = POD(snapshot_matrix, 3) |
| 17 | + |
| 18 | + # POD construction with vector of vectors |
| 19 | + pod_vov = POD(snapshot_vov, 3) |
| 20 | + |
| 21 | + # reduce! with SVD algorithm |
| 22 | + reduce!(pod_mat, SVD()) |
| 23 | + |
| 24 | + # reduce! with TSVD algorithm |
| 25 | + pod_tsvd = POD(snapshot_matrix, 3) |
| 26 | + reduce!(pod_tsvd, TSVD()) |
| 27 | + |
| 28 | + # reduce! with RSVD algorithm |
| 29 | + pod_rsvd = POD(snapshot_matrix, 3) |
| 30 | + reduce!(pod_rsvd, RSVD()) |
| 31 | + |
| 32 | + # deim_interpolation_indices (core DEIM algorithm) |
| 33 | + deim_interpolation_indices(deim_basis) |
| 34 | + end |
| 35 | +end |
0 commit comments