'Converts the solver output into standard form.
Parameters
results_dict : dict
The solver output.
data : dict
Information about the problem.
cached_data : dict
A map of solver name to cached problem data.
Returns
dict
The solver output in standard form.'

def format_results(self, results_dict, data, cached_data):

    solver_cache = cached_data[self.name()]
    dims = data[s.DIMS]
    new_results = {}
    status = self.STATUS_MAP[results_dict['info']['status']]
    new_results[s.STATUS] = status
    new_results[s.SOLVE_TIME] = (results_dict['info']['solveTime'] / 1000)
    new_results[s.SETUP_TIME] = (results_dict['info']['setupTime'] / 1000)
    new_results[s.NUM_ITERS] = results_dict['info']['iter']
    if (new_results[s.STATUS] in s.SOLUTION_PRESENT):
        solver_cache.prev_result = {'x': results_dict['x'], 'y': results_dict['y'], 's': results_dict['s']}
        primal_val = results_dict['info']['pobj']
        new_results[s.VALUE] = (primal_val + data[s.OFFSET])
        new_results[s.PRIMAL] = results_dict['x']
        new_results[s.EQ_DUAL] = results_dict['y'][:dims[s.EQ_DIM]]
        y = results_dict['y'][dims[s.EQ_DIM]:]
        old_sdp_sizes = sum([((n * (n + 1)) // 2) for n in dims[s.SDP_DIM]])
        new_sdp_sizes = sum([(n * n) for n in dims[s.SDP_DIM]])
        y_true = np.zeros((y.shape[0] + (new_sdp_sizes - old_sdp_sizes)))
        y_offset = (dims[s.LEQ_DIM] + sum([n for n in dims[s.SOC_DIM]]))
        y_true_offset = y_offset
        y_true[:y_true_offset] = y[:y_offset]
        for n in dims[s.SDP_DIM]:
            tri = y[y_offset:(y_offset + ((n * (n + 1)) // 2))]
            y_true[y_true_offset:(y_true_offset + (n * n))] = self.tri_to_full(tri, n)
            y_true_offset += (n * n)
            y_offset += ((n * (n + 1)) // 2)
        y_true[y_true_offset:] = y[y_offset:]
        new_results[s.INEQ_DUAL] = y_true
    else:
        solver_cache.prev_result = None
    return new_results
