diff --git a/src/normaliz.cc b/src/normaliz.cc index f8d5b88..538becc 100644 --- a/src/normaliz.cc +++ b/src/normaliz.cc @@ -458,12 +458,12 @@ bool GAPToNmz(mpq_class & out, Obj x) template static bool GAPToNmz(vector & out, Obj V) { - if (!IS_PLIST(V) || !IS_DENSE_LIST(V)) + if (!IS_LIST(V) || !IS_DENSE_LIST(V)) return false; - const int n = LEN_PLIST(V); + const int n = LEN_LIST(V); out.resize(n); for (int i = 0; i < n; ++i) { - Obj tmp = ELM_PLIST(V, i + 1); + Obj tmp = ELM_LIST(V, i + 1); if (!GAPToNmz(out[i], tmp)) return false; } diff --git a/tst/bugfix.tst b/tst/bugfix.tst index 7dafd3a..8a3cb1a 100644 --- a/tst/bugfix.tst +++ b/tst/bugfix.tst @@ -33,5 +33,14 @@ gap> C := NmzCone( "inhom_inequalities", L );; gap> NmzModuleGenerators(C); [ [ 0, 0, 0, 0, 0, 1 ] ] +# +# Accept arbitrary lists (including ranges) as argument +# See https://github.com/gap-packages/NormalizInterface/issues/121 +# +gap> D := NmzCone(["equations",[[1..3]]]); + +gap> NmzEquations(D); +[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] + # gap> STOP_TEST("bugfix.tst", 0);