Closed whoburg closed 9 years ago
Partway there!
Currently validates primal feasibility, and that the sensitivities of free variables are close to 0.
Todo: (optional) we could evaluate both the primal and dual objective functions and make sure that they match. I can do this and/or explain how.
That would be great! I'm happy to implement it.
To implement -- gpkit.GP.__run_solver
already does some checks -- can add more there.
Note to do this using the A matrix / matrix math, etc., not substitution.
Will implement this once #226 is complete.
Closing this will close half of the remaining issues! (#125 and #217) Go @whoburg go. :p
where should this be implemented?
In geometric_program.solve()
Probably either just before or just after self.result = result
: before means that no bad result is made available if these checks fail, after means that the bad result is made available but not returned.
I should be able to work on this in a few hours.
Sorry for delay -- still getting to this, but I want to investigate a possible bug first that I consider higher priority. More info soon.
still psyched to implement this, but waiting until #338 and #335 are fixed.
@bqpd how do I best get the slice of A
corresponding to:
?
I think gp.A.tocsr()[0,:]
will get the objective, and >0 the constraints?
TypeError: 'coo_matrix' object has no attribute '__getitem__'
Also, that's just the first monomial in the objective, but I can deal with that via p_idxs
I think I have a solution where I don't actually need the answer to this, but I'm still curious...
Sparse matrices are fun!
(yeah, you need a CSR sparse matrix to index, hence the tocsr
above)
doh, my fault.
this is coming along -- hard at work
Very low priority:
We could create
GP.solution_check(self, sol)
. It would validate that a particular primal/dual solution pair solves the GP. Could be useful for sanity checks and trying out 'suspect' solution codes.This is very very very low priority.