'Updates the problem state given the solver results.
Updates problem.status, problem.value and value of
primal and dual variables.
Parameters
results_dict : dict
A dictionary containing the solver results.
sym_data : SymData
The symbolic data for the problem.
solver : Solver
The solver type used to obtain the results.'

def _update_problem_state(self, results_dict, sym_data, solver):

    if (results_dict[s.STATUS] in s.SOLUTION_PRESENT):
        self._save_values(results_dict[s.PRIMAL], self.variables(), sym_data.var_offsets)
        if (s.EQ_DUAL in results_dict):
            self._save_dual_values(results_dict[s.EQ_DUAL], sym_data.constr_map[s.EQ], [EqConstraint])
        if (s.INEQ_DUAL in results_dict):
            self._save_dual_values(results_dict[s.INEQ_DUAL], sym_data.constr_map[s.LEQ], [LeqConstraint, PSDConstraint])
        value = results_dict[s.VALUE]
        self._value = self.objective.primal_to_result(value)
    elif (results_dict[s.STATUS] in s.INF_OR_UNB):
        self._handle_no_solution(results_dict[s.STATUS])
    else:
        raise SolverError(("Solver    '%s'    failed.    Try    another    solver." % solver.name()))
    self._status = results_dict[s.STATUS]
    self._solver_stats = SolverStats(results_dict, solver.name())
