Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 6, 2023. It is now read-only.

Commit 19f75da

Browse files
committed
try fix lmi_old_oracle not covered problem
1 parent a13820b commit 19f75da

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/build*
22
/.vscode
33
/cpm_modules
4-
.DS_Store
4+
/.cache
5+
.DS_Store

test/source/test_lmi_old.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
// #include <xtensor-blas/xlinalg.hpp>
2323

2424
/**
25-
* @brief my_oracle
25+
* @brief my_old_oracle
2626
*
2727
*/
28-
class my_oracle {
28+
class my_old_oracle {
2929
using Arr = xt::xarray<double, xt::layout_type::row_major>;
3030
using M_t = std::vector<Arr>;
3131
using Cut = std::tuple<Arr, double>;
@@ -45,8 +45,8 @@ class my_oracle {
4545
* @param[in] B2
4646
* @param[in] c
4747
*/
48-
my_oracle(gsl::span<const Arr> F1, Arr B1, gsl::span<const Arr> F2, Arr B2,
49-
Arr c)
48+
my_old_oracle(gsl::span<const Arr> F1, Arr B1, gsl::span<const Arr> F2,
49+
Arr B2, Arr c)
5050
: lmi1{F1, std::move(B1)}, lmi2{F2, std::move(B2)}, c{std::move(c)} {}
5151

5252
/**
@@ -90,7 +90,7 @@ TEST_CASE("LMI (old) test") {
9090
{{-5.0, 2.0, -17.0}, {2.0, -6.0, 8.0}, {-17.0, 8.0, 6.0}}};
9191
auto B2 = Arr{{14.0, 9.0, 40.0}, {9.0, 91.0, 10.0}, {40.0, 10.0, 15.0}};
9292
auto c = Arr{1.0, -1.0, 1.0};
93-
auto P = my_oracle(F1, std::move(B1), F2, std::move(B2), std::move(c));
93+
auto P = my_old_oracle(F1, std::move(B1), F2, std::move(B2), std::move(c));
9494
auto E = ell(10.0, Arr{0.0, 0.0, 0.0});
9595
auto t = 1e100; // std::numeric_limits<double>::max()
9696
const auto [x, ell_info] = cutting_plane_dc(P, E, t);
@@ -115,7 +115,7 @@ TEST_CASE("LMI (old) test (stable)") {
115115
{{-5.0, 2.0, -17.0}, {2.0, -6.0, 8.0}, {-17.0, 8.0, 6.0}}};
116116
auto B2 = Arr{{14.0, 9.0, 40.0}, {9.0, 91.0, 10.0}, {40.0, 10.0, 15.0}};
117117
auto c = Arr{1.0, -1.0, 1.0};
118-
auto P = my_oracle(F1, std::move(B1), F2, std::move(B2), std::move(c));
118+
auto P = my_old_oracle(F1, std::move(B1), F2, std::move(B2), std::move(c));
119119
auto E = ell_stable(10.0, Arr{0.0, 0.0, 0.0});
120120
auto t = 1e100; // std::numeric_limits<double>::max()
121121
const auto [x, ell_info] = cutting_plane_dc(P, E, t);

0 commit comments

Comments
 (0)