commit 4ce0549f510d246c8f69c85c509fc2d13d882442 Author: Benjamin Lorenz Date: Thu Nov 9 11:15:06 2023 +0100 singular: support new return types for saturation command This was changed from (ideal, exponent) to just the ideal in singular 4-3-2p5. To allow older versions we keep using sat but support both return types instead of switching to the new sat_with_exp. diff --git a/bundled/singular/apps/ideal/src/singularIdeal.cc b/bundled/singular/apps/ideal/src/singularIdeal.cc index 4cbc00a6f4..bdade5c29d 100644 --- a/bundled/singular/apps/ideal/src/singularIdeal.cc +++ b/bundled/singular/apps/ideal/src/singularIdeal.cc @@ -236,22 +236,24 @@ public: arg.next->data=(void *)idCopy(J); // call primdecSY BOOLEAN res=iiMake_proc(sathdl, nullptr ,&arg); - if(!res && (iiRETURNEXPR.Typ() == LIST_CMD)){ - lists L = (lists)iiRETURNEXPR.Data(); - SingularIdeal_wrap* result; - if(L->m[0].Typ() == IDEAL_CMD){ - result = new SingularIdeal_impl((::ideal) (L->m[0].Data()),singRing); - } else { - throw std::runtime_error("Something went wrong for the primary decomposition"); + if(!res) { + ::ideal iddata = nullptr; + if (iiRETURNEXPR.Typ() == LIST_CMD) { + lists L = (lists)iiRETURNEXPR.Data(); + if(L->m[0].Typ() == IDEAL_CMD) + iddata = (::ideal) L->m[0].Data(); + } else if (iiRETURNEXPR.Typ() == IDEAL_CMD) { + iddata = (::ideal) iiRETURNEXPR.Data(); + } + if (iddata != nullptr) { + SingularIdeal_wrap* result = new SingularIdeal_impl(iddata, singRing); + iiRETURNEXPR.CleanUp(); + iiRETURNEXPR.Init(); + return result; } - iiRETURNEXPR.CleanUp(); - iiRETURNEXPR.Init(); - return result; - } else { - iiRETURNEXPR.Init(); - throw std::runtime_error("Something went wrong for the saturation"); } - + iiRETURNEXPR.Init(); + throw std::runtime_error("saturation: unable to parse ideal from return value"); } Array primary_decomposition() const