#  Copyright (c) 1997-2018
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
#  http://www.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 common graph

USE polytope fan graph matroid

file_suffix trop


HELP help.rules


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

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

# A tropical polytope is the tropical convex hull of finitely many points in tropical projective space.
# It should always be defined via [[POINTS]] instead of [[VERTICES]], as those define the combinatorics
# of the induced subdivision.
# @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.
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>;

# This is a special instance of a Cycle: It is the tropical locus of a
# polynomial over the tropical numbers.
declare object Hypersurface<Addition> : Cycle<Addition>;

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


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