From 2b6c4f4720212da7449e0b03f1b6566cebef6028 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Wed, 26 Jun 2024 11:28:47 -0700 Subject: [PATCH] Avoid naming conflict with identity transformation --- engine-proto/gram-test/descent-test.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/engine-proto/gram-test/descent-test.jl b/engine-proto/gram-test/descent-test.jl index ecf0b3e..d895764 100644 --- a/engine-proto/gram-test/descent-test.jl +++ b/engine-proto/gram-test/descent-test.jl @@ -10,10 +10,10 @@ using PolynomialRoots # the difference between the matrices `target` and `attempt`, projected onto the # subspace of matrices whose entries vanish at each empty index of `target` function proj_diff(target, attempt) - I, J, values = findnz(target) + J, K, values = findnz(target) result = zeros(size(target)...) - for (i, j, val) in zip(I, J, values) - result[i, j] = val - attempt[i, j] + for (j, k, val) in zip(J, K, values) + result[j, k] = val - attempt[j, k] end result end @@ -26,19 +26,19 @@ Q = diagm([-1, 1, 1, 1, 1]) # initialize the partial gram matrix for an arrangement of seven spheres in # which spheres 1 through 5 are mutually tangent, and spheres 3 through 7 are # also mutually tangent -I = Int64[] J = Int64[] +K = Int64[] values = BigFloat[] -for i in 1:7 - for j in 1:7 - if (i <= 5 && j <= 5) || (i >= 3 && j >= 3) - push!(I, i) +for j in 1:7 + for k in 1:7 + if (j <= 5 && k <= 5) || (j >= 3 && k >= 3) push!(J, j) - push!(values, i == j ? 1 : -1) + push!(K, k) + push!(values, j == k ? 1 : -1) end end end -gram = sparse(I, J, values) +gram = sparse(J, K, values) # set the independent variable #