IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 967e8235 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

moved sgn function into separate file for reuse

parent 83a12df1
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ set ( ...@@ -27,6 +27,7 @@ set (
COMBoost.h COMBoost.h
Bit.h Bit.h
Singleton.h Singleton.h
sgn.h
CorsikaFenv.h CorsikaFenv.h
MetaProgramming.h MetaProgramming.h
) )
......
...@@ -14,17 +14,12 @@ ...@@ -14,17 +14,12 @@
#include <corsika/geometry/Vector.h> #include <corsika/geometry/Vector.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
#include <corsika/utl/COMBoost.h> #include <corsika/utl/COMBoost.h>
#include <corsika/utl/sgn.h>
using namespace corsika::utl; using namespace corsika::utl;
using namespace corsika::units::si; using namespace corsika::units::si;
using namespace corsika::geometry; using namespace corsika::geometry;
//! sign function without branches
template <typename T>
static int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
COMBoost::COMBoost(FourVector<HEPEnergyType, Vector<hepmomentum_d>> const& Pprojectile, COMBoost::COMBoost(FourVector<HEPEnergyType, Vector<hepmomentum_d>> const& Pprojectile,
const HEPMassType massTarget) const HEPMassType massTarget)
: fCS(Pprojectile.GetSpaceLikeComponents().GetCoordinateSystem()) { : fCS(Pprojectile.GetSpaceLikeComponents().GetCoordinateSystem()) {
......
#ifndef _utilities_sgn_h
#define _utilities_sgn_h
namespace corsika::utl {
//! sign function without branches
template <typename T>
static int sgn(T val) {
return (T(0) < val) - (val < T(0));
}
}
#endif
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