IAP GITLAB

Commit 896d611b authored by Ralf Ulrich's avatar Ralf Ulrich

fixed a lot of inlines and other details

parent 96339351
......@@ -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)...);
......
......@@ -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)...);
......
......@@ -28,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()) {
......@@ -55,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();
......@@ -67,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 =
......@@ -236,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());
......@@ -254,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");
......@@ -274,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());
......@@ -284,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();
}
......
......@@ -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;
return *this;
}
template <typename TDimension>
template <typename TScalarDim>
auto Vector<TDimension>::operator*(
inline auto Vector<TDimension>::operator*(
phys::units::quantity<TScalarDim, double> const p) const {
using ProdDim = phys::units::detail::product_d<TDimension, TScalarDim>;
......@@ -160,51 +162,51 @@ namespace corsika {
template <typename TDimension>
template <typename TScalarDim>
auto Vector<TDimension>::operator/(
inline auto Vector<TDimension>::operator/(
phys::units::quantity<TScalarDim, double> const p) const {
return (*this) * (1 / p);
}
template <typename TDimension>
auto Vector<TDimension>::operator*(double const p) const {
inline auto Vector<TDimension>::operator*(double const p) const {
return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(),
BaseVector<TDimension>::getQuantityVector() * p);
}
template <typename TDimension>
auto Vector<TDimension>::operator/(double const p) const {
inline auto Vector<TDimension>::operator/(double const p) const {
return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(),
BaseVector<TDimension>::getQuantityVector() / p);
}
template <typename TDimension>
auto& Vector<TDimension>::operator+=(Vector<TDimension> const& pVec) {
inline auto& Vector<TDimension>::operator+=(Vector<TDimension> const& pVec) {
BaseVector<TDimension>::getQuantityVector() +=
pVec.getComponents(BaseVector<TDimension>::getCoordinateSystem());
return *this;
}
template <typename TDimension>
auto& Vector<TDimension>::operator-=(Vector<TDimension> const& pVec) {
inline auto& Vector<TDimension>::operator-=(Vector<TDimension> const& pVec) {
BaseVector<TDimension>::getQuantityVector() -=
pVec.getComponents(BaseVector<TDimension>::getCoordinateSystem());
return *this;
}
template <typename TDimension>
auto& Vector<TDimension>::operator-() const {
inline auto& Vector<TDimension>::operator-() const {
return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(),
-BaseVector<TDimension>::getQuantityVector());
}
template <typename TDimension>
auto Vector<TDimension>::normalized() const {
inline auto Vector<TDimension>::normalized() const {
return (*this) * (1 / getNorm());
}
template <typename TDimension>
template <typename TDimension2>
auto Vector<TDimension>::cross(Vector<TDimension2> const& pV) const {
inline auto Vector<TDimension>::cross(Vector<TDimension2> const& pV) const {
auto const c1 = getComponents().eigenVector_;
auto const c2 =
pV.getComponents(BaseVector<TDimension>::getCoordinateSystem()).eigenVector_;
......@@ -216,7 +218,7 @@ namespace corsika {
template <typename TDimension>
template <typename TDimension2>
auto Vector<TDimension>::dot(Vector<TDimension2> const& pV) const {
inline auto Vector<TDimension>::dot(Vector<TDimension2> const& pV) const {
auto const c1 = getComponents().eigenVector_;
auto const c2 =
pV.getComponents(BaseVector<TDimension>::getCoordinateSystem()).eigenVector_;
......
......@@ -13,7 +13,7 @@
namespace corsika {
template <class TCountedProcess>
InteractionCounter<TCountedProcess>::InteractionCounter(TCountedProcess& process)
inline InteractionCounter<TCountedProcess>::InteractionCounter(TCountedProcess& process)
: process_(process) {}
template <class TCountedProcess>
......
......@@ -16,12 +16,12 @@
namespace corsika {
InteractionHistogram::InteractionHistogram()
inline InteractionHistogram::InteractionHistogram()
: inthist_cms_{detail::hist_factory(num_bins_cms, lower_edge_cms, upper_edge_cms)}
, inthist_lab_{detail::hist_factory(num_bins_lab, lower_edge_lab, upper_edge_lab)} {
}
void InteractionHistogram::fill(Code projectile_id, HEPEnergyType lab_energy,
inline void InteractionHistogram::fill(Code projectile_id, HEPEnergyType lab_energy,
HEPEnergyType mass_target, int A, int Z) {
auto constexpr inv_eV = 1 / 1_eV;
if (projectile_id == Code::Nucleus) {
......@@ -42,7 +42,7 @@ namespace corsika {