next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
SOS :: SDPResult

SDPResult -- result of an SDP computation

Description

This type encapsulates the result of an SDP computation.

i1 : R = QQ[x][t];
i2 : f = x^2 - 3*x - t;
i3 : sol = solveSOS (f, -t, RoundTol=>12)
Executing CSDP
Input file: /tmp/M2-21578-0/4.dat-s
Output file: /tmp/M2-21578-0/5
Status: SDP solved, primal-dual feasible
Start rational rounding

     +--------------+-----------------------+
o3 = | MomentMatrix | 2x2 matrix over RR_53 |
     +--------------+-----------------------+
     |  GramMatrix  |   2x2 matrix over QQ  |
     +--------------+-----------------------+
     |   Monomials  | 2x1 matrix over QQ[x] |
     +--------------+-----------------------+
     |  Parameters  |   1x1 matrix over QQ  |
     +--------------+-----------------------+

o3 : SDPResult
i4 : peek sol

o4 = SDPResult{GramMatrix => | 9/4  -3/2 |        }
                             | -3/2 1    |
               MomentMatrix => | 1       1.49979 |
                               | 1.49979 2.24938 |
               Monomials => | 1 |
                            | x |
               Parameters => | -9/4 |

The fields can be extracted with the operator # (missing documentation)

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 SOS polynomial can be recovered with sosPoly.

i6 : sosPoly sol

o6 = coeffs:
      9
     {-}
      4
     gens:
        2
     {- -x + 1}
        3

o6 : SOSPoly

Methods that use an object of class SDPResult :

For the programmer

The object SDPResult is a type, with ancestor classes HashTable < Thing.