From 5c3670b6322b60b8bc5f60e22d891fe39b854e3e Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Fri, 24 Dec 2004 23:20:22 +0000 Subject: more changes ... getting stable ... svn path=/trunk/externals/tb/; revision=2428 --- chaos/src/ode_base.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'chaos/src/ode_base.hpp') 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 */ -- cgit v1.2.1