Skip to content

Commit

Permalink
More check(11, "SumsOfSquares") debugging
Browse files Browse the repository at this point in the history
Print the contents of the input and output files and only run the
failing test to help filter out the noise.
  • Loading branch information
d-torrance committed Sep 18, 2024
1 parent 6025c52 commit 8fa7d26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions M2/Macaulay2/packages/SemidefiniteProgramming.m2
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 8 additions & 3 deletions M2/Macaulay2/packages/SumsOfSquares.m2
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1208,6 +1211,8 @@ checkLowerBound(String) := o -> (solver) -> (
);
{t0,t1,t2,t3,t4,t5,t6}
*-
{t1}
)

--##########################################################################--
Expand Down

0 comments on commit 8fa7d26

Please sign in to comment.