IAP GITLAB

Commit be76ac6b authored by Ralf Ulrich's avatar Ralf Ulrich

Merge branch 'curved_tracking' into 'master'

Curved tracking

See merge request !316
parents e845cfd7 8bf837b8
Pipeline #3515 passed with stages
in 18 minutes and 38 seconds
......@@ -23,12 +23,13 @@ namespace corsika {
template <typename TClass, typename TRet, typename... TArgs,
TRet (TClass::*TFuncPtr)(TArgs...), typename TTimer>
ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj)
inline ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj)
: ClassTimerImpl<TClass, TTimer>(obj) {}
template <typename TClass, typename TRet, typename... TArgs,
TRet (TClass::*TFuncPtr)(TArgs...), typename TTimer>
TRet ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(TArgs... args) {
inline TRet ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(
TArgs... args) {
this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now();
auto tmp = (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...);
this->timeDiff_ = std::chrono::duration_cast<
......@@ -41,12 +42,13 @@ namespace corsika {
template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...),
typename TTimer>
ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj)
inline ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj)
: ClassTimerImpl<TClass, TTimer>(obj) {}
template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...),
typename TTimer>
void ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(TArgs... args) {
inline void ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(
TArgs... args) {
this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now();
(this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...);
this->timeDiff_ = std::chrono::duration_cast<
......@@ -59,12 +61,13 @@ namespace corsika {
template <typename TClass, typename TRet, typename... TArgs,
TRet (TClass::*TFuncPtr)(TArgs...) const, typename TTimer>
ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(TClass& obj)
inline ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(
TClass& obj)
: ClassTimerImpl<TClass, TTimer>(obj) {}
template <typename TClass, typename TRet, typename... TArgs,
TRet (TClass::*TFuncPtr)(TArgs...) const, typename TTimer>
TRet ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call(
inline TRet ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call(
TArgs... args) {
this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now();
auto tmp = (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...);
......@@ -77,12 +80,13 @@ namespace corsika {
/// Specialisation 3
template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...) const,
typename TTimer>
ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(TClass& obj)
inline ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(
TClass& obj)
: ClassTimerImpl<TClass, TTimer>(obj) {}
template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...) const,
typename TTimer>
void ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call(
inline void ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call(
TArgs... args) {
this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now();
(this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...);
......@@ -92,4 +96,4 @@ namespace corsika {
return;
}
} // namespace corsika
\ No newline at end of file
} // namespace corsika
......@@ -13,12 +13,12 @@
namespace corsika {
template <typename TFunc, typename TTime>
FunctionTimer<TFunc, TTime>::FunctionTimer(TFunc f)
inline FunctionTimer<TFunc, TTime>::FunctionTimer(TFunc f)
: function_(f) {}
template <typename TFunc, typename TTime>
template <typename... TArgs>
auto FunctionTimer<TFunc, TTime>::operator()(TArgs&&... args)
inline auto FunctionTimer<TFunc, TTime>::operator()(TArgs&&... args)
-> std::invoke_result_t<TFunc, TArgs...> {
this->startTimer();
auto tmp = function_(std::forward<TArgs>(args)...);
......
......@@ -18,9 +18,6 @@
#include <corsika/framework/stack/SecondaryView.hpp>
#include <corsika/media/Environment.hpp>
#include <corsika/setup/SetupStack.hpp>
#include <corsika/setup/SetupTrajectory.hpp>
#include <cassert>
#include <cmath>
#include <iostream>
......@@ -31,7 +28,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
void Cascade<TTracking, TProcessList, TStack, TStackView>::run() {
inline void Cascade<TTracking, TProcessList, TStack, TStackView>::run() {
setNodes(); // put each particle on stack in correct environment volume
while (!stack_.isEmpty()) {
......@@ -58,7 +55,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
void Cascade<TTracking, TProcessList, TStack, TStackView>::forceInteraction() {
inline void Cascade<TTracking, TProcessList, TStack, TStackView>::forceInteraction() {
CORSIKA_LOG_TRACE("forced interaction!");
setNodes();
auto vParticle = stack_.getNextParticle();
......@@ -70,7 +67,8 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
void Cascade<TTracking, TProcessList, TStack, TStackView>::step(Particle& vParticle) {
inline void Cascade<TTracking, TProcessList, TStack, TStackView>::step(
Particle& vParticle) {
// determine combined total interaction length (inverse)
InverseGrammageType const total_inv_lambda =
......@@ -139,7 +137,6 @@ namespace corsika {
distance_interact / 1_m, continuous_max_dist / 1_m);
// here the particle is actually moved along the trajectory to new position:
// std::visit(setup::ParticleUpdate<particle_type>{vParticle}, step);
step.setLength(min_distance);
vParticle.setPosition(step.getPosition(1));
// assumption: tracking does not change absolute momentum:
......@@ -240,7 +237,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::decay(
inline ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::decay(
TStackView& view) {
CORSIKA_LOG_DEBUG("decay");
InverseTimeType const actual_decay_time = sequence_.getInverseLifetime(view.parent());
......@@ -258,7 +255,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::interaction(
inline ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::interaction(
TStackView& view) {
CORSIKA_LOG_DEBUG("collide");
......@@ -278,7 +275,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
void Cascade<TTracking, TProcessList, TStack, TStackView>::setNodes() {
inline void Cascade<TTracking, TProcessList, TStack, TStackView>::setNodes() {
std::for_each(stack_.begin(), stack_.end(), [&](auto& p) {
auto const* numericalNode =
environment_.getUniverse()->getContainingNode(p.getPosition());
......@@ -288,7 +285,7 @@ namespace corsika {
template <typename TTracking, typename TProcessList, typename TStack,
typename TStackView>
void Cascade<TTracking, TProcessList, TStack, TStackView>::setEventType(
inline void Cascade<TTracking, TProcessList, TStack, TStackView>::setEventType(
TStackView& view, [[maybe_unused]] history::EventType eventType) {
if constexpr (TStackView::has_event) {
for (auto&& sec : view) { sec.getEvent()->setEventType(eventType); }
......
......@@ -13,72 +13,74 @@
namespace corsika {
HEPEnergyType constexpr get_energy_threshold(Code const p) {
inline HEPEnergyType constexpr get_energy_threshold(Code const p) {
return particle::detail::thresholds[static_cast<CodeIntType>(p)];
}
void constexpr set_energy_threshold(Code const p, HEPEnergyType const val) {
inline void constexpr set_energy_threshold(Code const p, HEPEnergyType const val) {
particle::detail::thresholds[static_cast<CodeIntType>(p)] = val;
}
HEPMassType constexpr get_mass(Code const p) {
inline HEPMassType constexpr get_mass(Code const p) {
if (p == Code::Nucleus)
throw std::runtime_error("Cannot GetMass() of particle::Nucleus -> unspecified");
return particle::detail::masses[static_cast<CodeIntType>(p)];
}
PDGCode constexpr get_PDG(Code const p) {
inline PDGCode constexpr get_PDG(Code const p) {
return particle::detail::pdg_codes[static_cast<CodeIntType>(p)];
}
int16_t constexpr get_charge_number(Code const code) {
inline int16_t constexpr get_charge_number(Code const code) {
if (code == Code::Nucleus)
throw std::runtime_error("charge of particle::Nucleus undefined");
return particle::detail::electric_charges[static_cast<CodeIntType>(code)];
}
ElectricChargeType constexpr get_charge(Code const code) {
inline ElectricChargeType constexpr get_charge(Code const code) {
return get_charge_number(code) * constants::e;
}
std::string_view constexpr get_name(Code const code) {
inline std::string_view constexpr get_name(Code const code) {
return particle::detail::names[static_cast<CodeIntType>(code)];
}
TimeType constexpr get_lifetime(Code const p) {
inline TimeType constexpr get_lifetime(Code const p) {
return particle::detail::lifetime[static_cast<CodeIntType>(p)] * second;
}
bool constexpr is_hadron(Code const p) {
inline bool constexpr is_hadron(Code const p) {
return particle::detail::isHadron[static_cast<CodeIntType>(p)];
}
bool constexpr is_em(Code c) {
inline bool constexpr is_em(Code c) {
return c == Code::Electron || c == Code::Positron || c == Code::Gamma;
}
bool constexpr is_muon(Code c) { return c == Code::MuPlus || c == Code::MuMinus; }
inline bool constexpr is_muon(Code c) {
return c == Code::MuPlus || c == Code::MuMinus;
}
bool constexpr is_neutrino(Code c) {
inline bool constexpr is_neutrino(Code c) {
return c == Code::NuE || c == Code::NuMu || c == Code::NuTau || c == Code::NuEBar ||
c == Code::NuMuBar || c == Code::NuTauBar;
}
int constexpr get_nucleus_A(Code const code) {
inline int constexpr get_nucleus_A(Code const code) {
if (code == Code::Nucleus) {
throw std::runtime_error("get_nucleus_A(Code::Nucleus) is impossible!");
}
return particle::detail::nucleusA[static_cast<CodeIntType>(code)];
}
int constexpr get_nucleus_Z(Code const code) {
inline int constexpr get_nucleus_Z(Code const code) {
if (code == Code::Nucleus) {
throw std::runtime_error("get_nucleus_Z(Code::Nucleus) is impossible!");
}
return particle::detail::nucleusZ[static_cast<CodeIntType>(code)];
}
bool constexpr is_nucleus(Code const code) {
inline bool constexpr is_nucleus(Code const code) {
return (code == Code::Nucleus) || (get_nucleus_A(code) != 0);
}
......@@ -102,7 +104,7 @@ namespace corsika {
return get_mass(Code::Proton) * Z + (A - Z) * get_mass(Code::Neutron);
}
std::initializer_list<Code> constexpr get_all_particles() {
inline std::initializer_list<Code> constexpr get_all_particles() {
return particle::detail::all_particles;
}
......
......@@ -14,17 +14,18 @@
namespace corsika {
template <typename TDimension>
CoordinateSystemPtr BaseVector<TDimension>::getCoordinateSystem() const {
inline CoordinateSystemPtr BaseVector<TDimension>::getCoordinateSystem() const {
return cs_;
}
template <typename TDimension>
QuantityVector<TDimension> const& BaseVector<TDimension>::getQuantityVector() const {
inline QuantityVector<TDimension> const& BaseVector<TDimension>::getQuantityVector()
const {
return quantityVector_;
}
template <typename TDimension>
QuantityVector<TDimension>& BaseVector<TDimension>::getQuantityVector() {
inline QuantityVector<TDimension>& BaseVector<TDimension>::getQuantityVector() {
return quantityVector_;
}
......
......@@ -19,9 +19,11 @@
namespace corsika {
CoordinateSystemPtr CoordinateSystem::getReferenceCS() const { return referenceCS_; }
inline CoordinateSystemPtr CoordinateSystem::getReferenceCS() const {
return referenceCS_;
}
EigenTransform const& CoordinateSystem::getTransform() const { return transf_; }
inline EigenTransform const& CoordinateSystem::getTransform() const { return transf_; }
inline bool CoordinateSystem::operator==(CoordinateSystem const& cs) const {
return referenceCS_ == cs.referenceCS_ && transf_.matrix() == cs.transf_.matrix();
......
......@@ -15,47 +15,47 @@
namespace corsika {
template <typename TTimeType, typename TSpaceVecType>
TTimeType FourVector<TTimeType, TSpaceVecType>::getTimeLikeComponent() const {
inline TTimeType FourVector<TTimeType, TSpaceVecType>::getTimeLikeComponent() const {
return timeLike_;
}
template <typename TTimeType, typename TSpaceVecType>
TSpaceVecType& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() {
inline TSpaceVecType& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() {
return spaceLike_;
}
template <typename TTimeType, typename TSpaceVecType>
TSpaceVecType const& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents()
const {
inline TSpaceVecType const&
FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() const {
return spaceLike_;
}
template <typename TTimeType, typename TSpaceVecType>
typename FourVector<TTimeType, TSpaceVecType>::norm_square_type
inline typename FourVector<TTimeType, TSpaceVecType>::norm_square_type
FourVector<TTimeType, TSpaceVecType>::getNormSqr() const {
return getTimeSquared() - spaceLike_.getSquaredNorm();
}
template <typename TTimeType, typename TSpaceVecType>
typename FourVector<TTimeType, TSpaceVecType>::norm_type
inline typename FourVector<TTimeType, TSpaceVecType>::norm_type
FourVector<TTimeType, TSpaceVecType>::getNorm() const {
return sqrt(abs(getNormSqr()));
}
template <typename TTimeType, typename TSpaceVecType>
bool FourVector<TTimeType, TSpaceVecType>::isTimelike() const {
inline bool FourVector<TTimeType, TSpaceVecType>::isTimelike() const {
return getTimeSquared() < spaceLike_.getSquaredNorm();
}
template <typename TTimeType, typename TSpaceVecType>
bool FourVector<TTimeType, TSpaceVecType>::isSpacelike() const {
inline bool FourVector<TTimeType, TSpaceVecType>::isSpacelike() const {
return getTimeSquared() > spaceLike_.getSquaredNorm();
}
template <typename TTimeType, typename TSpaceVecType>
FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator+=(
FourVector const& b) {
inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::
operator+=(FourVector const& b) {
timeLike_ += b.timeLike_;
spaceLike_ += b.spaceLike_;
......@@ -63,38 +63,38 @@ namespace corsika {
}
template <typename TTimeType, typename TSpaceVecType>
FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator-=(
FourVector const& b) {
inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::
operator-=(FourVector const& b) {
timeLike_ -= b.timeLike_;
spaceLike_ -= b.spaceLike_;
return *this;
}
template <typename TTimeType, typename TSpaceVecType>
FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator*=(
double const b) {
inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::
operator*=(double const b) {
timeLike_ *= b;
spaceLike_ *= b;
return *this;
}
template <typename TTimeType, typename TSpaceVecType>
FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator/=(
double const b) {
inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::
operator/=(double const b) {
timeLike_ /= b;
spaceLike_.getComponents() /= b;
return *this;
}
template <typename TTimeType, typename TSpaceVecType>
FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator/(
double const b) {
inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::
operator/(double const b) {
*this /= b;
return *this;
}
template <typename TTimeType, typename TSpaceVecType>
typename FourVector<TTimeType, TSpaceVecType>::norm_type
inline typename FourVector<TTimeType, TSpaceVecType>::norm_type
FourVector<TTimeType, TSpaceVecType>::operator*(FourVector const& b) {
if constexpr (std::is_same<time_type, decltype(std::declval<space_type>() / meter *
second)>::value)
......@@ -104,7 +104,7 @@ namespace corsika {
}
template <typename TTimeType, typename TSpaceVecType>
typename FourVector<TTimeType, TSpaceVecType>::norm_square_type
inline typename FourVector<TTimeType, TSpaceVecType>::norm_square_type
FourVector<TTimeType, TSpaceVecType>::getTimeSquared() const {
if constexpr (std::is_same<time_type, decltype(std::declval<space_type>() / meter *
second)>::value)
......
......@@ -15,23 +15,23 @@
namespace corsika {
LengthType Helix::getRadius() const { return radius_; }
inline LengthType Helix::getRadius() const { return radius_; }
Point Helix::getPosition(TimeType const t) const {
inline Point Helix::getPosition(TimeType const t) const {
return r0_ + vPar_ * t +
(vPerp_ * (std::cos(omegaC_ * t) - 1) + uPerp_ * std::sin(omegaC_ * t)) /
omegaC_;
}
Point Helix::getPositionFromArclength(LengthType const l) const {
inline Point Helix::getPositionFromArclength(LengthType const l) const {
return getPosition(getTimeFromArclength(l));
}
LengthType Helix::getArcLength(TimeType const t1, TimeType const t2) const {
inline LengthType Helix::getArcLength(TimeType const t1, TimeType const t2) const {
return (vPar_ + vPerp_).getNorm() * (t2 - t1);
}
TimeType Helix::getTimeFromArclength(LengthType const l) const {
inline TimeType Helix::getTimeFromArclength(LengthType const l) const {
return l / (vPar_ + vPerp_).getNorm();
}
......
......@@ -26,7 +26,7 @@ namespace corsika {
inline Point const& Plane::getCenter() const { return center_; }
inline Plane::DimLessVec const& Plane::getNormal() const { return normal_; }
inline DirectionVector const& Plane::getNormal() const { return normal_; }
inline std::string Plane::asString() const {
std::ostringstream txt;
......
......@@ -15,11 +15,11 @@
namespace corsika {
QuantityVector<length_d> const& Point::getCoordinates() const {
inline QuantityVector<length_d> const& Point::getCoordinates() const {
return BaseVector<length_d>::getQuantityVector();
}
QuantityVector<length_d>& Point::getCoordinates() {
inline QuantityVector<length_d>& Point::getCoordinates() {
return BaseVector<length_d>::getQuantityVector();
}
......@@ -60,7 +60,8 @@ namespace corsika {
}
/// this always returns a QuantityVector as triple
QuantityVector<length_d> Point::getCoordinates(CoordinateSystemPtr const& pCS) const {
inline QuantityVector<length_d> Point::getCoordinates(
CoordinateSystemPtr const& pCS) const {
CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem();
if (*pCS == *cs) {
return BaseVector<length_d>::getQuantityVector();
......@@ -72,12 +73,12 @@ namespace corsika {
}
/// this always returns a QuantityVector as triple
QuantityVector<length_d>& Point::getCoordinates(CoordinateSystemPtr const& pCS) {
inline QuantityVector<length_d>& Point::getCoordinates(CoordinateSystemPtr const& pCS) {
if (*pCS != *BaseVector<length_d>::getCoordinateSystem()) { rebase(pCS); }
return BaseVector<length_d>::getQuantityVector();
}
void Point::rebase(CoordinateSystemPtr const& pCS) {
inline void Point::rebase(CoordinateSystemPtr const& pCS) {
BaseVector<length_d>::setQuantityVector(QuantityVector<length_d>(
get_transformation(*BaseVector<length_d>::getCoordinateSystem().get(),
*pCS.get()) *
......@@ -85,12 +86,12 @@ namespace corsika {
BaseVector<length_d>::setCoordinateSystem(pCS);
}
Point Point::operator+(Vector<length_d> const& pVec) const {
inline Point Point::operator+(Vector<length_d> const& pVec) const {
CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem();
return Point(cs, getCoordinates() + pVec.getComponents(cs));
}
Vector<length_d> Point::operator-(Point const& pB) const {
inline Vector<length_d> Point::operator-(Point const& pB) const {
CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem();
return Vector<length_d>(cs, getCoordinates() - pB.getCoordinates(cs));
}
......
......@@ -88,7 +88,7 @@ namespace corsika {
}
template <typename TDimension>
void Vector<TDimension>::rebase(CoordinateSystemPtr const& pCS) {
inline void Vector<TDimension>::rebase(CoordinateSystemPtr const& pCS) {
BaseVector<TDimension>::setQuantityVector(QuantityVector<TDimension>(
get_transformation(*BaseVector<TDimension>::getCoordinateSystem().get(),
*pCS.get())
......@@ -110,7 +110,7 @@ namespace corsika {
template <typename TDimension>
template <typename TDimension2>
auto Vector<TDimension>::getParallelProjectionOnto(
inline auto Vector<TDimension>::getParallelProjectionOnto(
Vector<TDimension2> const& pVec, CoordinateSystemPtr const& pCS) const {
auto const ourCompVec = getComponents(pCS);
auto const otherCompVec = pVec.getComponents(pCS);
......@@ -123,34 +123,36 @@ namespace corsika {
template <typename TDimension>
template <typename TDimension2>
auto Vector<TDimension>::getParallelProjectionOnto(
inline auto Vector<TDimension>::getParallelProjectionOnto(
Vector<TDimension2> const& pVec) const {
return getParallelProjectionOnto<TDimension2>(
pVec, BaseVector<TDimension>::getCoordinateSystem());
}
template <typename TDimension>
Vector<TDimension> Vector<TDimension>::operator+(Vector<TDimension> const& pVec) const {
inline Vector<TDimension> Vector<TDimension>::operator+(
Vector<TDimension> const& pVec) const {
CoordinateSystemPtr const& cs = BaseVector<TDimension>::getCoordinateSystem();
auto const components = getComponents(cs) + pVec.getComponents(cs);
return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(), components);
}
template <typename TDimension>
Vector<TDimension> Vector<TDimension>::operator-(Vector<TDimension> const& pVec) const {
inline Vector<TDimension> Vector<TDimension>::operator-(
Vector<TDimension> const& pVec) const {
CoordinateSystemPtr const& cs = BaseVector<TDimension>::getCoordinateSystem();
return Vector<TDimension>(cs, getComponents() - pVec.getComponents(cs));
}
template <typename TDimension>
auto& Vector<TDimension>::operator*=(double const p) {
inline auto& Vector<TDimension>::operator*=(double const p) {
BaseVector<TDimension>::getQuantityVector() *= p;