File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,6 +188,18 @@ namespace linspire
188188 */
189189 [[nodiscard]] const std::vector<std::shared_ptr<const constraint>> &get_conflict () const noexcept { return cnfl; }
190190
191+ /* *
192+ * @brief Checks if two linear expressions can be made equal.
193+ *
194+ * This function determines whether two linear expressions `l0` and `l1` can take on equal values
195+ * based on the current constraints in the solver.
196+ *
197+ * @param l0 The first linear expression to compare.
198+ * @param l1 The second linear expression to compare.
199+ * @return true if the linear expressions can be equal; false otherwise.
200+ */
201+ [[nodiscard]] bool match (const utils::lin &l0, const utils::lin &l1) const noexcept ;
202+
191203#ifdef LINSPIRE_ENABLE_LISTENERS
192204 /* *
193205 * @brief Adds a listener to the solver.
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ namespace linspire
185185 }
186186 }
187187
188+ bool solver::match (const utils::lin &l0, const utils::lin &l1) const noexcept { return lb (l0) <= ub (l1) && ub (l0) >= lb (l1); }
189+
188190 bool solver::set_lb (const utils::var x, const utils::inf_rational &v, std::shared_ptr<constraint> reason) noexcept
189191 {
190192 assert (x < vars.size ());
You can’t perform that action at this time.
0 commit comments