-
Notifications
You must be signed in to change notification settings - Fork 130
/
variety_supertype.jl
258 lines (189 loc) · 6.5 KB
/
variety_supertype.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
################################################################################
#
# Abstract tropical variety supertype
# ===================================
#
# Not for public use, see concrete subtypes:
# - TropicalVariety, see variety,jl
# - TropicalHypersurface, see hypersurface.jl
# - TropicalCurve, see curve.jl
# - TropicalLinearSpace, see linear_space.jl
#
################################################################################
# minOrMax distinguishes between min- and max-convention
# isEmbedded distinguishes embedded and abstract tropical varieties
abstract type TropicalVarietySupertype{minOrMax,isEmbedded} end
################################################################################
#
# Properties
#
################################################################################
# if TropV isa TropicalLinearSpace, then polymake_object isa Polymake.matroid.ValuatedMatroid
# if TropV isa TropicalHypersurface, then polymake_object isa Polymake.tropical.Hypersurface
function pm_object(TropV::TropicalVarietySupertype)
@req has_attribute(TropV,:polymake_object) "no polymake object cached"
return get_attribute(TropV,:polymake_object)
end
@doc raw"""
polyhedral_complex(TropV::TropicalVariety)
Return the polyhedral complex of a tropical variety.
"""
function polyhedral_complex(TV::TropicalVarietySupertype)
return TV.polyhedralComplex
end
@doc raw"""
ambient_dim(TropV::TropicalVariety)
Return the ambient dimension of `TropV`. Requires `TropV` to be embedded.
"""
function ambient_dim(TropV::TropicalVarietySupertype{minOrMax,true}) where minOrMax
return ambient_dim(TropV.polyhedralComplex)
end
@doc raw"""
codim(TropV::TropicalVariety)
Return the codimension of `TropV`. Requires `TropV` to be embedded.
"""
function codim(TropV::TropicalVarietySupertype{minOrMax,true}) where minOrMax
return codim(TropV.polyhedralComplex)
end
function convention(TropV::TropicalVarietySupertype{typeof(min),isEmbedded}) where isEmbedded
return min
end
function convention(TropV::TropicalVarietySupertype{typeof(max),isEmbedded}) where isEmbedded
return max
end
@doc raw"""
dim(TropV::TropicalVariety)
Return the dimension of `TropV`.
"""
function dim(TropV::TropicalVarietySupertype)
return dim(TropV.polyhedralComplex)
end
@doc raw"""
f_vector(TropV::TropicalVariety)
Return the f-Vector of `TropV`.
"""
function f_vector(TropV::TropicalVarietySupertype)
return f_vector(TropV.polyhedralComplex)
end
@doc raw"""
lineality_dim(TropV::TropicalVariety)
Return the dimension of the lineality space of `TropV`.
"""
function lineality_dim(TropV::TropicalVarietySupertype)
return lineality_dim(TropV.polyhedralComplex)
end
@doc raw"""
lineality_space(TropV::TropicalVariety)
Return the lineality space of `TropV`.
"""
function lineality_space(TropV::TropicalVarietySupertype)
return lineality_space(TropV.polyhedralComplex)
end
@doc raw"""
maximal_polyhedra(TropV::TropicalVariety)
Return the maximal polyhedra of `TropV`.
"""
function maximal_polyhedra(TropV::TropicalVarietySupertype)
return maximal_polyhedra(TropV.polyhedralComplex)
end
@doc raw"""
maximal_polyhedra_and_multiplicities(TropV::TropicalVariety)
Return the maximal polyhedra of `TropV`.
"""
function maximal_polyhedra_and_multiplicities(TropV::TropicalVarietySupertype)
TropVmults = multiplicities(TropV)
return collect(zip(maximal_polyhedra(TropV),multiplicities(TropV)))
end
@doc raw"""
minimal_faces(TropV::TropicalVariety)
Return the minimal faces of `TropV`.
"""
function minimal_faces(TropV::TropicalVarietySupertype)
return minimal_faces(TropV.polyhedralComplex)
end
@doc raw"""
multiplicities(TropV::TropicalVariety)
Return the multiplicities of `TropV`.
"""
function multiplicities(TropV::TropicalVarietySupertype)
return TropV.multiplicities
end
@doc raw"""
n_maximal_polyhedra(TropV::TropicalVariety)
Return the number of maximal polyhedra of `TropV`.
"""
function n_maximal_polyhedra(TropV::TropicalVarietySupertype)
return n_maximal_polyhedra(TropV.polyhedralComplex)
end
@doc raw"""
n_polyhedra(TropV::TropicalVariety)
Return the number of polyhedra of `TropV`.
"""
function n_polyhedra(TropV::TropicalVarietySupertype)
return n_polyhedra(TropV.polyhedralComplex)
end
@doc raw"""
n_vertices(TropV::TropicalVariety)
Return the number of vertices of `TropV`.
"""
function n_vertices(TropV::TropicalVarietySupertype)
return n_vertices(TropV.polyhedralComplex)
end
@doc raw"""
is_pure(TropV::TropicalVariety)
Return `true` if `TropV` is pure as a polyhedral complex, `false` otherwise.
"""
function is_pure(TropV::TropicalVarietySupertype)
return is_pure(TropV.polyhedralComplex)
end
@doc raw"""
is_simplicial(TropV::TropicalVariety)
Return `true` if `TropV` is simplicial as a polyhedral complex, `false` otherwise.
"""
function is_simplicial(TropV::TropicalVarietySupertype)
return is_simplicial(TropV.polyhedralComplex)
end
@doc raw"""
rays(TropV::TropicalVariety)
Return the rays of `TropV`.
"""
function rays(as::Type{RayVector{S}}, TropV::TropicalVarietySupertype{minOrMax,isEmbedded}) where {S,minOrMax,isEmbedded}
return rays(as,TropV.polyhedralComplex)
end
function rays(TropV::TropicalVarietySupertype)
return rays(TropV.polyhedralComplex)
end
@doc raw"""
rays_modulo_lineality(TropV::TropicalVariety)
Return the rays modulo the lineality space of `TropV`.
"""
function rays_modulo_lineality(as::Type{RayVector{S}}, TropV::TropicalVarietySupertype{minOrMax,isEmbedded}) where {S,minOrMax,isEmbedded}
return rays_modulo_lineality(as,TropV.polyhedralComplex)
end
function rays_modulo_lineality(TropV::TropicalVarietySupertype)
return rays_modulo_lineality(TropV.polyhedralComplex)
end
@doc raw"""
vertices_and_rays(TropV::TropicalVariety)
Return the vertices and rays of `TropV`.
"""
function vertices_and_rays(TropV::TropicalVarietySupertype)
return vertices_and_rays(TropV.polyhedralComplex)
end
@doc raw"""
vertices(TropV::TropicalVariety)
Return the vertices of `TropV`.
"""
function vertices(as::Type{PointVector{S}}, TropV::TropicalVarietySupertype{minOrMax,isEmbedded}) where {S,minOrMax,isEmbedded}
return vertices(as,TropV.polyhedralComplex)
end
function vertices(TropV::TropicalVarietySupertype{minOrMax, isEmbedded}) where {minOrMax,isEmbedded}
return vertices(TropV.polyhedralComplex)
end
@doc raw"""
visualize(TropV::TropicalVariety)
Visualize `TropV`.
"""
function visualize(TropV::TropicalVarietySupertype)
return visualize(TropV.polyhedralComplex)
end