#  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 deals with polyhedral fans. You can define a fan, e.g. via its [[RAYS]] and [[MAXIMAL_CONES]]
# and compute several properties like [[HASSE_DIAGRAM]] and [[F_VECTOR]].

IMPORT polytope

USE ideal

file_suffix fan


HELP
	help.rules

# @category Geometry
# A polyhedral fan.
# The current restriction is that each cone in the fan has to be pointed.  This will be relaxed later.
# If a fan is specified via [[INPUT_RAYS]] and [[INPUT_CONES]] each input cone must list all the input rays incident.
#
# Once non-trivial linealities are allowed the following will apply:
# The [[RAYS]] always lie in a linear subspace which is complementary to the [[LINEALITY_SPACE]].
# @example A typical example is the normal fan of a convex polytope.
# > $f=normal_fan(polytope::cube(3));
# > print $f->F_VECTOR;
# | 6 12 8

declare object PolyhedralFan<Scalar=Rational> [ is_ordered_field(Scalar) ];

# @category Geometry
# A polyhedral complex.  The derivation from [[PolyhedralFan]] works like the derivation of [[Polytope]] from [[Cone]].
# @example The following defines a subdivision of a square in the plane into two triangles. 
# > $c=new PolyhedralComplex(VERTICES=>[[1,0,0],[1,1,0],[1,0,1],[1,1,1]],MAXIMAL_POLYTOPES=>[[0,1,2],[1,2,3]]);
declare object PolyhedralComplex<Scalar=Rational> [ is_ordered_field(Scalar) ] : PolyhedralFan<Scalar>;

# @category Geometry
# A special big object class devoted to planar unfoldings of 3-polytopes.  Its main functionality is the visualization.
# @example To visualize a planar net of some Johnson solid (with flaps, such that you can print, cut and glue):
# > planar_net(polytope::johnson_solid(52))->VISUAL->FLAPS;
declare object PlanarNet<Scalar=Rational> : PolyhedralComplex<Float>;

# @category Geometry
# A subdivision of vectors, in contrast to [[PolyhedralFan]] this allows cells with interior points.
# Similar to the distinction between [[Cone]] and [[VectorConfiguration]].
# @tparam Scalar default: [[Rational]]
declare object SubdivisionOfVectors<Scalar=Rational> [ is_ordered_field(Scalar) ];

# @category Geometry
# The inhomogeneous variant of [[SubdivisionOfVectors]], similar to the derivation of [[PointConfiguration]] from [[VectorConfiguration]].
# @tparam Scalar default: [[Rational]]
# @example [prefer cdd] To produce a regular subdivision of the vertices of a square:
# > $c=new SubdivisionOfPoints(POINTS=>polytope::cube(2)->VERTICES,WEIGHTS=>[0,0,0,1]);
# > print $c->MAXIMAL_CELLS;
# | {0 1 2}
# | {1 2 3}
declare object SubdivisionOfPoints<Scalar=Rational> [ is_ordered_field(Scalar) ] : SubdivisionOfVectors<Scalar>;

INCLUDE
  fan_properties.rules
  initial.rules
  polyhedral_complex_properties.rules
  subdivision_properties.rules
  common.rules
  incidence_perm.rules
  polyhedral_complex.rules
  planar_net.rules
  bounded_complex.rules
  bounded_complex_visual_graph.rules
  subdivision.rules
  visual.rules
  lattice.rules
  gfan.rules
  splitstree.rules
  action.rules
  symmetric_fan.rules
  voronoi.rules

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