Orbiter
2022
Combinatorial Objects
action_on_sign.cpp
Go to the documentation of this file.
1
// action_on_sign.cpp
2
//
3
// Anton Betten
4
// August 12, 2016
5
6
#include "
foundations/foundations.h
"
7
#include "
group_actions.h
"
8
9
using namespace
std;
10
11
12
namespace
orbiter
{
13
namespace
layer3_group_actions {
14
namespace
induced_actions {
15
16
17
action_on_sign::action_on_sign
()
18
{
19
null
();
20
}
21
22
action_on_sign::~action_on_sign
()
23
{
24
free
();
25
}
26
27
void
action_on_sign::null
()
28
{
29
perm
= NULL;
30
}
31
32
void
action_on_sign::free
()
33
{
34
if
(
perm
) {
35
FREE_int
(
perm
);
36
}
37
null
();
38
}
39
40
41
void
action_on_sign::init
(
actions::action
*A,
int
verbose_level)
42
{
43
int
f_v = (verbose_level >= 1);
44
ring_theory::longinteger_object
go;
45
46
if
(f_v) {
47
cout <<
"action_on_sign::init"
<< endl;
48
}
49
action_on_sign::A
=
A
;
50
perm_degree
=
A
->
degree
;
51
if
(f_v) {
52
cout <<
"perm_degree="
<<
perm_degree
<< endl;
53
}
54
perm
=
NEW_int
(
perm_degree
);
55
degree
= 2;
56
57
if
(f_v) {
58
cout <<
"action_on_sign::init"
<< endl;
59
}
60
}
61
62
long
int
action_on_sign::compute_image
(
int
*Elt,
63
long
int
i,
int
verbose_level)
64
{
65
int
f_v = (verbose_level >= 1);
66
long
int
u, v, sgn, j;
67
combinatorics::combinatorics_domain
Combi;
68
69
if
(f_v) {
70
cout <<
"action_on_sign::compute_image "
71
"i = "
<< i << endl;
72
}
73
if
(i < 0 || i >=
degree
) {
74
cout <<
"action_on_sign::compute_image "
75
"i = "
<< i <<
" out of range"
<< endl;
76
exit(1);
77
}
78
for
(u = 0; u <
perm_degree
; u++) {
79
v =
A
->
element_image_of
(u, Elt,
FALSE
);
80
perm
[u] = v;
81
}
82
sgn = Combi.
perm_signum
(
perm
,
perm_degree
);
83
if
(sgn == -1) {
84
j = (i + 1) % 2;
85
}
86
else
{
87
j = i;
88
}
89
90
if
(f_v) {
91
cout <<
"action_on_sign::compute_image "
92
"image of "
<< i <<
" is "
<< j << endl;
93
}
94
return
j;
95
}
96
97
}}}
98
orbiter::layer1_foundations::combinatorics::combinatorics_domain
a collection of combinatorial functions
Definition:
combinatorics.h:301
orbiter::layer1_foundations::combinatorics::combinatorics_domain::perm_signum
int perm_signum(int *perm, long int n)
Definition:
combinatorics_domain.cpp:1592
orbiter::layer1_foundations::ring_theory::longinteger_object
a class to represent arbitrary precision integers
Definition:
ring_theory.h:366
orbiter::layer3_group_actions::actions::action
a permutation group in a fixed action.
Definition:
actions.h:99
orbiter::layer3_group_actions::actions::action::degree
long int degree
Definition:
actions.h:133
orbiter::layer3_group_actions::actions::action::element_image_of
long int element_image_of(long int a, void *elt, int verbose_level)
Definition:
action_cb.cpp:198
orbiter::layer3_group_actions::induced_actions::action_on_sign::compute_image
long int compute_image(int *Elt, long int i, int verbose_level)
Definition:
action_on_sign.cpp:62
orbiter::layer3_group_actions::induced_actions::action_on_sign::action_on_sign
action_on_sign()
Definition:
action_on_sign.cpp:17
orbiter::layer3_group_actions::induced_actions::action_on_sign::null
void null()
Definition:
action_on_sign.cpp:27
orbiter::layer3_group_actions::induced_actions::action_on_sign::init
void init(actions::action *A, int verbose_level)
Definition:
action_on_sign.cpp:41
orbiter::layer3_group_actions::induced_actions::action_on_sign::degree
int degree
Definition:
induced_actions.h:828
orbiter::layer3_group_actions::induced_actions::action_on_sign::free
void free()
Definition:
action_on_sign.cpp:32
orbiter::layer3_group_actions::induced_actions::action_on_sign::perm
int * perm
Definition:
induced_actions.h:827
orbiter::layer3_group_actions::induced_actions::action_on_sign::perm_degree
int perm_degree
Definition:
induced_actions.h:826
orbiter::layer3_group_actions::induced_actions::action_on_sign::A
actions::action * A
Definition:
induced_actions.h:825
orbiter::layer3_group_actions::induced_actions::action_on_sign::~action_on_sign
~action_on_sign()
Definition:
action_on_sign.cpp:22
foundations.h
FREE_int
#define FREE_int(p)
Definition:
foundations.h:640
NEW_int
#define NEW_int(n)
Definition:
foundations.h:625
FALSE
#define FALSE
Definition:
foundations.h:234
group_actions.h
orbiter
the orbiter library for the classification of combinatorial objects
Definition:
classification.h:18
src
lib
group_actions
induced_actions
action_on_sign.cpp
Generated by
1.9.3