Engine prototype #13
@ -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 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
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user