This type encapsulates the result of a semidefinite programming computation.
i1 : R = QQ[x][t]; |
i2 : f = x^2 - 3*x - t; |
i3 : sol = solveSOS (f, -t, RoundTol=>12) o3 = MomentMatrix 2x2 matrix over RR_53 GramMatrix 2x2 matrix over QQ Monomials 2x1 matrix over QQ[x] Parameters 1x1 matrix over QQ Status SDP solved, primal-dual feasible o3 : SDPResult |
i4 : peek sol o4 = SDPResult{GramMatrix => | 9/4 -3/2 | } | -3/2 1 | MomentMatrix => | 1 1.5 | | 1.5 2.25 | Monomials => | 1 | | x | Parameters => | -9/4 | Status => SDP solved, primal-dual feasible |
The fields can be extracted with the operator #.
i5 : sol#GramMatrix o5 = | 9/4 -3/2 | | -3/2 1 | 2 2 o5 : Matrix QQ <--- QQ |
If the Gram matrix is different from null, then the sum-of-squares polynomial can be recovered with sosPoly.
i6 : sosPoly sol 9 2 2 o6 = (-)(- -x + 1) 4 3 o6 : SOSPoly |