From ef53e19b3d9019b1b1f3345390f55ae9229ce390 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sat, 22 Oct 2005 15:11:45 +0000 Subject: cleanups and new system svn path=/trunk/externals/tb/; revision=3750 --- chaos/src/chaos_base.hpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'chaos/src/chaos_base.hpp') diff --git a/chaos/src/chaos_base.hpp b/chaos/src/chaos_base.hpp index 5e2a99f..5c87bed 100644 --- a/chaos/src/chaos_base.hpp +++ b/chaos/src/chaos_base.hpp @@ -27,14 +27,20 @@ class chaos_base { - public: + chaos_base(int n): + m_num_eq(n) + { + m_data = new data_t[n]; + } + + inline t_sample get_data(unsigned int i) { return (t_sample)m_data[i]; /* this is not save, but fast */ } - inline int get_num_eq() + inline int get_num_eq() const { return m_num_eq; } @@ -65,25 +71,15 @@ public: } }; - data_t m_data[MAXDIMENSION]; // state of the system + data_t * m_data; // state of the system protected: virtual void m_step() = 0; // iteration - int m_num_eq; // number of equations of the system + const int m_num_eq; // number of equations of the system flext::AtomList Parameter; // parameter flext::AtomList System; // system }; -#define CHAOS_PRECONSTRUCTOR \ - /* dummy */ - -#define CHAOS_POSTCONSTRUCTOR \ -m_num_eq = System.Count(); - -#define CHAOS_DESTRUCTOR \ - - - #define CHAOS_CALLBACKS \ public: \ void get_dimension(int &i) \ -- cgit v1.2.1