Fix QP solver test: raw replacement that is working

This commit is contained in:
Sébastien Loriot 2021-01-29 10:05:48 +01:00
parent 51086d5678
commit a91f0239cd
2 changed files with 5 additions and 6 deletions

View File

@ -178,11 +178,10 @@ z_replace_original_by_original(ForwardIterator y_l_it,
// tmp_l -part // tmp_l -part
std::transform(y_l_it, (y_l_it+s), x_l.begin(), tmp_l.begin(), std::transform(y_l_it, (y_l_it+s), x_l.begin(), tmp_l.begin(),
[&s_delta](const ET& v1, const ET& v2){ return v1 + v2 * s_delta; }); [&s_delta](const ET& v1, const ET& v2){ return std::plus<ET>()(v1, s_delta * v2); });
// tmp_x -part // tmp_x -part
std::transform(y_x_it, (y_x_it+b), x_x.begin(), tmp_x.begin(), std::transform(y_x_it, (y_x_it+b), x_x.begin(), tmp_x.begin(),
[&s_delta](const ET& v1, const ET& v2){ return v1 + v2 * s_delta; }); [&s_delta](const ET& v1, const ET& v2){ return std::plus<ET>()(v1, s_delta * v2); });
tmp_x[k_i] -= d; tmp_x[k_i] -= d;
// prepare \hat{k}_{2} -scalar // prepare \hat{k}_{2} -scalar

View File

@ -1599,7 +1599,7 @@ ratio_test_1__q_x_S( Tag_false)
q_x_S.begin(), q_x_S.begin(),
[this](const ET& n1, const RT& n2) [this](const ET& n1, const RT& n2)
{ {
return n1 - this->d * NT_converter<RT,ET>() (n2); return std::minus<ET>()(n1,this->d * NT_converter<RT,ET>() (n2));
}); });
} }
@ -1940,13 +1940,13 @@ compute__x_B_S( Tag_false /*has_equalities_only_and_full_rank*/,
x_B_S.begin(), x_B_S.begin(),
x_B_S.begin(), x_B_S.begin(),
[this](const ET& n1, const ET& n2) [this](const ET& n1, const ET& n2)
{ return this->d * n1 - n2; }); { return std::minus<ET>()(this->d * n1, n2); });
// b_S_B - ( A_S_BxB_O * x_B_O) - r_S_B // b_S_B - ( A_S_BxB_O * x_B_O) - r_S_B
std::transform(x_B_S.begin(), x_B_S.begin()+S_B.size(), std::transform(x_B_S.begin(), x_B_S.begin()+S_B.size(),
r_S_B.begin(), x_B_S.begin(), r_S_B.begin(), x_B_S.begin(),
[this](const ET& n1, const ET& n2) [this](const ET& n1, const ET& n2)
{ return n1 - this->d * n2; }); { return std::minus<ET>()(n1, this->d * n2); });
// x_B_S = +- ( b_S_B - A_S_BxB_O * x_B_O) // x_B_S = +- ( b_S_B - A_S_BxB_O * x_B_O)
Value_iterator x_it = x_B_S.begin(); Value_iterator x_it = x_B_S.begin();