aboutsummaryrefslogtreecommitdiff
path: root/chaos/src/bernoulli_map.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'chaos/src/bernoulli_map.hpp')
-rw-r--r--chaos/src/bernoulli_map.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/chaos/src/bernoulli_map.hpp b/chaos/src/bernoulli_map.hpp
index 50bca13..25d19f8 100644
--- a/chaos/src/bernoulli_map.hpp
+++ b/chaos/src/bernoulli_map.hpp
@@ -25,17 +25,17 @@
// taken from Willi-Hans Steeb: Chaos and Fractals
class bernoulli:
- protected map_base
+ public map_base
{
public:
bernoulli()
{
- m_num_eq = 1:
+ m_num_eq = 1;
m_data = new data_t[1];
- CHAOS_SYS_INIT(x,0.5)
+ CHAOS_SYS_INIT(x,0.5);
}
- ~Bernoulli()
+ ~bernoulli()
{
delete m_data;
}
@@ -43,6 +43,9 @@ public:
virtual void m_step()
{
data_t x = m_data[0];
+
+ if (x <= 0)
+ x = 0.00001; //stability
if (x < 0.5f)
m_data[0] = 2.f * x;