Skip to content

Commit 64bc2a5

Browse files
author
Winfried Bruns
committed
Further refinement of automorphisms output
1 parent f9aef01 commit 64bc2a5

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

NormalizModule.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ static PyObject* CallPythonFuncOnOneArg(PyObject* function, PyObject* single_arg
172172
#ifndef NMZ_RELEASE
173173
static_assert(
174174
false,
175-
"Your Normaliz version (unknown) is to old! Update to 3.8.10 or newer.");
175+
"Your Normaliz version (unknown) is to old! Update to 3.9.0 or newer.");
176176
#endif
177-
#if NMZ_RELEASE < 30810
177+
#if NMZ_RELEASE < 30900
178178
static_assert(false,
179-
"Your Normaliz version is to old! Update to 3.8.10 or newer.");
179+
"Your Normaliz version is to old! Update to 3.9.0 or newer.");
180180
#endif
181181

182182
/***************************************************************************
@@ -709,14 +709,18 @@ template < typename Integer >
709709
static PyObject*
710710
NmzAutomorphismsToPython(const AutomorphismGroup< Integer >& grp)
711711
{
712+
int list_size = 6;
713+
if(grp.IsInput() || grp.IsAmbient())
714+
list_size =7;
712715

713-
PyObject* list = PyList_New(6);
716+
PyObject* list = PyList_New(list_size);
714717

715718
PyList_SetItem(list, 0, NmzToPyNumber(grp.getOrder()));
716719
PyList_SetItem(list, 1, BoolToPyBool(grp.IsIntegralityChecked()));
717-
PyList_SetItem(list, 2, BoolToPyBool(grp.IsIntegral()));
720+
PyList_SetItem(list, 2, BoolToPyBool(grp.IsIntegral()));
718721

719722
if(grp.IsInput() || grp.IsAmbient()){
723+
PyList_SetItem(list, 6, NmzMatrixToPyList(grp.getGens().get_elements()));
720724
PyObject* current = PyList_New(2);
721725
PyList_SetItem(current, 0, NmzMatrixToPyList(grp.getGensPerms()));
722726
PyList_SetItem(current, 1, NmzMatrixToPyList(grp.getGensOrbits()));

PyNormaliz.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,31 @@ def print_perms_and_orbits(data, name):
2727

2828
def print_automs(Automs):
2929
print("order ", Automs[0])
30-
if len(Automs[1][0]) >0:
31-
print_perms_and_orbits(Automs[1],"extreme rays of (recession) cone")
32-
if len(Automs[2][0]) >0:
33-
print_perms_and_orbits(Automs[2],"vertices of polyhedron")
30+
if Automs[1]:
31+
if Automs[2]:
32+
print("automorphisms are integral")
33+
else:
34+
print("automorphisms are not integral")
35+
else:
36+
print("integrality of automorphisms unknown")
37+
38+
gen_name ="extreme rays of (recession) cone"
39+
if len(Automs) == 7:
40+
gen_name = "input vectors";
41+
lf_name = "support hyperplanes"
42+
if len(Automs) == 7:
43+
lf_name = "coordinates"
44+
3445
if len(Automs[3][0]) >0:
35-
print_perms_and_orbits(Automs[3],"support hyperplanes")
46+
print_perms_and_orbits(Automs[3],gen_name)
47+
if len(Automs[4][0]) >0:
48+
print_perms_and_orbits(Automs[4],"vertices of polyhedron")
49+
if len(Automs[5][0]) >0:
50+
print_perms_and_orbits(Automs[5],lf_name)
51+
52+
if len(Automs) == 7:
53+
print("input vectors")
54+
print_matrix(Automs[6])
3655
return
3756

3857
def print_Stanley_dec(dec):

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ A full documentation is conatined in [Appendix E](doc/PyNormaliz.pdf) of the Nor
1313
## Requirements
1414

1515
* python 2.7 or higher or python 3.4 or higher
16-
* Normaliz 3.8.10 or higher <https://github.com/Normaliz/Normaliz/releases>
16+
* Normaliz 3.9.0 or higher <https://github.com/Normaliz/Normaliz/releases>
1717

18-
(The current version of PyNormaliz is under construction. Normaliz 3.8.10 not yet released. Use current master of Normaliz for current master of PyNormaliz.) The source packages of the Normaliz realeases contain PyNormaliz.
18+
(The current version of PyNormaliz is under construction. Normaliz 3.9.0 not yet released. Use current master of Normaliz for current master of PyNormaliz.) The source packages of the Normaliz realeases contain PyNormaliz.
1919

2020
## Installation
2121

0 commit comments

Comments
 (0)