aboutsummaryrefslogtreecommitdiff
path: root/chaos/src/ode_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chaos/src/ode_base.hpp')
-rw-r--r--chaos/src/ode_base.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/chaos/src/ode_base.hpp b/chaos/src/ode_base.hpp
index 6fa7e27..cc526ae 100644
--- a/chaos/src/ode_base.hpp
+++ b/chaos/src/ode_base.hpp
@@ -49,6 +49,28 @@ public:
virtual void m_step();
+ void ode_base_alloc()
+ {
+ int dimension = get_num_eq();
+
+ for (int i = 0; i != 3; ++i)
+ {
+ m_k[i] = new data_t[dimension];
+ }
+
+ m_tmp = new data_t[dimension];
+ }
+
+ void ode_base_free()
+ {
+ for (int i = 0; i != 3; ++i)
+ {
+ delete m_k[i];
+ }
+
+ delete m_tmp;
+ }
+
protected:
unsigned char m_method; /* 0: rk1, 1: rk2, 3: rk4 */