#  Copyright (c) 1997-2010
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Darmstadt, Germany)
#  http://www.polymake.de
#
#  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.
#-------------------------------------------------------------------------------
#  $Project: polymake $$Id: propagated_polytope.rules 9534 2010-03-05 14:32:48Z smoeser $

# Polytope propagation means to define a polytope inductively by assigning vectors to arcs
# of a directed graph.  At each node of such a graph a polytope arises as the joint convex hull
# of the polytopes at the translated sources of the inward pointing arcs.
#
# For details see 
#	Joswig: Polytope Propagation on Graphs.
#	Chapter 6 in 
#	Pachter/Sturmfels: Algebraic Statistics for Computational Biology, Cambridge 2005.
declare object PropagatedPolytope : Polytope<Rational> {

# Directed graph to define the propagated polytope.  There is a (translation) vector assigned to each arc.
# We assume that this graph is acyclic with a unique sink.

property SUM_PRODUCT_GRAPH : Graph<Directed> {

   # The translation vectors of the arcs.
   property TRANSLATIONS : EdgeMap<Directed, Vector<Rational> >;

}

rule VERTICES, VERTEX_NORMALS : SUM_PRODUCT_GRAPH, AMBIENT_DIM {
   sum_product($this);
}
permutation : VertexPerm;

}

# Local Variables:
# c-basic-offset:3
# mode: perl
# End:
