#  Copyright (c) 1997-2021
#  Ewgenij Gawrilow, Michael Joswig, and the polymake team
#  Technische Universität Berlin, Germany
#  https://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.
#-------------------------------------------------------------------------------


CREDIT sympol
  [[wiki:external_software#sympol]] is a software package for polyhedral description conversion up to symmetries.
  Written by Thomas Rehn and Achill Schürmann.
  http://www.math.uni-rostock.de/~rehn/software/sympol.html 

object Cone {

    rule GROUP.REPRESENTATIVE_RAYS : GROUP.FACETS_ACTION.GENERATORS, FACETS, LINEAR_SPAN {
        $this->GROUP->REPRESENTATIVE_RAYS = representation_conversion_up_to_symmetry($this, v_to_h=>0, method=>'lrs');
    }
    weight 5.10;

    rule GROUP.REPRESENTATIVE_FACETS : GROUP.RAYS_ACTION.GENERATORS, RAYS, LINEALITY_SPACE {
        $this->GROUP->REPRESENTATIVE_FACETS = representation_conversion_up_to_symmetry($this, v_to_h=>1, method=>'lrs');
    }
    weight 5.10;

}

# CREDIT sympol\n\n
# @category Symmetry
# Use sympol to compute the linear symmetries of
# - the RAYS|VERTICES, FACETS, or POINTS of a rational cone or polytope //C// (whatever is available, in this order), or
# - the VECTORS|POINTS of a rational vector or point configuration //P//.
# The action of the symmetry group is stored inside the parent object.
# In the case of cones, sympol might compute only a subset of the linear symmetry group.
# Sympol, and therefore this function, can only handle rational objects.
# @param Cone C | VectorConfiguration //P//
# @return group::Group the linear symmetry group, together with a PERMUTATION_ACTION, VERTICES_ACTION, FACETS_ACTION, or VECTOR_ACTION
# @example
# > print linear_symmetries(cube(3))->FACETS_ACTION->GENERATORS;
# | 1 0 2 3 4 5
# | 0 1 3 2 4 5
# | 2 3 0 1 4 5
# | 0 1 2 3 5 4
# | 0 1 4 5 2 3
user_function linear_symmetries($) {
    my $p = shift;
    my $g = linear_symmetries_impl($p);
    return $g;
}

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