Skip to content

Commit 38c3df0

Browse files
committed
Added chip-user-bound-scale to TestUserScale.cpp
1 parent 34f0899 commit 38c3df0

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

check/TestUserScale.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,53 @@ TEST_CASE("user-scale-after-run", "[highs_user_scale]") {
6464
highs.resetGlobalScheduler(true);
6565
}
6666

67+
TEST_CASE("chip-user-bound-scale", "[highs_user_scale]") {
68+
Highs highs;
69+
const HighsInfo& info = highs.getInfo();
70+
const HighsSolution& solution = highs.getSolution();
71+
// highs.setOptionValue("output_flag", dev_run);
72+
highs.setOptionValue("presolve", kHighsOffString);
73+
HighsLp lp;
74+
lp.num_col_ = 2;
75+
lp.num_row_ = 2;
76+
lp.col_cost_ = {10, 25};
77+
lp.sense_ = ObjSense::kMaximize;
78+
lp.col_lower_ = {0, 0};
79+
lp.col_upper_ = {inf, inf};
80+
lp.row_lower_ = {-inf, -inf};
81+
lp.row_upper_ = {80, 120};
82+
lp.a_matrix_.start_ = {0, 2, 4};
83+
lp.a_matrix_.index_ = {0, 1, 0, 1};
84+
lp.a_matrix_.value_ = {1, 1, 2, 4};
85+
86+
highs.passModel(lp);
87+
88+
highs.run();
89+
REQUIRE(solution.col_value[0] == 40);
90+
REQUIRE(solution.col_value[1] == 20);
91+
92+
highs.clearSolver();
93+
94+
REQUIRE(highs.setOptionValue("user_bound_scale", 3) ==
95+
HighsStatus::kOk);
96+
97+
highs.run();
98+
REQUIRE(solution.col_value[0] == 40);
99+
REQUIRE(solution.col_value[1] == 20);
100+
101+
highs.clearSolver();
102+
103+
REQUIRE(highs.setOptionValue("user_bound_scale", -3) ==
104+
HighsStatus::kOk);
105+
106+
highs.run();
107+
REQUIRE(solution.col_value[0] == 40);
108+
REQUIRE(solution.col_value[1] == 20);
109+
110+
highs.resetGlobalScheduler(true);
111+
112+
}
113+
67114
TEST_CASE("user-small-cost-scale", "[highs_user_scale]") {
68115
Highs highs;
69116
const HighsInfo& info = highs.getInfo();

0 commit comments

Comments
 (0)