Orbiter 2022
Combinatorial Objects
action_on_set_partitions.cpp
Go to the documentation of this file.
1/*
2 * action_on_set_partitions.cpp
3 *
4 * Created on: Jan 7, 2019
5 * Author: betten
6 */
7
9#include "group_actions.h"
10
11using namespace std;
12
13
14namespace orbiter {
15namespace layer3_group_actions {
16namespace induced_actions {
17
18
20{
21 null();
22}
23
25{
26 free();
27}
28
30{
34 nb_parts = 0;
35 A = NULL;
36 v1 = NULL;
37 v2 = NULL;
38}
39
41{
42 if (v1) {
43 FREE_int(v1);
44 }
45 if (v2) {
46 FREE_int(v2);
47 }
48 null();
49}
50
51
53 int partition_class_size,
55 int verbose_level)
56{
57 int f_v = (verbose_level >= 1);
58
59 if (f_v) {
60 cout << "action_on_set_partitions::init "
61 "universal_set_size=" << A->degree
62 << " partition_size=" << partition_class_size << endl;
63 }
68 cout << "action_on_set_partitions::init "
69 "partition_size must divide universal_set_size" << endl;
70 exit(1);
71 }
75 }
76 else if (universal_set_size == 4 && partition_class_size == 2) {
78 }
79 else {
80 cout << "action_on_set_partitions::init set partitions "
81 "of this size are not yet implemented" << endl;
82 exit(1);
83 }
86
87 if (f_v) {
88 cout << "action_on_set_partitions::init finished" << endl;
89 }
90}
91
93 int *Elt, long int a, int verbose_level)
94{
95 int f_v = (verbose_level >= 1);
96 int i, b;
99
100 if (f_v) {
101 cout << "action_on_set_partitions::compute_image "
102 "a = " << a << endl;
103 }
104 if (a < 0 || a >= nb_set_partitions) {
105 cout << "action_on_set_partitions::compute_image "
106 "a = " << a << " out of range" << endl;
107 exit(1);
108 }
109 if (universal_set_size == 6 && partition_class_size == 2) {
110 Combi.unordered_triple_pair_unrank(a, v1[0], v1[1], v1[2],
111 v1[3], v1[4], v1[5]);
112 for (i = 0; i < 6; i++) {
113 v2[i] = A->element_image_of(v1[i], Elt, 0 /*verbose_level*/);
114 }
115 for (i = 0; i < nb_parts; i++) {
118 }
119 b = Combi.unordered_triple_pair_rank(v2[0], v2[1], v2[2],
120 v2[3], v2[4], v2[5]);
121 }
122 else if (universal_set_size == 4 && partition_class_size == 2) {
124 for (i = 0; i < 4; i++) {
125 v2[i] = A->element_image_of(v1[i], Elt, 0 /*verbose_level*/);
126 }
127 for (i = 0; i < nb_parts; i++) {
130 }
132 }
133 else {
134 cout << "action_on_set_partitions::compute_image set partitions "
135 "of this size are not yet implemented" << endl;
136 exit(1);
137 }
138
139 if (b < 0 || b >= nb_set_partitions) {
140 cout << "action_on_set_partitions::compute_image "
141 "b = " << b << " out of range" << endl;
142 exit(1);
143 }
144 if (f_v) {
145 cout << "action_on_set_partitions::compute_image "
146 "a = " << a << " -> " << b << endl;
147 }
148 return b;
149}
150
151}}}
152
153
154
int unordered_triple_pair_rank(int i, int j, int k, int l, int m, int n)
void unordered_triple_pair_unrank(int rk, int &i, int &j, int &k, int &l, int &m, int &n)
a collection of functions related to sorted vectors
a permutation group in a fixed action.
Definition: actions.h:99
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
void init(int partition_size, actions::action *A, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_int(n)
Definition: foundations.h:625
the orbiter library for the classification of combinatorial objects