#  Copyright (c) 1997-2006
#  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: comparing.rules 7333 2006-04-05 12:20:41Z gawrilow $


# category: Comparing
# args: Polytope1, Polytope2
# return: boolean
# Check whether the face lattices of two polytopes are isomorphic.
# The problem is reduced to graph isomorphism of the vertex-facet incidence graphs.

user_function check_iso(Polytope,Polytope) {
   my @result;
   client("isomorphic_polytopes", @_, \@result);
   return $result[0]+0;
}


# category: Comparing
# args: Polytope1, Polytope2
# return: scalar
# Check whether two given polytopes are congruent, i.e. whether
# there is an affine isomorphism between them that is induced by a (possibly scaled) orthogonal matrix.
#
# This function returns the scale factor, or 0 if the polytopes are not congruent.
#
# We are using the reduction of the congruence problem (for arbitrary point sets) to the graph
# isomorphism problem due to:
#
#     Akutsu, T.: On determining the congruence of point sets in {`d`} dimensions.
#     Comput. Geom. Theory Appl. 9, 247--256 (1998), no. 4
#

user_function check_congruence(Polytope, Polytope) {
   my @result;
   client("congruent_polytopes", @_, \@result);
   return $result[0];
}


object Polytope;

SELF_DUAL : VERTICES_IN_FACETS
   client("isomorphic_polytopes", $this, "-self-dual", "SELF_DUAL");


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