Skip to content

Commit

Permalink
Fix and avoid including algorithms header for ROOT/CLING (#1087)
Browse files Browse the repository at this point in the history
* Don't include ArrayUtils in Types
* Don't rely on apple functions when using ROOT
* IWYU for celeritas::forward
  • Loading branch information
sethrj committed Jan 25, 2024
1 parent c942e57 commit 5339583
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/celer-g4/DetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "corecel/cont/ArrayIO.hh"
#include "corecel/io/Logger.hh"
#include "corecel/io/OutputRegistry.hh"
#include "corecel/math/ArrayUtils.hh"
#include "celeritas/Quantities.hh"
#include "celeritas/field/RZMapFieldInput.hh"
#include "celeritas/field/RZMapFieldParams.hh"
Expand Down
1 change: 0 additions & 1 deletion src/celeritas/Types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "corecel/Macros.hh"
#include "corecel/OpaqueId.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Array.hh"
#include "corecel/sys/ThreadId.hh"
#include "orange/Types.hh"
// IWYU pragma: end_exports
Expand Down
1 change: 1 addition & 0 deletions src/celeritas/field/LinearPropagator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/math/Algorithms.hh"
#include "orange/Types.hh"

namespace celeritas
Expand Down
2 changes: 1 addition & 1 deletion src/corecel/math/Algorithms.hh
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ CELER_WRAP_MATH_FLOAT_DBL_1(, sinpi)
CELER_WRAP_MATH_FLOAT_DBL_1(, cospi)
CELER_WRAP_MATH_FLOAT_DBL_PTR_2(, sincospi)
CELER_WRAP_MATH_FLOAT_DBL_PTR_2(, sincos)
#elif __APPLE__
#elif __APPLE__ && !defined(__CLING__)
// Apple defines __sinpi, __sinpif, __sincospi, ...
CELER_WRAP_MATH_FLOAT_DBL_1(__, sinpi)
CELER_WRAP_MATH_FLOAT_DBL_1(__, cospi)
Expand Down
1 change: 1 addition & 0 deletions src/orange/BoundingBox.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "corecel/cont/Array.hh"
#include "corecel/math/Algorithms.hh"
#include "corecel/math/NumericLimits.hh"

#include "OrangeTypes.hh"
Expand Down
9 changes: 4 additions & 5 deletions src/orange/Types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "corecel/OpaqueId.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Array.hh"
#include "corecel/math/ArrayUtils.hh"

namespace celeritas
{
Expand Down Expand Up @@ -62,13 +61,13 @@ enum class Axis
*/
struct GeoTrackInitializer
{
Real3 pos;
Real3 dir;
Real3 pos{0, 0, 0};
Real3 dir{0, 0, 0};

//! True if assigned and valid
//! True if assigned
explicit CELER_FUNCTION operator bool() const
{
return is_soft_unit_vector(dir);
return dir[0] != 0 || dir[1] != 0 || dir[2] != 0;
}
};

Expand Down
1 change: 1 addition & 0 deletions src/orange/surf/SurfaceTypeTraits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include "corecel/cont/EnumClassUtils.hh"
#include "corecel/math/Algorithms.hh"
#include "orange/OrangeTypes.hh"

#include "SurfaceFwd.hh"
Expand Down
1 change: 1 addition & 0 deletions src/orange/transform/TransformTypeTraits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/math/Algorithms.hh"
#include "orange/OrangeTypes.hh"

namespace celeritas
Expand Down
1 change: 1 addition & 0 deletions src/orange/univ/UniverseTypeTraits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/math/Algorithms.hh"
#include "orange/OrangeTypes.hh"

namespace celeritas
Expand Down

0 comments on commit 5339583

Please sign in to comment.