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


declare object QuotientedPermutationRepresentation : Representation;

object QuotientedPermutationRepresentation {

# the dimension of the quotiented representation
property QUOTIENTED_DEGREE : Int;

# the list of equivalence classs of sets on which the group acts
property DOMAIN : Array<common::boost_dynamic_bitset>;

# the function that indexes these sets
property INDEX_OF : Map<common::boost_dynamic_bitset, Int>;

# the character of the representation
property CHARACTER : Array<Int>;



rule QUOTIENTED_DEGREE : DOMAIN {
    $this->QUOTIENTED_DEGREE = $this->DOMAIN->size;
}

rule DEGREE : CHARACTER {
    $this->DEGREE = $this->CHARACTER->[0];
}

rule INDEX_OF : DOMAIN {
    my $index_of = new Map<common::boost_dynamic_bitset, Int>;
    my $i=0;
    foreach (@{$this->DOMAIN}) {
        $index_of->{$_} = $i++;
    }
    $this->INDEX_OF = $index_of;
}

rule CHARACTER : GROUP.GENERATORS, GROUP.CONJUGACY_CLASS_REPRESENTATIVES, DOMAIN {
    $this->CHARACTER = quotiented_character($this);
}

}


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