Skip to content
Snippets Groups Projects
Commit 8a1d6695 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

-auto, +emplace

parent d000bd13
No related branches found
No related tags found
1 merge request!145new class SliceStack
...@@ -45,7 +45,7 @@ SpecularMagneticStrategy::Execute(const SliceStack& slices, const std::vector<co ...@@ -45,7 +45,7 @@ SpecularMagneticStrategy::Execute(const SliceStack& slices, const std::vector<co
ISpecularStrategy::coeffs_t result; ISpecularStrategy::coeffs_t result;
for (auto& coeff : computeTR(slices, kz)) for (auto& coeff : computeTR(slices, kz))
result.push_back(std::make_unique<MatrixRTCoefficients>(coeff)); result.emplace_back(std::make_unique<MatrixRTCoefficients>(coeff));
return result; return result;
} }
......
...@@ -48,7 +48,7 @@ ISpecularStrategy::coeffs_t SpecularScalarStrategy::Execute(const SliceStack& sl ...@@ -48,7 +48,7 @@ ISpecularStrategy::coeffs_t SpecularScalarStrategy::Execute(const SliceStack& sl
ISpecularStrategy::coeffs_t result; ISpecularStrategy::coeffs_t result;
for (auto& coeff : computeTR(slices, kz)) for (auto& coeff : computeTR(slices, kz))
result.push_back(std::make_unique<ScalarRTCoefficients>(coeff)); result.emplace_back(std::make_unique<ScalarRTCoefficients>(coeff));
return result; return result;
} }
...@@ -60,7 +60,7 @@ SpecularScalarStrategy::computeTopLayerR(const SliceStack& slices, ...@@ -60,7 +60,7 @@ SpecularScalarStrategy::computeTopLayerR(const SliceStack& slices,
if (slices.size() != kz.size()) if (slices.size() != kz.size())
throw std::runtime_error("Number of slices does not match the size of the kz-vector"); throw std::runtime_error("Number of slices does not match the size of the kz-vector");
auto N = slices.size(); const size_t N = slices.size();
if (N == 1) if (N == 1)
return 0.; // only one layer present, there's nothing left to calculate return 0.; // only one layer present, there's nothing left to calculate
...@@ -115,7 +115,7 @@ void SpecularScalarStrategy::calculateUpFromLayer(std::vector<ScalarRTCoefficien ...@@ -115,7 +115,7 @@ void SpecularScalarStrategy::calculateUpFromLayer(std::vector<ScalarRTCoefficien
const SliceStack& slices, const SliceStack& slices,
const std::vector<complex_t>& kz) const const std::vector<complex_t>& kz) const
{ {
auto N = slices.size(); const size_t N = slices.size();
coeff.back().t_r(0) = 1.0; coeff.back().t_r(0) = 1.0;
coeff.back().t_r(1) = 0.0; coeff.back().t_r(1) = 0.0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment