@@ -12,48 +12,48 @@ Multiplicative table, stored explicitly as an AbstractMatrix{I}.
1212 mt(-i, j) == b[star(b[i])*b[j]]
1313 ```
1414"""
15- struct MTable{T,I<: Integer ,B <: AbstractBasis {T,I},Ms ,M<: AbstractMatrix } < :
15+ struct MTable{T,I<: Integer ,Ms <: MultiplicativeStructure {T,I} ,M<: AbstractMatrix } < :
1616 MultiplicativeStructure{T,I}
17- basis:: B
1817 mstr:: Ms
1918 table:: M
2019 lock:: Base.Threads.SpinLock
2120end
2221
2322function MTable (
24- basis:: AbstractBasis{T,I} ,
25- mstr:: MultiplicativeStructure ,
23+ mstr:: MultiplicativeStructure{T,I} ,
2624 dims:: NTuple{2,I} ,
2725) where {T,I<: Integer }
28- Base. require_one_based_indexing (basis)
26+ bas = basis (mstr)
27+ Base. require_one_based_indexing (bas)
2928
30- if Base. haslength (basis )
31- @assert length (basis ) ≥ first (dims)
32- @assert length (basis ) ≥ last (dims)
29+ if Base. haslength (bas )
30+ @assert length (bas ) ≥ first (dims)
31+ @assert length (bas ) ≥ last (dims)
3332 end
3433
35- C = typeof (mstr (first (basis ), first (basis )))
34+ C = typeof (mstr (first (bas ), first (bas )))
3635 table = Matrix {C} (undef, dims)
3736 # this is to avoid situation with allocated garbage in table
3837 # we want table to consist of #undefs as "sentiel values"
3938 @assert ! isbitstype (C) || dims == (0 , 0 )
4039
41- return MTable (basis, mstr, table, Base. Threads. SpinLock ())
40+ return MTable (mstr, table, Base. Threads. SpinLock ())
4241end
4342
4443function MTable (
4544 basis:: AbstractBasis{T,I} ,
4645 dims:: NTuple{2,I} ,
4746) where {T,I<: Integer }
48- return MTable (basis, DiracMStructure (basis, * ), dims)
47+ return MTable (DiracMStructure (basis, * ), dims)
4948end
5049
5150Base. @propagate_inbounds function __absindex (mt:: MTable , i:: Integer )
5251 return ifelse (i > 0 , i, oftype (i, star (mt, abs (i))))
5352end
5453
5554Base. size (mt:: MTable , i:: Vararg ) = size (mt. table, i... )
56- Base. getindex (mt:: MTable , i:: Integer ) = mt. basis[__absindex (mt, i)]
55+ Base. getindex (mt:: MTable , i:: Integer ) = mt. mstr[__absindex (mt, i)]
56+ basis (mstr:: MTable ) = basis (mstr. mstr)
5757
5858function __iscomputed (mt:: MTable , i, j)
5959 return isassigned (mt. table, i, j)
0 commit comments