-
Notifications
You must be signed in to change notification settings - Fork 112
/
methods.jl
48 lines (40 loc) · 1.06 KB
/
methods.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@doc raw"""
contains(tvs::ToricVanishingSet, l::ToricLineBundle)
Checks if the toric line bundle `l` is contained in the toric vanishing set `tvs`.
# Examples
```jldoctest
julia> dP1 = del_pezzo_surface(NormalToricVariety, 1)
Normal toric variety
julia> l = toric_line_bundle(dP1, [3, 2])
Toric line bundle on a normal toric variety
julia> all_cohomologies(l)
3-element Vector{ZZRingElem}:
7
0
0
julia> vs = vanishing_sets(dP1)
3-element Vector{ToricVanishingSet}:
Toric vanishing set for cohomology indices [0]
Toric vanishing set for cohomology indices [1]
Toric vanishing set for cohomology indices [2]
julia> contains(vs[1], l)
false
julia> contains(vs[2], l)
true
julia> contains(vs[3], l)
true
```
"""
function contains(tvs::ToricVanishingSet, l::ToricLineBundle)
if toric_variety(l) !== toric_variety(tvs)
return false
end
class = divisor_class(toric_divisor_class(l)).coeff
class = [class[1, i] for i in 1:ncols(class)]
for p in polyhedra(tvs)
if class in p
return false
end
end
return true
end