File: main.rules

package info (click to toggle)
polymake 4.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,888 kB
  • sloc: cpp: 168,933; perl: 43,407; javascript: 31,575; ansic: 3,007; java: 2,654; python: 632; sh: 268; xml: 117; makefile: 61
file content (112 lines) | stat: -rw-r--r-- 5,305 bytes parent folder | download | duplicates (2)
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
#  Copyright (c) 1997-2024
#  Ewgenij Gawrilow, Michael Joswig, and the polymake team
#  Technische Universität Berlin, Germany
#  https://polymake.org
#
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; either version 2, or (at your option) any
#  later version: http://www.gnu.org/licenses/gpl.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#-------------------------------------------------------------------------------

# @topic application
# This application concentrates on [[Hypersurface|tropical hypersurfaces]] and [[Polytope|tropical polytopes]].
# It provides the functionality for the computation of basic properties. Visualization and various constructions are possible.

IMPORT graph

USE polytope fan graph matroid

file_suffix trop


HELP help.rules


##################################################################################

declare property_type CovectorDecoration : c++ (name => "tropical::CovectorDecoration", include => "polymake/tropical/covectors.h");

# A tropical polytope is the tropical convex hull of finitely many points or the finite intersection of tropical halfspaces in a tropical projective space.
# Many combinatorial properties depend on [[POINTS]].
# Note: [[VERTICES]] are used for [[POINTS]] if the tropical polytope is initialized by INEQUALITIES. 
# @tparam Addition Either [[Min]] or [[Max]]. There is NO default for this, you have to choose!
# @tparam Scalar Rational by default. The underlying type of ordered group.
# @example Constructing a tropical polygon from a fixed list of generators.  
# > $P = new Polytope<Min>(POINTS=>[[0,1,0],[0,4,1],[0,3,3],[0,0,2]]);
# @example Constructing the same tropical polygon from tropical linear inequalities.
# > $A1 = new Matrix<TropicalNumber<Min>>([[0,-2,"inf"],["inf",-4,"inf"],["inf",-3,-1],["inf","inf",-3],[0,"inf","inf"]]);
# > $A2 = new Matrix<TropicalNumber<Min>>([["inf","inf",-1],[0,"inf",-1],[0,"inf","inf"],[0,-1,"inf"],["inf",0,0]]);
# > $Q = new Polytope<Min>(INEQUALITIES=>[$A1,$A2]);
# > print $Q->VERTICES;
# | 0 0 2
# | 0 1 0
# | 0 3 3
# | 0 4 1
declare object Polytope<Addition, Scalar=Rational> [ is_ordered_field_with_unlimited_precision(Scalar) ];

# A tropical cycle is a weighted, balanced, pure polyhedral complex.
# It is given as a polyhedral complex in tropical projective coordinates.
# To be precise: Each row of [[VERTICES]] and [[LINEALITY_SPACE]]
# has a leading 1 or 0, depending on whether it is a vertex or a ray.
# The remaining n coordinates are interpreted as an element of
# R<sup>n</sup> modulo (1,..,1).
# IMPORTANT NOTE: VERTICES are assumed to be normalized such that the first coordinate (i.e.
# column index 1) is 0. If your input is not of that form, use [[PROJECTIVE_VERTICES]].
# Note that there is a convenience method [[thomog]], which converts affine coordinates
# into projective coordinates.
# @tparam Addition The tropical addition. Warning: There is NO default for this, you have to choose either [[Max]] or [[Min]].
declare object Cycle<Addition> : fan::PolyhedralComplex<Rational>;

# Tropical hypersurface in the tropical projective torus R^d/R1.
# This is a special instance of a Cycle: It is the tropical locus of a
# homogeneous polynomial over the tropical numbers.
# Note: Homogeneity of the [[MONOMIALS]] is never checked.
# @tparam Addition The tropical addition. Warning: There is NO default for this, you have to choose either [[Max]] or [[Min]].
# @example The following yields a tropical plane conic.
# > $C=new Hypersurface<Min>(MONOMIALS=>[ [2,0,0],[1,1,0],[0,2,0],[1,0,1],[0,1,1],[0,0,2] ], COEFFICIENTS=>[6,5,6,5,5,7]);
declare object Hypersurface<Addition> : Cycle<Addition>;

# This encodes a "combinatorial" patchworking structure on a hypersurface.
# That is, it requires the support of the dual triangulation to be the full set of lattice points in a scaled simplex.
# See Joswig and Vater, ICMS 2020, doi:10.1007/978-3-030-52200-1_20.
declare object Patchwork;

# Abstract tropical curve, possibly with marked edges, edge lengths, vertex weights.
# Additional functionality for moduli space computations.
# @tparam Scalar Edge length type.
# @example We construct a tropical quartic curve of genus 3.
# Edge labels as in Fig. 4 (000) on Brodsky et al., Res. Math. Sci (2015), doi:10.1186/s40687-014-0018-1.
# > ($u,$v,$w,$x,$y,$z)=0..5;
# > $skeleton = new IncidenceMatrix([[$u,$v,$x],[$v,$w,$z],[$u,$w,$y],[$x,$y,$z]]);
# > $quartic = new tropical::Curve(EDGES_THROUGH_VERTICES=>$skeleton, EDGE_LENGTHS=>[1,2,3,4,5,6]);
declare object Curve<Scalar=Rational> [ is_ordered_field(Scalar) ];


INCLUDE
  cycle.rules
  hypersurface.rules
  covector_lattice.rules
  cone_properties.rules
  cone.rules
  gfan.rules
  #FIXME Add connection to tplib again?
  #tplib.rules
  visual.rules
  visual_covector.rules
  patchwork.rules
  voronoi.rules
  curve.rules
  tropical_median.rules
  #mcf.rules --moved to graph

# Local Variables:
# mode: perl
# cperl-indent-level: 3
# indent-tabs-mode:nil
# End: