Skip to content

remove simplification of monomial constants in posynomial#1061

Closed
bqpd wants to merge 1 commit intomasterfrom
fixsenss
Closed

remove simplification of monomial constants in posynomial#1061
bqpd wants to merge 1 commit intomasterfrom
fixsenss

Conversation

@bqpd
Copy link
Copy Markdown
Contributor

@bqpd bqpd commented Feb 23, 2017

Closes #1060

@bqpd
Copy link
Copy Markdown
Contributor Author

bqpd commented Feb 23, 2017

test models please

@bqpd
Copy link
Copy Markdown
Contributor Author

bqpd commented Feb 23, 2017

Looks like one of the engine tests doesn't run with cvxopt...anyway @whoburg this is ready for review and merging.

Copy link
Copy Markdown
Collaborator

@whoburg whoburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline. Needs the MWE from #1060 as a unit test. And I think @bqpd mentioned he has a better way to address this anyway?


def _simplify_posy_ineq(self, exps, cs):
def _check_constraint(self, exps, cs):
"Simplify a posy <= 1 by moving constants to the right side."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's improve this docstring and possibly the method name. What question does the boolean return value answer? What condition is _check_constraint checking?

# because they allow models to impose requirements
return (), np.array([])
return False
return exps, cs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's confusing that this method now sometimes returns a bool and sometimes returns exps, cs. Is that intended and does it really need to be that way?

"be converted to units of %s" %
(self.p_lt, self.m_gt))

p.exps, p.cs = self._simplify_posy_ineq(p.exps, p.cs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear to me why we should remove simplification. Seems like this was a mapping bug, not a simplification bug, right? Isn't this only an indirect fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was both!

@bqpd
Copy link
Copy Markdown
Contributor Author

bqpd commented Feb 27, 2017

Yup, I have a working branch which addresses this better. Will push soon!

@bqpd
Copy link
Copy Markdown
Contributor Author

bqpd commented Feb 28, 2017

Superseded by #1064

@bqpd bqpd closed this Feb 28, 2017
@bqpd bqpd deleted the fixsenss branch February 28, 2017 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants