#  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.
#-------------------------------------------------------------------------------

# @category Symmetry
# Constructs a group from a string with generators in cyclic notation.
# All numbers in the string are 0-based, meaning that 0 is the smallest number allowed.
# @param String group generators in cyclic notation
# @param Int domain of the polytope symmetry group. 1 for action on vertex indices, 2 for action"
#            on facet indices, 3 for action on coordinates
# @return group::GroupOfPolytope
# @example > $g = group_from_cyclic_notation0("(0,2)(1,3)",0);
# > print $g->GENERATORS;
# | 2 3 0 1

user_function group_from_cyclic_notation0($, $) {
   my ($gens, $domain) = @_;
   return new group::GroupOfPolytope(group::group_from_cyclic_notation0($gens), DOMAIN => $domain);
}

# @category Symmetry
# Constructs a group from a string with generators in cyclic notation.
# All numbers in the string are 1-based, meaning that 1 is the smallest number allowed.
# Example: "(1,3)(2,4)"
# @param String group generators in cyclic notation
# @param Int domain of the polytope symmetry group. 1 for action on vertex indices, 2 for action"
#            on facet indices, 3 for action on coordinates
# @return group::GroupOfPolytope
# # @example > $g = group_from_cyclic_notation1("(1,3)(2,4)",0);
# > print $g->GENERATORS;
# | 2 3 0 1

user_function group_from_cyclic_notation1($, $) {
   my ($gens, $domain) = @_;
   return new group::GroupOfPolytope(group::group_from_cyclic_notation1($gens), DOMAIN => $domain);
}

# @category Symmetry
# Constructs a __symmetric group__ of given //degree//. (See also [[group::symmetric_group]].)
# @param Int degree
# @param Int domain of the polytope's symmetry group. 1 for action on vertex indices, 2 for action"
#            on facet indices, 3 for action on coordinates
# @return group::GroupOfPolytope
# @example > $g = symmetric_group(5,0);
# > print $g->GENERATORS;
# | 1 0 2 3 4
# | 0 2 1 3 4
# | 0 1 3 2 4
# | 0 1 2 4 3

user_function symmetric_group($, $) {
   my ($n, $domain) = @_;
   return new group::GroupOfPolytope(group::symmetric_group($n), DOMAIN => $domain);
}

# @category Symmetry
# Constructs an __alternating group__ of given //degree//. (See also [[group::alternating_group]].)
# @param Int degree
# @param Int domain of the polytope's symmetry group
# @return group::GroupOfPolytope
user_function alternating_group($, $) {
   my ($n, $domain) = @_;
   return new group::GroupOfPolytope(group::alternating_group($n), DOMAIN => $domain);
}

# @category Symmetry
# Constructs a __cyclic group__ of given //degree//. (See also [[group::cyclic_group]].)
# @param Int degree
# @param Int domain of the polytope's symmetry group
# @return group::GroupOfPolytope
user_function cyclic_group($, $) {
   my ($n, $domain) = @_;
   return new group::GroupOfPolytope(group::cyclic_group($n), DOMAIN => $domain);
}


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