aboutsummaryrefslogtreecommitdiff
path: root/chaos/src/chaos_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chaos/src/chaos_base.hpp')
-rw-r--r--chaos/src/chaos_base.hpp24
1 files changed, 10 insertions, 14 deletions
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) \