C++17: use structured bindings instead of std::tie

parent bff684e2
......@@ -34,8 +34,7 @@ FaaDiBruno::calculate(const StackContainer<FGSTensor> &cont,
out.zeros();
for (int l = 1; l <= out.dimen(); l++)
{
int max, mem_mb, p_size_mb;
std::tie(max, mem_mb, p_size_mb) = estimRefinement(out.getDims(), out.nrows(), l);
auto [max, mem_mb, p_size_mb] = estimRefinement(out.getDims(), out.nrows(), l);
FoldedFineContainer fine_cont(cont, max);
fine_cont.multAndAdd(l, f, out);
JournalRecord recc(journal);
......@@ -73,8 +72,7 @@ FaaDiBruno::calculate(const StackContainer<UGSTensor> &cont,
out.zeros();
for (int l = 1; l <= out.dimen(); l++)
{
int max, mem_mb, p_size_mb;
std::tie(max, mem_mb, p_size_mb) = estimRefinement(out.getDims(), out.nrows(), l);
auto [max, mem_mb, p_size_mb] = estimRefinement(out.getDims(), out.nrows(), l);
UnfoldedFineContainer fine_cont(cont, max);
fine_cont.multAndAdd(l, f, out);
JournalRecord recc(journal);
......
......@@ -86,8 +86,7 @@ KronProdDimens::KronProdDimens(const KronProdDimens &kd, int i)
void
KronProd::checkDimForMult(const ConstTwoDMatrix &in, const TwoDMatrix &out) const
{
int my_rows, my_cols;
std::tie(my_rows, my_cols) = kpd.getRC();
auto [my_rows, my_cols] = kpd.getRC();
TL_RAISE_IF(in.nrows() != out.nrows() || in.ncols() != my_rows,
"Wrong dimensions for KronProd in KronProd::checkDimForMult");
}
......@@ -231,8 +230,7 @@ KronProdIAI::mult(const ConstTwoDMatrix &in, TwoDMatrix &out) const
int id_cols = kpd.cols[0];
KronProdAI akronid(*this);
int in_bl_width, out_bl_width;
std::tie(in_bl_width, out_bl_width) = akronid.kpd.getRC();
auto [in_bl_width, out_bl_width] = akronid.kpd.getRC();
for (int i = 0; i < id_cols; i++)
{
......
......@@ -61,10 +61,8 @@ ss2Iteration_pruning(double *y2, double *y1, const double *yhat2, const double *
const double one = 1.0;
const blas_int ONE = 1;
#endif
std::vector<int> ii1, ii2, ii3;// vector indices for ghxx
std::tie(ii1, ii2, ii3) = set_vector_of_indices(n, m);
std::vector<int> jj1, jj2, jj3;// vector indices for ghuu
std::tie(jj1, jj2, jj3) = set_vector_of_indices(q, m);
auto [ii1, ii2, ii3] = set_vector_of_indices(n, m); // vector indices for ghxx
auto [jj1, jj2, jj3] = set_vector_of_indices(q, m); // vector indices for ghuu
#pragma omp parallel for num_threads(number_of_threads)
for (int particle = 0; particle < s; particle++)
{
......@@ -147,10 +145,8 @@ ss2Iteration(double *y, const double *yhat, const double *epsilon,
const double one = 1.0;
const blas_int ONE = 1;
#endif
std::vector<int> ii1, ii2, ii3;// vector indices for ghxx
std::tie(ii1, ii2, ii3) = set_vector_of_indices(n, m);
std::vector<int> jj1, jj2, jj3;// vector indices for ghuu
std::tie(jj1, jj2, jj3) = set_vector_of_indices(q, m);
auto [ii1, ii2, ii3] = set_vector_of_indices(n, m); // vector indices for ghxx
auto [jj1, jj2, jj3] = set_vector_of_indices(q, m); // vector indices for ghuu
#pragma omp parallel for num_threads(number_of_threads)
for (int particle = 0; particle < s; particle++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment