/** Create a new constraint of the form \f$e = 0\f$. * \param e The expression * \param s The constraint's strength * \param weight The constraint's weight */ linear_equation(linear_expression e = linear_expression(0.0), const strength& s = strength::required(), double weight = 1.0) : linear_constraint(std::move(e), s, weight) { }
inline linear_equation operator== (const variable& lhs, const variable& rhs) { return linear_expression(lhs) -= rhs; }
inline linear_equation operator== (const variable& lhs, double rhs) { return linear_expression(lhs, 1, -rhs); }
EXPORT void* expression_equals_double(void* e1, double v) { linear_expression le1 = *reinterpret_cast<linear_expression*>(e1); linear_expression le2 = linear_expression(v); constraint* c = new constraint(linear_equation(le1, le2)); return reinterpret_cast<void*>(c); }