Skip to content

Commit e2c82fa

Browse files
committed
Add informations about TriLQR allocations
1 parent fec6b94 commit e2c82fa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_alloc.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ actual_usymqr_bytes = @allocated usymqr(Ao, b, c)
245245
@test actual_usymqr_bytes 1.1 * expected_usymqr_bytes
246246

247247
# with (Ap, Aᵀq) preallocated, TRILQR needs:
248-
# - 9 n-vectors: uₖ₋₁, uₖ, vₖ₋₁, vₖ, x, t, d̅, wₖ₋₁, wₖ
249-
storage_trilqr(n) = 9 * n
250-
storage_trilqr_bytes(n) = 8 * storage_trilqr(n)
248+
# - 5 m-vectors: vₖ₋₁, vₖ, t, wₖ₋₁, wₖ
249+
# - 4 n-vectors: uₖ₋₁, uₖ, x, d̅
250+
storage_trilqr(n, m) = 5 * m + 4 * n
251+
storage_trilqr_bytes(n, m) = 8 * storage_trilqr(n, m)
251252

252-
expected_trilqr_bytes = storage_trilqr_bytes(n)
253+
expected_trilqr_bytes = storage_trilqr_bytes(n, n)
253254
trilqr(A, b, b) # warmup
254255
actual_trilqr_bytes = @allocated trilqr(A, b, b)
255256
@test actual_trilqr_bytes 1.1 * expected_trilqr_bytes

0 commit comments

Comments
 (0)