From 8fa7d26e09c4e99775621b9e4df3a9cbfc6cd014 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 17 Sep 2024 22:12:37 -0400 Subject: [PATCH] More check(11, "SumsOfSquares") debugging Print the contents of the input and output files and only run the failing test to help filter out the noise. --- M2/Macaulay2/packages/SemidefiniteProgramming.m2 | 2 ++ M2/Macaulay2/packages/SumsOfSquares.m2 | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/packages/SemidefiniteProgramming.m2 b/M2/Macaulay2/packages/SemidefiniteProgramming.m2 index e86ab2f0ee..78b11be074 100644 --- a/M2/Macaulay2/packages/SemidefiniteProgramming.m2 +++ b/M2/Macaulay2/packages/SemidefiniteProgramming.m2 @@ -591,10 +591,12 @@ solveCSDP(Matrix,Sequence,Matrix) := o -> (C,A,b) -> ( writeCSDPparam(fparam); verbose1("Executing CSDP", o); verbose1("Input file: " | fin, o); + verbose1(get fin | newline, o); csdpRun := runProgram(csdpProgram, fin1 | " " | fout, RunDirectory => dir, KeepFiles => true, RaiseError => false); handleErrors(csdpRun#"return value", csdpRun#"error file", o.Verbosity); verbose1("Output file: " | fout, o); + verbose1(get fout | newline, o); fout2 := csdpRun#"output file"; (X,y,Z,sdpstatus) := readCSDP(fout,fout2,n,o.Verbosity); y = checkDualSol(C,A,y,Z,o.Verbosity); diff --git a/M2/Macaulay2/packages/SumsOfSquares.m2 b/M2/Macaulay2/packages/SumsOfSquares.m2 index 4243fb6347..452fcb4c02 100644 --- a/M2/Macaulay2/packages/SumsOfSquares.m2 +++ b/M2/Macaulay2/packages/SumsOfSquares.m2 @@ -1148,20 +1148,23 @@ checkLowerBound(String) := o -> (solver) -> ( ); --------------UNCONSTRAINED1-------------- + -* t0:= ( R := QQ[x]; f := (x-1)^2 + (x+3)^2; (bound,sol) := lowerBound(f, Solver=>solver,Verbosity=>o.Verbosity); equal(bound,8) ); + *- t1:= ( - R = RR[x,y]; - f = (x-exp(1)*y)^2 + x^2 + (y-4)^2; - (bound,sol) = lowerBound(f, Solver=>solver,Verbosity=>o.Verbosity); + R := RR[x,y]; + f := (x-exp(1)*y)^2 + x^2 + (y-4)^2; + (bound,sol) := lowerBound(f, Solver=>solver,Verbosity=>o.Verbosity); equal(bound,16*exp(2)/(2+exp(2))) ); + -* t2:= ( R = QQ[x,z]; f = x^4+x^2+z^6-3*x^2*z^2; @@ -1208,6 +1211,8 @@ checkLowerBound(String) := o -> (solver) -> ( ); {t0,t1,t2,t3,t4,t5,t6} + *- + {t1} ) --##########################################################################--