diff options
author | Tim Blechmann <timblech@users.sourceforge.net> | 2004-12-27 14:44:11 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:11:58 +0200 |
commit | b2f2fd990f9059db784a7849726c6fc5006c70f9 (patch) | |
tree | c867375b241055491d7665624aa24aa84c00c9b1 /chaos/src/gauss_map.hpp | |
parent | eced45909ba691a454fec179360ec1c2663f773a (diff) |
a lot of new objects ...
svn path=/trunk/externals/tb/; revision=2431
Diffstat (limited to 'chaos/src/gauss_map.hpp')
-rw-r--r-- | chaos/src/gauss_map.hpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/chaos/src/gauss_map.hpp b/chaos/src/gauss_map.hpp index 537dcfb..523b1ca 100644 --- a/chaos/src/gauss_map.hpp +++ b/chaos/src/gauss_map.hpp @@ -20,23 +20,25 @@ #include "map_base.hpp" +#include <cmath> + // gauss map: x[n+1] = 0 (for x[n] = 0) -// fmod(1 / x[n]) (else) +// fmod(1 / x[n], 1) (else) // 0 <= x[n] < 1 // taken from Willi-Hans Steeb: Chaos and Fractals -class gauss: - protected map_base +class gauss_map: + public map_base { public: - gauss() + gauss_map() { m_num_eq = 1; m_data = new data_t[1]; CHAOS_SYS_INIT(x,0.5); } - ~gauss() + ~gauss_map() { delete m_data; } @@ -46,9 +48,9 @@ public: data_t data = m_data[0]; if (data == 0) - m_data[0] = 0; + m_data[0] = 0.001; else - m_data[0] = fmod(1.f / data); + m_data[0] = fmod(1.f / data, 1); } CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_x); @@ -58,11 +60,11 @@ public: } }; -#define GAUSS_CALLBACKS \ +#define GAUSS_MAP_CALLBACKS \ MAP_CALLBACKS; \ CHAOS_SYS_CALLBACKS(x); -#define GAUSS_ATTRIBUTES \ +#define GAUSS_MAP_ATTRIBUTES \ MAP_ATTRIBUTES; \ CHAOS_SYS_ATTRIBUTE(x); |