#  Copyright (c) 1997-2015
#  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.
#-------------------------------------------------------------------------------

# Lattice represented as a directed acyclic graph.

declare object FaceLattice : Graph<Directed> {

   # Each node of the FaceLattice corresponds to a face. The node attribute is a set of vertices comprising the face.
   # Incident edges lead to the containing faces of the next (higher) dimension.
   property FACES : NodeMap<Directed,Set> : construct(ADJACENCY);

   # Indices of the first nodes in each level.
   # Intended for internal use only; please use [[nodes_of_dim]] instead.
   property DIMS : Array<Int>;

   my @attrs=(via_object => 'HasseDiagram', include => "polymake/graph/HasseDiagram.h");

   # Index of the node representing __the whole thing__.
   # @return Int
   user_method top_node() : c++ (@attrs);

   # Index of the node representing the empty face.
   # @return Int
   user_method bottom_node() : c++ (@attrs);

   # Dimension of the lattice = number of levels - 1.
   # @return Int
   user_method dim() : c++ (@attrs);

   method dual_faces() : c++ (@attrs);

   # Indices of nodes representing faces of the given dimension.
   # @param Int dim
   # @return Set<Int>
   user_method nodes_of_dim($) : c++ (@attrs);
}


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