Engine prototype #13

Merged
glen merged 133 commits from engine-proto into main 2024-10-21 03:18:48 +00:00
5 changed files with 11 additions and 11 deletions
Showing only changes of commit 69a704d414 - Show all commits

View File

@ -213,8 +213,8 @@ elements = begin
1 1 -1 -1 0 1 1 -1 -1 0
1 -1 1 -1 0 1 -1 1 -1 0
1 -1 -1 1 0 1 -1 -1 1 0
-0.5 -0.5 -0.5 -0.5 -a-1 0.5 0.5 0.5 0.5 1+a
0.5 0.5 0.5 0.5 -a+1 0.5 0.5 0.5 0.5 1-a
] ]
end end

View File

@ -39,7 +39,7 @@ rand_on_shell(shells::Array{<:Number}) = rand_on_shell(Random.default_rng(), she
# === elements === # === elements ===
point(pos) = [pos; -1; 0.25 * dot(pos, pos)] point(pos) = [pos; 1; 0.25 * dot(pos, pos)]
plane(normal, offset) = [normal; 0; offset] plane(normal, offset) = [normal; 0; offset]
@ -47,7 +47,7 @@ function sphere(center, radius)
dist_sq = dot(center, center) dist_sq = dot(center, center)
[ [
center / radius; center / radius;
-0.5 / radius; 0.5 / radius;
0.5 * (dist_sq / radius - radius) 0.5 * (dist_sq / radius - radius)
] ]
end end
@ -55,12 +55,12 @@ end
# === Gram matrix realization === # === Gram matrix realization ===
# basis changes # basis changes
nullmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [1 -1; 1 1]//2] nullmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [-1 1; 1 1]//2]
unmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [1 1; -1 1]] unmix = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [-1 1; 1 1]]
# the Lorentz form # the Lorentz form
## [old] Q = diagm([1, 1, 1, 1, -1]) ## [old] Q = diagm([1, 1, 1, 1, -1])
Q = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [0 2; 2 0]] Q = [Matrix{Int64}(I, 3, 3) zeros(Int64, 3, 2); zeros(Int64, 2, 3) [0 -2; -2 0]]
# project a matrix onto the subspace of matrices whose entries vanish at the # project a matrix onto the subspace of matrices whose entries vanish at the
# given indices # given indices

View File

@ -43,8 +43,8 @@ guess = begin
1 1 -1 -1 0 1 1 -1 -1 0
1 -1 1 -1 0 1 -1 1 -1 0
1 -1 -1 1 0 1 -1 -1 1 0
-0.5 -0.5 -0.5 -0.5 -a-1 0.5 0.5 0.5 0.5 1+a
0.5 0.5 0.5 0.5 -a+1 0.5 0.5 0.5 0.5 1-a
] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5)), ] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5)),
Engine.rand_on_shell(fill(BigFloat(-1), 2)) Engine.rand_on_shell(fill(BigFloat(-1), 2))
) )

View File

@ -46,7 +46,7 @@ guess = hcat(
1 1 -1 -1 0 1 1 -1 -1 0
1 -1 1 -1 0 1 -1 1 -1 0
1 -1 -1 1 0 1 -1 -1 1 0
0 0 0 0 -1.5 0 0 0 0 1.5
1 1 1 1 -0.5 1 1 1 1 -0.5
] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5)), ] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 5)),
BigFloat[0, 0, 0, 0, 1] BigFloat[0, 0, 0, 0, 1]

View File

@ -63,7 +63,7 @@ guess = hcat(
1 1 -1 -1 0 0 1 1 -1 -1 0 0
1 -1 1 -1 0 0 1 -1 1 -1 0 0
1 -1 -1 1 0 0 1 -1 -1 1 0 0
0 0 0 0 -1.5 -0.5 0 0 0 0 1.5 0.5
1 1 1 1 -0.5 -1.5 1 1 1 1 -0.5 -1.5
] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 6)), ] + 0.2*Engine.rand_on_shell(fill(BigFloat(-1), 6)),
Engine.point([-1, -1, -1] + 0.3*randn(3)), Engine.point([-1, -1, -1] + 0.3*randn(3)),