Ask Your Question

Revision history [back]

There seems not to be a method for that in Sage. Those values are not returned but printed by the method .print_ranges(), but you can still get the lines by doing:

sage: s = open(SAGE_TMP+"/ranges.tmp").readlines()

and then try to parse the list of strings s.

For example, if you want to extract the values of the "Slack Marginal" field, you can do:

sage: L = []
sage: interesting = False
sage: for line in s:
sage:     try:
sage:         if line[45:50] == 'Slack':
sage:             interesting = True
sage:     except IndexError:
sage:         pass
sage:     if line.startswith('GLPK'):
sage:         interesting = False
sage:     if interesting:
sage:         try:
sage:             L.append(RR(line[37:50]))
sage:         except TypeError:
sage:             pass

Note that i do not know the meaning of the isolated dots in this column (perhaps they mean 0 or something else), so you may have to adapt this.