@@ -9,24 +9,24 @@ namespace linspire
99 utils::inf_rational var::get_lb () const noexcept { return lbs.empty () ? utils::rational::negative_infinite : lbs.rbegin ()->first ; }
1010 utils::inf_rational var::get_ub () const noexcept { return ubs.empty () ? utils::rational::positive_infinite : ubs.begin ()->first ; }
1111
12- void var::set_lb (const utils::inf_rational &v, std::shared_ptr<constraint> reason) noexcept
12+ void var::set_lb (const utils::inf_rational &v, std::shared_ptr<const constraint> reason) noexcept
1313 {
1414 assert (v <= get_ub ()); // we cannot set a lower bound greater than the current upper bound..
1515 if (reason)
1616 { // we add a new lower bound `v` with the given reason..
1717 if (auto it = lbs.find (v); it != lbs.end ())
1818 it->second .insert (reason); // we add the reason to the existing lower bound `v`..
1919 else
20- lbs.emplace (v, std::set<std::shared_ptr<constraint>>{reason}); // we create a new lower bound `v`..
20+ lbs.emplace (v, std::set<std::shared_ptr<const constraint>>{reason}); // we create a new lower bound `v`..
2121 }
2222 else
2323 { // we remove all the lower bounds that are less than `v`..
2424 auto it = lbs.upper_bound (v);
2525 lbs.erase (lbs.begin (), it);
26- lbs.emplace (v, std::set<std::shared_ptr<constraint>>());
26+ lbs.emplace (v, std::set<std::shared_ptr<const constraint>>());
2727 }
2828 }
29- void var::unset_lb (const utils::inf_rational &v, std::shared_ptr<constraint> reason) noexcept
29+ void var::unset_lb (const utils::inf_rational &v, std::shared_ptr<const constraint> reason) noexcept
3030 {
3131 assert (lbs.find (v) != lbs.end ());
3232 assert (reason);
@@ -36,24 +36,24 @@ namespace linspire
3636 lbs.erase (it);
3737 }
3838
39- void var::set_ub (const utils::inf_rational &v, std::shared_ptr<constraint> reason) noexcept
39+ void var::set_ub (const utils::inf_rational &v, std::shared_ptr<const constraint> reason) noexcept
4040 {
4141 assert (v >= get_lb ()); // we cannot set an upper bound less than the current lower bound..
4242 if (reason)
4343 { // we add a new upper bound `v` with the given reason..
4444 if (auto it = ubs.find (v); it != ubs.end ())
4545 it->second .insert (reason); // we add the reason to the existing upper bound `v`..
4646 else
47- ubs.emplace (v, std::set<std::shared_ptr<constraint>>{reason}); // we create a new upper bound `v`..
47+ ubs.emplace (v, std::set<std::shared_ptr<const constraint>>{reason}); // we create a new upper bound `v`..
4848 }
4949 else
5050 { // we remove all the upper bounds that are greater than `v`..
5151 auto it = ubs.lower_bound (v);
5252 ubs.erase (it, ubs.end ());
53- ubs.emplace (v, std::set<std::shared_ptr<constraint>>());
53+ ubs.emplace (v, std::set<std::shared_ptr<const constraint>>());
5454 }
5555 }
56- void var::unset_ub (const utils::inf_rational &v, std::shared_ptr<constraint> reason) noexcept
56+ void var::unset_ub (const utils::inf_rational &v, std::shared_ptr<const constraint> reason) noexcept
5757 {
5858 assert (ubs.find (v) != ubs.end ());
5959 assert (reason);
0 commit comments