File: orbit_polytope.rules

package info (click to toggle)
polymake 4.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,888 kB
  • sloc: cpp: 168,933; perl: 43,407; javascript: 31,575; ansic: 3,007; java: 2,654; python: 632; sh: 268; xml: 117; makefile: 61
file content (121 lines) | stat: -rw-r--r-- 4,582 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#  Copyright (c) 1997-2024
#  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.
#-------------------------------------------------------------------------------

# @category Symmetry
# A symmetric polytope defined as the convex hull of the orbit of a single point
# under a permutation group acting on coordinates.
# currently only for [[Polytope<Rational>]]

declare object_specialization PointOrbit = Polytope<Rational> {

    precondition : GROUP.COORDINATE_ACTION.N_POINTS_GENERATORS {
       $this->GROUP->COORDINATE_ACTION->N_POINTS_GENERATORS==1;
    }

#------------------------------------------------------
# properties
#------------------------------------------------------

   property GROUP {

      property COORDINATE_ACTION  {

         # The NOP-graph of [[POINTS_GENERATORS]] with respect to the
         # [[GROUP]]. The nodes of the NOP-graph
         # correspond to the [[REPRESENTATIVE_CERTIFIERS]], 
         # which represent the different orbit polytopes
         # contained in the given orbit polytope.
         property NOP_GRAPH : Graph<Directed>;

         # A matrix of representatives of all certifiers
         # for [[POINTS_GENERATORS]] with respect to the
         # [[GROUP]].
         # A certifier is an integer point in the
         # given orbit polytope. 
         # Note that the representative certifiers must be in 
         # the same order as the corresponding nodes
         # in the [[NOP_GRAPH]]. Further, the [[CP_INDICES]]
         # refer to row indices of this property.
         property REPRESENTATIVE_CERTIFIERS : Matrix<Rational>;


         # The number of [[REPRESENTATIVE_CERTIFIERS]].
         property N_REPRESENTATIVE_CERTIFIERS : Int;


         # The row indices of all core points among
         # the [[REPRESENTATIVE_CERTIFIERS]].
         property CP_INDICES : Set<Int>;


         # A matrix of representatives of all core points in
         # the given orbit polytope.
         # A core point is an integer point whose orbit
         # polytope is lattice-free (i.e. does not contain
         # integer points besides its vertices).
         property REPRESENTATIVE_CORE_POINTS : Matrix<Rational>;


         # The number of [[REPRESENTATIVE_CORE_POINTS]].
         property N_REPRESENTATIVE_CORE_POINTS : Int;

      }
      
   }

#------------------------------------------------------
# rules
#------------------------------------------------------

rule GROUP.COORDINATE_ACTION.N_REPRESENTATIVE_CERTIFIERS : GROUP.COORDINATE_ACTION.REPRESENTATIVE_CERTIFIERS {
    $this->GROUP->COORDINATE_ACTION->N_REPRESENTATIVE_CERTIFIERS = $this->GROUP->COORDINATE_ACTION->REPRESENTATIVE_CERTIFIERS->rows;
}


rule GROUP.COORDINATE_ACTION.N_REPRESENTATIVE_CORE_POINTS : GROUP.COORDINATE_ACTION.REPRESENTATIVE_CORE_POINTS {
    $this->GROUP->COORDINATE_ACTION->N_REPRESENTATIVE_CORE_POINTS = $this->GROUP->COORDINATE_ACTION->REPRESENTATIVE_CORE_POINTS->rows;
}

rule GROUP.COORDINATE_ACTION.NOP_GRAPH, GROUP.COORDINATE_ACTION.REPRESENTATIVE_CERTIFIERS, GROUP.COORDINATE_ACTION.REPRESENTATIVE_CORE_POINTS, GROUP.COORDINATE_ACTION.CP_INDICES : GROUP.COORDINATE_ACTION.POINTS_GENERATORS, POINTS, LATTICE_POINTS_GENERATORS {
    
    my @res=nestedOPGraph($this->GROUP->COORDINATE_ACTION->POINTS_GENERATORS->[0], $this->POINTS, $this->LATTICE_POINTS_GENERATORS->[0], $this->GROUP->COORDINATE_ACTION, 0);
    $this->GROUP->COORDINATE_ACTION->NOP_GRAPH = $res[0];
    $this->GROUP->COORDINATE_ACTION->REPRESENTATIVE_CERTIFIERS = $res[1];
    $this->GROUP->COORDINATE_ACTION->REPRESENTATIVE_CORE_POINTS = $res[3];
    $this->GROUP->COORDINATE_ACTION->CP_INDICES = $res[4];
}
precondition : BOUNDED;
precondition : FEASIBLE;

}



package Visual::Color;

# Color for the visualization of core points
custom $CorePointColor="236 101 0"; #tud8b

# Color for the visualization of non core points
custom $NonCorePointColor="0 131 204"; #tud2b


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