#  Copyright (c) 1997-2004
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
#  http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.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: lp.rules,v 1.26 2004/10/27 17:01:02 gawrilow Exp $

INCLUDE
   polytope_properties.rules
   lp_properties.rules

object Polytope;

DIRECTED_GRAPH, MAXIMAL_VALUE, MINIMAL_VALUE, MAXIMAL_FACE, MINIMAL_FACE : \
  GRAPH, LINEAR_OBJECTIVE, VERTICES, FAR_FACE
WEIGHT 2.50
   client("dgraph", $this)

DIRECTED_GRAPH, MAXIMAL_VALUE, MINIMAL_VALUE, MAXIMAL_FACE, MINIMAL_FACE : \
  GRAPH, ABSTRACT_OBJECTIVE
WEIGHT 2.50
   client("dgraph", $this)

VERTEX_COLORS : LINEAR_OBJECTIVE, VERTICES, FAR_FACE, GRAPH, \
                MAXIMAL_VALUE, MINIMAL_VALUE, MAXIMAL_FACE, MINIMAL_FACE
   client("vertex_colors", $this, $Visual::Color::min =~ /\d+/g, $Visual::Color::max =~ /\d+/g);

VERTEX_COLORS : ABSTRACT_OBJECTIVE, GRAPH, \
                MAXIMAL_VALUE, MINIMAL_VALUE, MAXIMAL_FACE, MINIMAL_FACE
   client("vertex_colors", $this, $Visual::Color::min =~ /\d+/g, $Visual::Color::max =~ /\d+/g);

RANDOM_EDGE_EPL : DIRECTED_GRAPH
   client("random_edge_epl", $this);

VERTEX_OUT_DEGREES : DIRECTED_GRAPH
   $this->VERTEX_OUT_DEGREES=join(" ", row_sizes($this->DIRECTED_GRAPH));

VERTEX_IN_DEGREES : DIRECTED_GRAPH
   my @in_degrees=(0) x @{$this->DIRECTED_GRAPH};
   foreach (@{$this->DIRECTED_GRAPH}) {
      map { ++$in_degrees[$_] } /\d+/g;
   }
   $this->VERTEX_IN_DEGREES="@in_degrees";

MAXIMAL_VERTEX : VERTICES, MAXIMAL_FACE
WEIGHT 0.10
   if (defined $this->MAXIMAL_FACE) {
      $this->MAXIMAL_FACE =~ /\d+/;
      $this->MAXIMAL_VERTEX=$this->VERTICES->[$&];
   }

MINIMAL_VERTEX : VERTICES, MINIMAL_FACE
WEIGHT 0.10
   if (defined $this->MINIMAL_FACE) {
      $this->MINIMAL_FACE =~ /\d+/;
      $this->MINIMAL_VERTEX=$this->VERTICES->[$&];
   }

POINTED : MAXIMAL_VERTEX | MINIMAL_VERTEX
WEIGHT 0.10
   $this->POINTED=defined($this->MAXIMAL_VERTEX | MINIMAL_VERTEX);


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