Skip to content

Commit b16b823

Browse files
committed
refactor: move AbstractIntegrator and AdaptiveIntegrator to diffeq::core namespace
- Move AbstractIntegrator to diffeq::core namespace - Move AdaptiveIntegrator to diffeq::core namespace - Update Euler, RK4, and ImprovedEuler integrators to use correct namespace - Fix inheritance from core::AbstractIntegrator
1 parent 0e03058 commit b16b823

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

include/core/abstract_integrator.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <type_traits>
55
#include "concepts.hpp"
66

7+
namespace diffeq::core {
8+
79
// Abstract integrator base class
810
template<system_state S>
911
class AbstractIntegrator {
@@ -43,3 +45,5 @@ class AbstractIntegrator {
4345
// Helper function for derived classes to update time
4446
void advance_time(time_type dt) { current_time_ += dt; }
4547
};
48+
49+
} // namespace diffeq::core

include/core/adaptive_integrator.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <core/abstract_integrator.hpp>
1313
#include <core/state_creator.hpp>
1414

15+
namespace diffeq::core {
16+
1517
// Abstract adaptive integrator with error control
1618
template<system_state S>
1719
class AdaptiveIntegrator : public AbstractIntegrator<S> {
@@ -122,3 +124,5 @@ class AdaptiveIntegrator : public AbstractIntegrator<S> {
122124
return std::max(dt_min_, std::min(dt_max_, current_dt * factor));
123125
}
124126
};
127+
128+
} // namespace diffeq::core

include/integrators/ode/euler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace diffeq {
1515
* Usage: Educational purposes, simple problems
1616
*/
1717
template<system_state S>
18-
class EulerIntegrator : public AbstractIntegrator<S> {
18+
class EulerIntegrator : public core::AbstractIntegrator<S> {
1919
public:
20-
using base_type = AbstractIntegrator<S>;
20+
using base_type = core::AbstractIntegrator<S>;
2121
using state_type = typename base_type::state_type;
2222
using time_type = typename base_type::time_type;
2323
using value_type = typename base_type::value_type;

include/integrators/ode/improved_euler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace diffeq {
1515
* Usage: Simple problems where RK4 is overkill
1616
*/
1717
template<system_state S>
18-
class ImprovedEulerIntegrator : public AbstractIntegrator<S> {
18+
class ImprovedEulerIntegrator : public core::AbstractIntegrator<S> {
1919
public:
20-
using base_type = AbstractIntegrator<S>;
20+
using base_type = core::AbstractIntegrator<S>;
2121
using state_type = typename base_type::state_type;
2222
using time_type = typename base_type::time_type;
2323
using value_type = typename base_type::value_type;

include/integrators/ode/rk4.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ namespace diffeq {
1616
* Usage: General-purpose ODE integration
1717
*/
1818
template<system_state S>
19-
class RK4Integrator : public AbstractIntegrator<S> {
19+
class RK4Integrator : public core::AbstractIntegrator<S> {
2020
public:
21-
using base_type = AbstractIntegrator<S>;
21+
using base_type = core::AbstractIntegrator<S>;
2222
using state_type = typename base_type::state_type;
2323
using time_type = typename base_type::time_type;
2424
using value_type = typename base_type::value_type;

0 commit comments

Comments
 (0)