Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/normaliz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,12 @@ bool GAPToNmz(mpq_class & out, Obj x)
template <typename Number>
static bool GAPToNmz(vector<Number> & 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;
}
Expand Down
9 changes: 9 additions & 0 deletions tst/bugfix.tst
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]);
<a Normaliz cone>
gap> NmzEquations(D);
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]

#
gap> STOP_TEST("bugfix.tst", 0);
Loading