embotech/ecos

mistaken infostring in python wrapper

Closed this issue · 7 comments

Due to the following code in ecosmodule.c, which ignores the possible addition of ECOS_INACC_OFFSET. Any exit code which has been thus modified will fall into the "default" case and result in "UNKNOWN PROBLEM".

For example, exit code 10, which means "Close to Optimal solution found" is reported as "UNKNOWN PROBLEM IN SOLVER"

(I also note that for some reason there is no test for ECOS_FATAL... I assume the intent was to translate that into "UNKNOWN PROBLEM IN SOLVER" but it would be more clear to make it an explicit switch case.)

ecosmodule.c, beginning at line 538:

/* info dict */
  /* infostring */
  switch( exitcode ){
      case ECOS_OPTIMAL:
          infostring = "Optimal solution found";
          break;
      case ECOS_MAXIT:
          infostring = "Maximum number of iterations reached";
          break;
      case ECOS_PINF:
          infostring = "Primal infeasible";
          break;
      case ECOS_DINF:
          infostring = "Dual infeasible";
          break;
      case ECOS_NUMERICS:
          infostring = "Run into numerical problems";
          break;
      case ECOS_OUTCONE:
          infostring = "PROBLEM: Multipliers leaving the cone";
          break;
      default:
          infostring = "UNKNOWN PROBLEM IN SOLVER";
  }
echu commented

Wow. That's a really good catch. I'm slapping myself in the face for this.

echu commented

I pushed a change on the develop branch 9377794. Give it a shot.

Thanks, Eric. I'm afraid that I'm working in a locked-down environment at the moment so won't be able to test the change right away, but I'm sure it's fine. Thanks for the quick turnaround.
Steve

@steve3141 Did you get a chance to test Eric's fix?

Sorry, haven't been able to test yet (am working in a very locked-down environment so takes me a while to get updates.)

echu commented

@steve3141, we should have fixed this a while ago. I'm going to go ahead and close this issue. Thanks for bringing it up!

Thanks. Sorry I moved on and wasn't able to properly test your changes.Regards,Steve Steven Jaffe
steve_jaffe@yahoo.com
845 453 1000

  From: Eric Chu <notifications@github.com>

To: embotech/ecos ecos@noreply.github.com
Cc: steve3141 steve_jaffe@yahoo.com
Sent: Wednesday, July 15, 2015 11:40 AM
Subject: Re: [ecos] mistaken infostring in python wrapper (#79)

@steve3141, we should have fixed this a while ago. I'm going to go ahead and close this issue. Thanks for bringing it up!—
Reply to this email directly or view it on GitHub.