9999b6e4d5022ef678087b221273378330a229bd,qiskit/optimization/converters/inequality_to_equality.py,InequalityToEquality,_add_integer_slack_var_linear_constraint,#InequalityToEquality#Any#Any#Any#Any#,176
Before Change
def _add_integer_slack_var_linear_constraint(self, linear, sense, rhs, name):
// If a coefficient that is not integer exist, raise error
if any(isinstance(coef, float) and not coef.is_integer() for coef in linear.values()):
raise QiskitOptimizationError("Can not use a slack variable for " + name)
// If rhs is float number, round up/down to the nearest integer.
new_rhs = rhs
if sense == Constraint.Sense.LE:
new_rhs = math.floor(rhs)
if sense == Constraint.Sense.GE:
After Change
def _add_integer_slack_var_linear_constraint(self, linear, sense, rhs, name):
// If a coefficient that is not integer exist, raise error
if self._contains_any_float_value(list(linear.values())):
raise QiskitOptimizationError(name + " contains float coefficients. "
"We can not use an integer slack variable for " + name)
// If rhs is float number, round up/down to the nearest integer.
new_rhs = rhs
if sense == Constraint.Sense.LE:
new_rhs = math.floor(rhs)
if sense == Constraint.Sense.GE:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: Qiskit/qiskit-aqua
Commit Name: 9999b6e4d5022ef678087b221273378330a229bd
Time: 2020-08-03
Author: 47442626+a-matsuo@users.noreply.github.com
File Name: qiskit/optimization/converters/inequality_to_equality.py
Class Name: InequalityToEquality
Method Name: _add_integer_slack_var_linear_constraint
Project Name: Qiskit/qiskit-aqua
Commit Name: 9999b6e4d5022ef678087b221273378330a229bd
Time: 2020-08-03
Author: 47442626+a-matsuo@users.noreply.github.com
File Name: qiskit/optimization/converters/inequality_to_equality.py
Class Name: InequalityToEquality
Method Name: _add_integer_slack_var_quadratic_constraint
Project Name: probcomp/bayeslite
Commit Name: ddc073c4a4670a29a9b474915bc33773c301f0f3
Time: 2017-01-27
Author: curlette@mit.edu
File Name: src/guess.py
Class Name:
Method Name: keyable_p