Skip to content

Commit

Permalink
capped msolveDefaultPrecision to 32bits
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Aug 7, 2024
1 parent 22f6460 commit e63bb8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions M2/Macaulay2/packages/Msolve.m2
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ lift(QQi, Number) := o -> (x, R) -> (
--------------------------------------------------------------------------------
msolveDefaultPrecision = 32 -- alternative: defaultPrecision
msolveRealSolutions = method(TypicalValue => List, Options => msolveDefaultOptions)
msolveRealSolutions Ideal := opt -> I0 -> msolveRealSolutions(I0, QQi, opt)
msolveRealSolutions(Ideal, RingFamily) := opt -> (I0, F) -> msolveRealSolutions(I0, default F, opt)
msolveRealSolutions Ideal := opt -> I0 -> msolveRealSolutions(I0, QQi, opt)
msolveRealSolutions(Ideal, RingFamily) := opt -> (I0, F) -> msolveRealSolutions(I0, F_msolveDefaultPrecision, opt)
msolveRealSolutions(Ideal, Ring) := opt -> (I0, F) -> (
if not any({QQ, QQi, RR_*, RRi_*}, F' -> ancestor(F', F))
then error "msolveRealSolutions: expected target field to be rationals, reals, or a rational or real interval field";
(S, K, I) := toMsolveRing I0;
prec := if precision F === infinity then defaultPrecision else precision F;
prec := if precision F === infinity then msolveDefaultPrecision else precision F;
mOut := msolve(S, K, I_*, "-p " | prec, opt);
-- format: [dim, [numlists, [ solution boxes ]]]
(d, solsp) := toSequence readMsolveList get mOut;
Expand Down

0 comments on commit e63bb8f

Please sign in to comment.