Skip to content

Commit a82c58c

Browse files
committed
fixed CGA non-metric complement bug
1 parent 78f6aea commit a82c58c

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DirectSum"
22
uuid = "22fd7b30-a8c0-5bf2-aabe-97783860d07c"
33
authors = ["Michael Reed"]
4-
version = "0.5.8"
4+
version = "0.5.9"
55

66
[deps]
77
ComputedFieldTypes = "459fdd68-db75-56b8-8c15-d717a790f88e"

src/operations.jl

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -328,35 +328,31 @@ for side ∈ (:left,:right)
328328
pn = Symbol(p,:null)
329329
pnp = Symbol(pn,:pre)
330330
@eval begin
331-
@pure $p(V::Bits,B::Bits,N::Int) = $p(0,sum(indices(B,N)),count_ones(B),N)
332-
@pure $pg(V::Bits,B::Bits,N::Int) = $pg(count_ones(V&B),sum(indices(B,N)),count_ones(B),N)
333-
@inline $pn(V,B,v) = v
334-
@inline function $pn(V::Signature,B,v)
335-
hi,ho = hasinf(V),hasorigin(V)
336-
if hi && ho && count_ones(B&UInt(3)) ==1
331+
@pure $p(V::UInt,B::UInt,N::Int) = $p(0,sum(indices(B,N)),count_ones(B),N)
332+
@pure $pg(V::UInt,B::UInt,N::Int) = $pg(count_ones(V&B),sum(indices(B,N)),count_ones(B),N)
333+
@inline function $pn(V,B,v)
334+
if hasconformal(V) && count_ones(B&UInt(3)) == 1
337335
isodd(B) ? (2v) : (v/2)
338336
else
339337
v
340338
end
341339
end
342-
@inline $pnp(V,B,v) = v
343-
@inline function $pnp(V::Signature,B,v)
344-
hi,ho = hasinf(V),hasorigin(V)
345-
if hi && ho && count_ones(B&UInt(3)) ==1
340+
@inline function $pnp(V,B,v)
341+
if hasconformal(V) && count_ones(B&UInt(3)) == 1
346342
isodd(B) ? Expr(:call,:*,2,v) : Expr(:call,:/,v,2)
347343
else
348344
v
349345
end
350346
end
351-
@pure function $p(V::Signature,B,G=count_ones(B))
347+
#=@pure function $p(V::Signature,B,G=count_ones(B))
352348
b = B&(UInt(1)<<(ndims(V)-diffvars(V))-1)
353349
$p(0,sum(indices(b,ndims(V))),count_ones(b),ndims(V)-diffvars(V))
354350
end
355351
@pure function $pg(V::Signature,B,G=count_ones(B))
356352
o = hasorigin(V) && hasinf(V) && (iszero(B&UInt(1))&(!iszero(B&UInt(2))))
357353
b = B&(UInt(1)<<(ndims(V)-diffvars(V))-1)
358354
$pg(count_ones(metric(V)&b),sum(indices(b,ndims(V))),count_ones(b),ndims(V)-diffvars(V))⊻o
359-
end
355+
end=#
360356
end
361357
for Q (:DiagonalForm,:SubManifold)
362358
@eval begin
@@ -394,9 +390,9 @@ const complementright = !
394390
export complementleft, complementright, , complementlefthodge, complementrighthodge
395391

396392
for side (:left,:right)
397-
c,p = Symbol(:complement,side),Symbol(:parity,side)
398-
h,pg,pn = Symbol(c,:hodge),Symbol(p,:hodge),Symbol(p,:null)
399-
for (c,p) ((c,p),(h,pg))
393+
s,p = Symbol(:complement,side),Symbol(:parity,side)
394+
h,pg,pn = Symbol(s,:hodge),Symbol(p,:hodge),Symbol(p,:null)
395+
for (c,p) ((s,p),(h,pg))
400396
@eval begin
401397
@pure function $c(b::SubManifold{V,G,B}) where {V,G,B}
402398
d = getbasis(V,complement(ndims(V),B,diffvars(V),$(ch ? 0 : :(hasinf(V)+hasorigin(V)))))

0 commit comments

Comments
 (0)