File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,8 +38,26 @@ namespace linspire
3838 return slack;
3939 }
4040
41- utils::inf_rational solver::lb (const utils::var x) const noexcept { return vars[x].get_lb (); }
42- utils::inf_rational solver::ub (const utils::var x) const noexcept { return vars[x].get_ub (); }
41+ utils::inf_rational solver::lb (const utils::var x) const noexcept
42+ {
43+ if (is_basic (x))
44+ {
45+ auto l = lb (tableau.at (x));
46+ return l > vars[x].get_lb () ? l : vars[x].get_lb ();
47+ }
48+ else
49+ return vars[x].get_lb ();
50+ }
51+ utils::inf_rational solver::ub (const utils::var x) const noexcept
52+ {
53+ if (is_basic (x))
54+ {
55+ auto u = ub (tableau.at (x));
56+ return u < vars[x].get_ub () ? u : vars[x].get_ub ();
57+ }
58+ else
59+ return vars[x].get_ub ();
60+ }
4361 utils::inf_rational solver::val (const utils::var x) const noexcept { return vars[x].val ; }
4462
4563 bool solver::new_eq (const utils::lin &lhs, const utils::lin &rhs, std::optional<std::reference_wrapper<constraint>> reason) noexcept
You can’t perform that action at this time.
0 commit comments