diff options
author | Tim Blechmann <timblech@users.sourceforge.net> | 2005-10-22 15:11:45 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:12:00 +0200 |
commit | ef53e19b3d9019b1b1f3345390f55ae9229ce390 (patch) | |
tree | 94f88a833fa9046c0af0800656bab4fa4bc7f9ab /chaos/src/ode_base.hpp | |
parent | 8fb0d8ac8ed684a2084769cb0986effec439626f (diff) |
cleanups and new system
svn path=/trunk/externals/tb/; revision=3750
Diffstat (limited to 'chaos/src/ode_base.hpp')
-rw-r--r-- | chaos/src/ode_base.hpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/chaos/src/ode_base.hpp b/chaos/src/ode_base.hpp index b7139d2..11811f7 100644 --- a/chaos/src/ode_base.hpp +++ b/chaos/src/ode_base.hpp @@ -27,6 +27,26 @@ class ode_base : public chaos_base { public: + ode_base(int n): + chaos_base (n) + { + for (int i = 0; i != 3; ++i) + { + m_k[i] = new data_t[n]; + } + m_tmp = new data_t[n]; + + } + + ~ode_base() + { + for (int i = 0; i != 3; ++i) + { + delete[] m_k[i]; + } + delete[] m_tmp; + } + void set_method(int i) { if (i >=0 && i <4) @@ -65,27 +85,6 @@ public: (this->*m_routine)(); } - 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: void (ode_base::*m_routine)(void); |