Skip to content

Commit b4c79c0

Browse files
committed
correct the BimoduleSector inner constructor
1 parent 5bd32a2 commit b4c79c0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/bimodulesector.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1+
const ImplementedBimoduleSectors = [:A4]
2+
13
struct BimoduleSector{Name} <: Sector
24
i::Int
35
j::Int
46
label::Int
5-
function BimoduleSector{:A4}(i::Int, j::Int, label::Int)
6-
i <= size(BimoduleSector{:A4}) && j <= size(BimoduleSector{:A4}) ||
7-
throw(DomainError("object outside the matrix A4"))
8-
return label <= _numlabels(BimoduleSector{:A4}, i, j) ? new{:A4}(i, j, label) :
9-
throw(DomainError("label outside category A4($i, $j)"))
7+
function BimoduleSector{Name}(i::Int, j::Int, label::Int) where {Name}
8+
Name ImplementedBimoduleSectors ||
9+
throw(ArgumentError("BimoduleSector $Name not implemented"))
10+
i <= size(BimoduleSector{Name}) && j <= size(BimoduleSector{Name}) ||
11+
throw(DomainError("object outside the matrix $Name"))
12+
return label <= _numlabels(BimoduleSector{Name}, i, j) ? new{Name}(i, j, label) :
13+
throw(DomainError("label outside category $Name($i, $j)"))
1014
end
1115
end
16+
1217
BimoduleSector{Name}(data::NTuple{3,Int}) where {Name} = BimoduleSector{Name}(data...)
1318
const A4Object = BimoduleSector{:A4}
1419

0 commit comments

Comments
 (0)