From 29e0230e9473204b4aceb7d37ab54e677d782706 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 17 Dec 2021 11:46:08 +0100 Subject: [PATCH] rename member variables --- Resample/Particle/ReCompound.cpp | 34 ++++++++++++++++---------------- Resample/Particle/ReCompound.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Resample/Particle/ReCompound.cpp b/Resample/Particle/ReCompound.cpp index e54f7773853..ed26f9468d3 100644 --- a/Resample/Particle/ReCompound.cpp +++ b/Resample/Particle/ReCompound.cpp @@ -18,68 +18,68 @@ ReCompound::~ReCompound() { - for (size_t index = 0; index < m_formfactors.size(); ++index) - delete m_formfactors[index]; + for (size_t index = 0; index < m_components.size(); ++index) + delete m_components[index]; } ReCompound* ReCompound::clone() const { auto* result = new ReCompound(); - for (size_t index = 0; index < m_formfactors.size(); ++index) - result->addFormFactor(*m_formfactors[index]); + for (size_t index = 0; index < m_components.size(); ++index) + result->addFormFactor(*m_components[index]); return result; } double ReCompound::radialExtension() const { double result{0.0}; - for (size_t index = 0; index < m_formfactors.size(); ++index) - result += m_formfactors[index]->radialExtension(); + for (size_t index = 0; index < m_components.size(); ++index) + result += m_components[index]->radialExtension(); return result; } double ReCompound::bottomZ(const IRotation* rotation) const { - if (m_formfactors.empty()) + if (m_components.empty()) throw std::runtime_error("ReCompound::bottomZ() -> Error: " "'this' contains no form factors."); return BaseUtils::algo::min_value( - m_formfactors.begin(), m_formfactors.end(), + m_components.begin(), m_components.end(), [&rotation](IReParticle* ff) { return ff->bottomZ(rotation); }); } double ReCompound::topZ(const IRotation* rotation) const { - if (m_formfactors.empty()) + if (m_components.empty()) throw std::runtime_error("ReCompound::topZ() -> Error: " "'this' contains no form factors."); - return BaseUtils::algo::max_value(m_formfactors.begin(), m_formfactors.end(), + return BaseUtils::algo::max_value(m_components.begin(), m_components.end(), [&rotation](IReParticle* ff) { return ff->topZ(rotation); }); } void ReCompound::addFormFactor(const IReParticle& formfactor) { - m_formfactors.push_back(formfactor.clone()); + m_components.push_back(formfactor.clone()); } void ReCompound::setAmbientMaterial(const Material& material) { - for (size_t index = 0; index < m_formfactors.size(); ++index) - m_formfactors[index]->setAmbientMaterial(material); + for (size_t index = 0; index < m_components.size(); ++index) + m_components[index]->setAmbientMaterial(material); } complex_t ReCompound::theFF(const WavevectorInfo& wavevectors) const { complex_t result(0.0, 0.0); - for (size_t index = 0; index < m_formfactors.size(); ++index) - result += m_formfactors[index]->theFF(wavevectors); + for (size_t index = 0; index < m_components.size(); ++index) + result += m_components[index]->theFF(wavevectors); return result; } Eigen::Matrix2cd ReCompound::thePolFF(const WavevectorInfo& wavevectors) const { Eigen::Matrix2cd result = Eigen::Matrix2cd::Zero(); - for (size_t index = 0; index < m_formfactors.size(); ++index) - result += m_formfactors[index]->thePolFF(wavevectors); + for (size_t index = 0; index < m_components.size(); ++index) + result += m_components[index]->thePolFF(wavevectors); return result; } diff --git a/Resample/Particle/ReCompound.h b/Resample/Particle/ReCompound.h index 0408d316cdf..6fd61867fdf 100644 --- a/Resample/Particle/ReCompound.h +++ b/Resample/Particle/ReCompound.h @@ -50,7 +50,7 @@ public: #endif protected: - std::vector<IReParticle*> m_formfactors; + std::vector<IReParticle*> m_components; }; #endif // BORNAGAIN_RESAMPLE_PARTICLE_RECOMPOUND_H -- GitLab