#  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: float.rules 9547 2010-03-09 07:21:34Z smoeser $

# @topic objects/Polytope<Float>
# A pointed polyhedron realized in R<sup>d</sup>.
#
# Convex hull and related algorithms use floating-point arithmetics.
# Due to numerical errors inherent to this kind of computations, the resulting
# combinatorial description can be arbitrarily far away from the truth, or even
# not correspond to any valid polytope.  You have been warned.
#
# None of the standard construction clients produces objects of this type.
# If you want to get one, create it with the explicit constructor or [[convert_to]].

object Polytope<Float> {

# Threshold for zero test for scalar products (e.g. vertex * facet normal)
property EPSILON : Float;

method prepare_computations {
   my $eps=$_[0]->lookup("EPSILON");
   defined($eps) && local_epsilon($eps);
}

# @topic credits/cddlib

rule cdd.convex_hull.primal: FACETS, AFFINE_HULL : VERTICES | POINTS {
   cdd_ch_primal($this);
}
weight 4.10;
permutation : FacetPerm;

rule cdd.convex_hull.dual: VERTICES, POINTED, FEASIBLE, LINEALITY_DIM : FACETS | INEQUALITIES {
   cdd_ch_dual($this);
}
weight 4.10;
permutation : VertexPerm;

}

# intrinsic rules
INCLUDE
  lp_float.rules

# self-configuring rules
INCLUDE
  vinci.rules
  qhull.rules


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