Skip to content

Commit bf5ad18

Browse files
committed
resolved chakravala/Grassmann.jl#60 base case
1 parent 3d5dfc4 commit bf5ad18

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ environment:
77
- julia_version: 1.4
88
- julia_version: 1.5
99
- julia_version: 1.6
10+
- julia_version: 1.7
1011
- julia_version: nightly
1112

1213
platform:

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ julia:
1212
- 1.4
1313
- 1.5
1414
- 1.6
15+
- 1.7
1516
- nightly
1617
matrix:
1718
allow_failures:

src/basis.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ end
170170

171171
Base.collect(s::M) where M<:Manifold = Basis{s}()
172172
function Basis{s}() where s
173-
sym,n = labels(s),typeof(s)<:Int ? s : mdims(s)
174-
@inbounds Basis{s}(generate(s),Dict{Symbol,Int}([sym[i]=>i for i 1:1<<n]))
173+
sym = labels(s)
174+
@inbounds Basis{s}(generate(s),Dict{Symbol,Int}([sym[i]=>i for i 1:1<<mdims(s)]))
175175
end
176176

177177
@pure Basis(s::Manifold) = getalgebra(s)
@@ -208,15 +208,16 @@ end
208208
end
209209

210210
# Allocating thread-safe $(2^n)×SubManifold{G,V}
211-
const Λ0 = Λ{V0}(Values{1,SubManifold{V0,0,UInt(0)}}(SubManifold{V0,0}(UInt(0))),Dict(:e=>1))
211+
const Λ0 = Λ{SubManifold(0)}()
212+
const Λ0S = Λ{ℝ0}()
212213

213214
for V (:Int,:Signature,:DiagonalForm)
214215
@eval const $(Symbol(:algebra_cache_,V)) = Vector{Vector{Dict{UInt,Vector{Dict{UInt,Λ}}}}}[]
215216
@eval @pure getalgebra(V::$V) = getalgebra(SubManifold(V))
216217
end
217218
@eval begin
218219
@pure function getalgebra(n::Int,m::Int,s,S::UInt,vs::Type,f::Int=0,d::Int=0)
219-
n==0 && (return Λ0)
220+
n==0 && (return vs<:Int ? Λ0 : Λ0S)
220221
n > sparse_limit && (return $(Symbol(:getextended))(n,m,s,S,vs,f,d))
221222
n > algebra_limit && (return $(Symbol(:getsparse))(n,m,s,S,vs,f,d))
222223
f1,d1,m1 = f+1,d+1,m+1

src/generic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ for T ∈ (:T,:(Type{T}))
5050
@eval begin
5151
@pure valuetype(::$T) where T<:SubManifold = Int
5252
@pure valuetype(::$T) where T<:Simplex{V,G,B,𝕂} where {V,G,B} where 𝕂 = 𝕂
53-
@pure isbasis(::$T) where T<:SubManifold{V} where V = typeof(V)<:SubManifold
53+
@pure isbasis(::$T) where T<:SubManifold{V} where V = issubmanifold(V)
5454
@pure isbasis(::$T) where T<:TensorBundle = false
5555
@pure isbasis(::$T) where T<:Simplex = false
5656
@pure basis(m::$T) where T<:SubManifold = isbasis(m) ? m : SubManifold(m)

0 commit comments

Comments
 (0)