Update of /cvsroot/pure-data/externals/tb/chaos/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15932
Modified Files:
Makefile.am bernoulli_map.hpp bungalow_tent_map.hpp
chaos_base.hpp chaos_defs.hpp chaos_dsp.hpp chua.hpp
circle_map.hpp coupled_logistic.hpp driven_anharmonic.hpp
driven_van_der_pol.hpp duffing_map.hpp gauss_map.hpp
henon_map.hpp ikeda_laser_map.hpp latoocarfian.hpp
latoomutalpha.hpp latoomutbeta.hpp latoomutgamma.hpp
logistic_map.hpp lorenz.hpp lozi_map.hpp main.cpp roessler.hpp
sine_map.hpp standard_map.hpp tent_map.hpp
Log Message:
changed initialisation
Index: coupled_logistic.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/coupled_logistic.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** coupled_logistic.hpp 1 Jan 2005 11:06:58 -0000 1.2
--- coupled_logistic.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 22,26 ****
// coupled_logistic map: x[n+1] = r * x[n] * (1 - x[n]) + e * (y[n] - x[n])
! // y[n+1] = r * y[n] * (1 - y[n]) + e * (x[t] - y[t])
// 1 <= r <= 4
// taken from Willi-Hans Steeb: Chaos and Fractals
--- 22,26 ----
// coupled_logistic map: x[n+1] = r * x[n] * (1 - x[n]) + e * (y[n] - x[n])
! // y[n+1] = r * y[n] * (1 - y[n]) + e * (x[n] - y[n])
// 1 <= r <= 4
// taken from Willi-Hans Steeb: Chaos and Fractals
***************
*** 32,46 ****
coupled_logistic()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(e, 0.06);
! CHAOS_SYS_INIT(r, 3.7);
! CHAOS_SYS_INIT(x, 0.1);
! CHAOS_SYS_INIT(x, 0.2);
}
~coupled_logistic()
{
- delete m_data;
}
--- 32,48 ----
coupled_logistic()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_PAR_INIT(e, 0.06);
! CHAOS_PAR_INIT(r, 3.7);
!
! CHAOS_SYS_INIT(x, 0.1,0);
! CHAOS_SYS_INIT(y, 0.2,1);
!
! CHAOS_POSTCONSTRUCTOR;
}
~coupled_logistic()
{
}
***************
*** 62,67 ****
}
! CHAOS_SYSVAR_FUNCS(x, 0);
! CHAOS_SYSVAR_FUNCS(y, 0);
};
--- 64,85 ----
}
! CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_xy);
! CHAOS_SYSVAR_FUNCS_PRED(y, 0, m_pred_xy);
!
! bool m_pred_xy(t_float f)
! {
! return (f > 0) && (f < 1);
! }
!
! virtual void m_verify()
! {
! data_t x = m_data[0];
! data_t y = m_data[1];
! if (!m_pred_xy(x))
! m_data[0] = 0.5;
! if (!m_pred_xy(y))
! m_data[1] = 0.5;
! }
!
};
Index: main.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/main.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** main.cpp 12 Feb 2005 08:58:21 -0000 1.9
--- main.cpp 9 Jun 2005 12:52:17 -0000 1.10
***************
*** 24,28 ****
void chaos_library_setup()
{
! post("chaos~ version "PACKAGE_VERSION", compiled on "__DATE__" \n");
--- 24,28 ----
void chaos_library_setup()
{
! post("chaos~ version 0.01, compiled on "__DATE__" \n");
Index: roessler.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/roessler.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** roessler.hpp 1 Jan 2005 11:06:58 -0000 1.2
--- roessler.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 32,47 ****
roessler()
{
! m_num_eq = 3;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(method,0);
! CHAOS_SYS_INIT(x1,0);
! CHAOS_SYS_INIT(x2,0);
! CHAOS_SYS_INIT(x3,0);
! CHAOS_SYS_INIT(a,4);
! CHAOS_SYS_INIT(b,4);
! CHAOS_SYS_INIT(c,4);
! CHAOS_SYS_INIT(dt,0.01);
ode_base_alloc();
}
--- 32,49 ----
roessler()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_PAR_INIT(method,0);
! CHAOS_PAR_INIT(dt,0.01);
!
! CHAOS_SYS_INIT(x1,0,0);
! CHAOS_SYS_INIT(x2,0,1);
! CHAOS_SYS_INIT(x3,0,2);
!
! CHAOS_PAR_INIT(a,4);
! CHAOS_PAR_INIT(b,4);
! CHAOS_PAR_INIT(c,4);
+ CHAOS_POSTCONSTRUCTOR;
ode_base_alloc();
}
***************
*** 50,54 ****
{
ode_base_free();
! delete m_data;
}
--- 52,56 ----
{
ode_base_free();
!
}
Index: chaos_dsp.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos_dsp.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** chaos_dsp.hpp 13 Jan 2005 13:39:57 -0000 1.8
--- chaos_dsp.hpp 9 Jun 2005 12:52:17 -0000 1.9
***************
*** 105,109 ****
}
! if( i == 2)
{
for (int j = 0; j != m_system->get_num_eq(); ++j)
--- 105,109 ----
}
! if(i == 2 && imethod != 2)
{
for (int j = 0; j != m_system->get_num_eq(); ++j)
***************
*** 126,132 ****
--- 126,140 ----
if( (f >= 0) && (f <= m_sr*0.5) )
{
+ if (m_freq == -1)
+ set_imethod(m_imethod);
m_freq = f;
m_invfreq = 1.f / f;
}
+ else if (f == -1)
+ {
+ m_freq = -1;
+
+ m_routine = &thisType::m_signal_;
+ }
else
post("frequency out of range");
***************
*** 139,206 ****
/* create constructor / destructor */
! #define CHAOS_DSP_INIT(SYSTEM, ATTRIBUTES) \
! FLEXT_HEADER(SYSTEM##_dsp, chaos_dsp<SYSTEM>) \
! \
! SYSTEM##_dsp(int argc, t_atom* argv ) \
! { \
! m_sr = 44100; /* assume default sampling rate */ \
! m_system = new SYSTEM; \
! \
! int size = m_system->get_num_eq(); \
! \
! m_values = new t_float[size]; \
! m_slopes = new t_float[size]; \
! m_nextvalues = new t_float[size]; \
! m_nextmidpts = new t_float[size]; \
! m_curves = new t_float[size]; \
! \
! /* create inlets and zero arrays*/ \
! for (int i = 0; i != size; ++i) \
! { \
! AddOutSignal(); \
! m_values[i] = 0; \
! m_slopes[i] = 0; \
! m_nextvalues[i] = 0; \
! m_nextmidpts[i] = 0; \
! m_curves[i] = 0; \
! } \
! \
! FLEXT_ADDATTR_VAR("frequency", get_freq, set_freq); \
! FLEXT_ADDATTR_VAR("interpolation_method",get_imethod, set_imethod); \
! \
! if (argc > 0) \
! { \
! CHAOS_SYS_INIT(freq, GetAInt(argv[0])); \
! } \
! else \
! { \
! CHAOS_SYS_INIT(freq, 440); \
! } \
! \
! if (argc > 1) \
! { \
! CHAOS_SYS_INIT(imethod, GetAInt(argv[1])); \
! } \
! else \
! { \
! CHAOS_SYS_INIT(imethod, 0); \
! } \
! \
! m_phase = 0; \
! \
! ATTRIBUTES; \
! } \
! \
! ~SYSTEM##_dsp() \
! { \
! delete m_system; \
! delete m_values; \
! delete m_slopes; \
! delete m_nextvalues; \
! delete m_nextmidpts; \
! delete m_curves; \
! } \
! \
! FLEXT_ATTRVAR_F(m_freq); \
FLEXT_ATTRVAR_I(m_imethod);
--- 147,214 ----
/* create constructor / destructor */
! #define CHAOS_DSP_INIT(SYSTEM, ATTRIBUTES) \
! FLEXT_HEADER(SYSTEM##_dsp, chaos_dsp<SYSTEM>) \
! \
! SYSTEM##_dsp(int argc, t_atom* argv ) \
! { \
! m_sr = 44100; /* assume default sampling rate */ \
! m_system = new SYSTEM; \
! \
! int size = m_system->get_num_eq(); \
! \
! m_values = new t_float[size]; \
! m_slopes = new t_float[size]; \
! m_nextvalues = new t_float[size]; \
! m_nextmidpts = new t_float[size]; \
! m_curves = new t_float[size]; \
! \
! /* create inlets and zero arrays*/ \
! for (int i = 0; i != size; ++i) \
! { \
! AddOutSignal(); \
! m_values[i] = 0; \
! m_slopes[i] = 0; \
! m_nextvalues[i] = 0; \
! m_nextmidpts[i] = 0; \
! m_curves[i] = 0; \
! } \
! \
! FLEXT_ADDATTR_VAR("frequency", get_freq, set_freq); \
! FLEXT_ADDATTR_VAR("interpolation_method",get_imethod, set_imethod); \
! \
! if (argc > 0) \
! { \
! CHAOS_INIT(freq, GetAInt(argv[0])); \
! } \
! else \
! { \
! CHAOS_INIT(freq, 440); \
! } \
! \
! if (argc > 1) \
! { \
! CHAOS_INIT(imethod, GetAInt(argv[1])); \
! } \
! else \
! { \
! CHAOS_INIT(imethod, 0); \
! } \
! \
! m_phase = 0; \
! \
! ATTRIBUTES; \
! } \
! \
! ~SYSTEM##_dsp() \
! { \
! delete m_system; \
! delete m_values; \
! delete m_slopes; \
! delete m_nextvalues; \
! delete m_nextmidpts; \
! delete m_curves; \
! } \
! \
! FLEXT_ATTRVAR_F(m_freq); \
FLEXT_ATTRVAR_I(m_imethod);
Index: tent_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/tent_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** tent_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- tent_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 32,43 ****
tent_map()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x, 0.6);
}
~tent_map()
{
! delete m_data;
}
--- 32,45 ----
tent_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x, 0.6,0);
!
! CHAOS_POSTCONSTRUCTOR;
}
~tent_map()
{
!
}
Index: sine_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/sine_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sine_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- sine_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 33,44 ****
sine_map()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x,0);
}
~sine_map()
{
! delete m_data;
}
--- 33,46 ----
sine_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x,0,0);
!
! CHAOS_POSTCONSTRUCTOR;
}
~sine_map()
{
!
}
Index: circle_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/circle_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** circle_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- circle_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 33,46 ****
circle_map()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(omega, 0.1);
! CHAOS_SYS_INIT(r, 3);
! CHAOS_SYS_INIT(x, 0.4);
}
~circle_map()
{
! delete m_data;
}
--- 33,49 ----
circle_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x, 0.4,0);
!
! CHAOS_PAR_INIT(omega, 0.1);
! CHAOS_PAR_INIT(r, 3);
!
! CHAOS_POSTCONSTRUCTOR;
}
~circle_map()
{
!
}
Index: driven_anharmonic.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/driven_anharmonic.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** driven_anharmonic.hpp 11 May 2005 20:26:46 -0000 1.3
--- driven_anharmonic.hpp 9 Jun 2005 12:52:17 -0000 1.4
***************
*** 35,54 ****
driven_anharmonic()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(method,0);
! CHAOS_SYS_INIT(dt,0.01);
! CHAOS_SYS_INIT(u1,0);
! CHAOS_SYS_INIT(u2,1);
! CHAOS_SYS_INIT(a,1);
! CHAOS_SYS_INIT(b,-10);
! CHAOS_SYS_INIT(c,100);
! CHAOS_SYS_INIT(Omega,3.5);
! CHAOS_SYS_INIT(k1,0.01);
! CHAOS_SYS_INIT(k2,1);
ode_base_alloc();
m_t = 0;
--- 35,54 ----
driven_anharmonic()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_PAR_INIT(method,0);
! CHAOS_PAR_INIT(dt,0.01);
! CHAOS_SYS_INIT(u1,0,0);
! CHAOS_SYS_INIT(u2,1,1);
! CHAOS_PAR_INIT(a,1);
! CHAOS_PAR_INIT(b,-10);
! CHAOS_PAR_INIT(c,100);
! CHAOS_PAR_INIT(Omega,3.5);
! CHAOS_PAR_INIT(k1,0.01);
! CHAOS_PAR_INIT(k2,1);
+ CHAOS_POSTCONSTRUCTOR;
ode_base_alloc();
m_t = 0;
***************
*** 58,62 ****
{
ode_base_free();
! delete m_data;
}
--- 58,62 ----
{
ode_base_free();
!
}
Index: gauss_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/gauss_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** gauss_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- gauss_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 34,45 ****
gauss_map()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x,0.5);
}
~gauss_map()
{
! delete m_data;
}
--- 34,47 ----
gauss_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x,0.5, 0);
!
! CHAOS_POSTCONSTRUCTOR;
}
~gauss_map()
{
!
}
Index: latoocarfian.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoocarfian.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** latoocarfian.hpp 12 Feb 2005 08:58:21 -0000 1.2
--- latoocarfian.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 34,51 ****
latoocarfian()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1,0.5);
! CHAOS_SYS_INIT(x2,0);
! CHAOS_SYS_INIT(a,-0.966918);
! CHAOS_SYS_INIT(b,2.879879);
! CHAOS_SYS_INIT(c,0.765145);
! CHAOS_SYS_INIT(d,0.744728);
}
~latoocarfian()
{
! delete m_data;
}
--- 34,53 ----
latoocarfian()
{
! CHAOS_PRECONSTRUCTOR
! CHAOS_SYS_INIT(x1,0.5,0);
! CHAOS_SYS_INIT(x2,0,1);
!
! CHAOS_PAR_INIT(a,-0.966918);
! CHAOS_PAR_INIT(b,2.879879);
! CHAOS_PAR_INIT(c,0.765145);
! CHAOS_PAR_INIT(d,0.744728);
!
! CHAOS_POSTCONSTRUCTOR;
}
~latoocarfian()
{
!
}
Index: lorenz.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/lorenz.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** lorenz.hpp 27 Dec 2004 22:55:41 -0000 1.6
--- lorenz.hpp 9 Jun 2005 12:52:17 -0000 1.7
***************
*** 32,47 ****
lorenz()
{
! m_num_eq = 3;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(method,0);
! CHAOS_SYS_INIT(dt,0.01);
! CHAOS_SYS_INIT(x1,0.8);
! CHAOS_SYS_INIT(x2,0.7);
! CHAOS_SYS_INIT(x3,0.6);
! CHAOS_SYS_INIT(sigma,16);
! CHAOS_SYS_INIT(b,4);
! CHAOS_SYS_INIT(r,40);
ode_base_alloc();
}
--- 32,50 ----
lorenz()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_PAR_INIT(method,0);
! CHAOS_PAR_INIT(dt,0.01);
+ CHAOS_SYS_INIT(x1,0.8,0);
+ CHAOS_SYS_INIT(x2,0.7,1);
+ CHAOS_SYS_INIT(x3,0.6,2);
+
+ CHAOS_PAR_INIT(sigma,16);
+ CHAOS_PAR_INIT(b,4);
+ CHAOS_PAR_INIT(r,40);
+
+ CHAOS_POSTCONSTRUCTOR;
+
ode_base_alloc();
}
***************
*** 50,54 ****
{
ode_base_free();
! delete m_data;
}
--- 53,57 ----
{
ode_base_free();
!
}
Index: latoomutgamma.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutgamma.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** latoomutgamma.hpp 12 Feb 2005 08:58:21 -0000 1.2
--- latoomutgamma.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 33,48 ****
latoomutgamma()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1,0.5);
! CHAOS_SYS_INIT(x2,0.5);
! CHAOS_SYS_INIT(a,-0.966918);
! CHAOS_SYS_INIT(b,2.879879);
}
~latoomutgamma()
{
! delete m_data;
}
--- 33,50 ----
latoomutgamma()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_SYS_INIT(x1,0.5,0);
! CHAOS_SYS_INIT(x2,0.5,1);
!
! CHAOS_PAR_INIT(a,-0.966918);
! CHAOS_PAR_INIT(b,2.879879);
!
! CHAOS_POSTCONSTRUCTOR;
}
~latoomutgamma()
{
!
}
Index: chaos_base.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos_base.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** chaos_base.hpp 12 Feb 2005 08:58:20 -0000 1.6
--- chaos_base.hpp 9 Jun 2005 12:52:17 -0000 1.7
***************
*** 22,25 ****
--- 22,28 ----
#include "chaos.hpp"
+ #include <map>
+
+ #define MAXDIMENSION 5 // this should be enough for the first
class chaos_base
***************
*** 43,46 ****
--- 46,52 ----
}
+ std::map<const t_symbol*,int> attr_ind;
+
+ // check the integrity of the system
virtual void m_verify()
{
***************
*** 53,64 ****
}
};
!
! data_t * m_data; // state of the system
protected:
! virtual void m_step() = 0;
! int m_num_eq; // number of equations of the system
};
#define CHAOS_CALLBACKS \
--- 59,81 ----
}
};
!
! data_t m_data[MAXDIMENSION]; // state of the system
protected:
! virtual void m_step() = 0; // iteration
! 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 \
***************
*** 70,73 ****
--- 87,91 ----
FLEXT_CALLGET_I(get_dimension);
+
#define CHAOS_ATTRIBUTES \
FLEXT_ADDATTR_GET("dimension",get_dimension);
Index: lozi_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/lozi_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** lozi_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- lozi_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 32,46 ****
lozi_map()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x,0);
! CHAOS_SYS_INIT(y,0);
! CHAOS_SYS_INIT(a,1.4);
! CHAOS_SYS_INIT(b,0.3);
}
~lozi_map()
{
! delete m_data;
}
--- 32,49 ----
lozi_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x,0,0);
! CHAOS_SYS_INIT(y,0,1);
!
! CHAOS_PAR_INIT(a,1.4);
! CHAOS_PAR_INIT(b,0.3);
!
! CHAOS_POSTCONSTRUCTOR;
}
~lozi_map()
{
!
}
***************
*** 58,62 ****
}
!
CHAOS_SYSVAR_FUNCS(x, 0);
CHAOS_SYSVAR_FUNCS(y, 1);
--- 61,70 ----
}
! virtual void m_verify()
! {
! if (PD_BIGORSMALL(m_data[0]))
! m_data[0] = 1;
! }
!
CHAOS_SYSVAR_FUNCS(x, 0);
CHAOS_SYSVAR_FUNCS(y, 1);
Index: bernoulli_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/bernoulli_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** bernoulli_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- bernoulli_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 29,42 ****
{
public:
bernoulli()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x,0.5);
}
~bernoulli()
{
! delete m_data;
}
--- 29,45 ----
{
public:
+
bernoulli()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x,0.5,0);
!
! CHAOS_POSTCONSTRUCTOR;
}
~bernoulli()
{
!
}
Index: ikeda_laser_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/ikeda_laser_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ikeda_laser_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- ikeda_laser_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 38,54 ****
ikeda_laser_map()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(c1,0.4);
! CHAOS_SYS_INIT(c2,0.9);
! CHAOS_SYS_INIT(c3,9);
! CHAOS_SYS_INIT(roh,0.85);
! CHAOS_SYS_INIT(x,0.5);
! CHAOS_SYS_INIT(y,0.5);
}
~ikeda_laser_map()
{
! delete m_data;
}
--- 38,57 ----
ikeda_laser_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_PAR_INIT(c1,0.4);
! CHAOS_PAR_INIT(c2,0.9);
! CHAOS_PAR_INIT(c3,9);
! CHAOS_PAR_INIT(roh,0.85);
!
! CHAOS_SYS_INIT(x,0.5,0);
! CHAOS_SYS_INIT(y,0.5,1);
!
! CHAOS_POSTCONSTRUCTOR;
}
~ikeda_laser_map()
{
!
}
Index: logistic_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/logistic_map.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** logistic_map.hpp 1 Jan 2005 11:06:58 -0000 1.6
--- logistic_map.hpp 9 Jun 2005 12:52:17 -0000 1.7
***************
*** 31,38 ****
logistic()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(alpha, 3.8);
! CHAOS_SYS_INIT(x, 0.5);
}
--- 31,40 ----
logistic()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_PAR_INIT(alpha, 3.8);
! CHAOS_SYS_INIT(x, 0.5,0);
!
! CHAOS_POSTCONSTRUCTOR;
}
Index: chaos_defs.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos_defs.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** chaos_defs.hpp 28 Dec 2004 12:38:45 -0000 1.3
--- chaos_defs.hpp 9 Jun 2005 12:52:17 -0000 1.4
***************
*** 125,131 ****
FLEXT_ADDATTR_VAR(#NAME,get_##NAME, set_##NAME);
! #define CHAOS_SYS_INIT(NAME, VALUE) \
set_##NAME(VALUE);
#define CHAOS_PARAMETER(NAME) m_##NAME
--- 125,146 ----
FLEXT_ADDATTR_VAR(#NAME,get_##NAME, set_##NAME);
!
! #define CHAOS_INIT(NAME, VALUE) \
set_##NAME(VALUE);
+ #define CHAOS_SYS_INIT(NAME, VALUE, INDEX) \
+ set_##NAME(VALUE); \
+ t_atom atom_##NAME; \
+ flext::SetSymbol(atom_##NAME, flext::MakeSymbol(#NAME)); \
+ System.Append(atom_##NAME); \
+ attr_ind[flext::MakeSymbol(#NAME)] = INDEX;
+
+ #define CHAOS_PAR_INIT(NAME, VALUE) \
+ set_##NAME(VALUE); \
+ t_atom atom_##NAME; \
+ flext::SetSymbol(atom_##NAME, flext::MakeSymbol(#NAME)); \
+ Parameter.Append(atom_##NAME);
+
+
#define CHAOS_PARAMETER(NAME) m_##NAME
***************
*** 143,146 ****
--- 158,162 ----
FLEXT_LIB_DSP_V(#CLASSNAME"~", CLASSNAME##_dsp);
+
#define CHAOS_DSP_CLASS_NAME(CLASSNAME,CLASSNAME_UC, NAME) \
class CLASSNAME##_dsp: \
***************
*** 162,165 ****
--- 178,182 ----
FLEXT_LIB_V(#CLASSNAME, CLASSNAME##_msg);
+
#define CHAOS_MSG_CLASS_NAME(CLASSNAME,CLASSNAME_UC, NAME) \
class CLASSNAME##_msg: \
***************
*** 171,177 ****
FLEXT_LIB_V(#NAME, CLASSNAME##_msg);
#define CHAOS_ADD(NAME) \
FLEXT_DSP_SETUP(NAME##_dsp); \
! FLEXT_SETUP(NAME##_msg);
#define __chaos_defs_hpp
--- 188,216 ----
FLEXT_LIB_V(#NAME, CLASSNAME##_msg);
+ #define CHAOS_SEARCH_CLASS(CLASSNAME,CLASSNAME_UC) \
+ class CLASSNAME##_search: \
+ public chaos_search<CLASSNAME> \
+ { \
+ CHAOS_SEARCH_INIT(CLASSNAME, CLASSNAME_UC##_ATTRIBUTES); \
+ CLASSNAME_UC##_CALLBACKS; \
+ }; \
+ FLEXT_LIB_V(#CLASSNAME"_search", CLASSNAME##_search);
+
+
+ #define CHAOS_SEARCH_CLASS_NAME(CLASSNAME,CLASSNAME_UC, NAME) \
+ class CLASSNAME##_msg: \
+ public chaos_search<CLASSNAME> \
+ { \
+ CHAOS_SEARCH_INIT(CLASSNAME, CLASSNAME_UC##_ATTRIBUTES); \
+ CLASSNAME_UC##_CALLBACKS; \
+ }; \
+ FLEXT_LIB_V(#NAME, CLASSNAME##_msg);
+
+
+
#define CHAOS_ADD(NAME) \
FLEXT_DSP_SETUP(NAME##_dsp); \
! FLEXT_SETUP(NAME##_msg); \
! FLEXT_SETUP(NAME##_search);
#define __chaos_defs_hpp
Index: bungalow_tent_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/bungalow_tent_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** bungalow_tent_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- bungalow_tent_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 39,51 ****
bungalow_tent()
{
! m_num_eq = 1;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x, 0.6);
! CHAOS_SYS_INIT(r, 0.5);
}
~bungalow_tent()
{
! delete m_data;
}
--- 39,53 ----
bungalow_tent()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x, 0.6,0);
! CHAOS_PAR_INIT(r, 0.5);
!
! CHAOS_POSTCONSTRUCTOR;
}
~bungalow_tent()
{
!
}
Index: Makefile.am
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Makefile.am 12 Feb 2005 08:58:20 -0000 1.9
--- Makefile.am 9 Jun 2005 12:52:17 -0000 1.10
***************
*** 17,21 ****
latoomutbeta_dsp.cpp latoomutbeta_msg.cpp \
latoomutgamma_dsp.cpp latoomutgamma_msg.cpp \
! logistic_dsp.cpp logistic_msg.cpp \
lorenz_dsp.cpp lorenz_msg.cpp \
lozi_map_dsp.cpp lozi_map_msg.cpp \
--- 17,21 ----
latoomutbeta_dsp.cpp latoomutbeta_msg.cpp \
latoomutgamma_dsp.cpp latoomutgamma_msg.cpp \
! logistic_dsp.cpp logistic_msg.cpp logistic_search.cpp\
lorenz_dsp.cpp lorenz_msg.cpp \
lozi_map_dsp.cpp lozi_map_msg.cpp \
***************
*** 23,27 ****
sine_map_dsp.cpp sine_map_msg.cpp \
standard_map_dsp.cpp standard_map_msg.cpp \
! tent_map_dsp.cpp tent_map_msg.cpp
CXXFLAGS = @CXXFLAGS@ \
--- 23,27 ----
sine_map_dsp.cpp sine_map_msg.cpp \
standard_map_dsp.cpp standard_map_msg.cpp \
! tent_map_dsp.cpp tent_map_msg.cpp
CXXFLAGS = @CXXFLAGS@ \
Index: latoomutbeta.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutbeta.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** latoomutbeta.hpp 12 Feb 2005 08:58:21 -0000 1.2
--- latoomutbeta.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 33,48 ****
latoomutbeta()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1,0.5);
! CHAOS_SYS_INIT(x2,0.5);
! CHAOS_SYS_INIT(a,-0.966918);
! CHAOS_SYS_INIT(b,2.879879);
}
~latoomutbeta()
{
! delete m_data;
}
--- 33,50 ----
latoomutbeta()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_SYS_INIT(x1,0.5,0);
! CHAOS_SYS_INIT(x2,0.5,1);
!
! CHAOS_PAR_INIT(a,-0.966918);
! CHAOS_PAR_INIT(b,2.879879);
!
! CHAOS_POSTCONSTRUCTOR;
}
~latoomutbeta()
{
!
}
Index: standard_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/standard_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** standard_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- standard_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 33,47 ****
standard_map()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(I,0.1);
! CHAOS_SYS_INIT(theta,0.2);
! CHAOS_SYS_INIT(k, 0.8);
}
~standard_map()
{
! delete m_data;
}
--- 33,49 ----
standard_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(I,0.1,0);
! CHAOS_SYS_INIT(theta,0.2,1);
! CHAOS_PAR_INIT(k, 0.8);
!
! CHAOS_POSTCONSTRUCTOR;
}
~standard_map()
{
!
}
Index: henon_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/henon_map.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** henon_map.hpp 1 Jan 2005 11:06:58 -0000 1.4
--- henon_map.hpp 9 Jun 2005 12:52:17 -0000 1.5
***************
*** 32,47 ****
henon()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x,0);
! CHAOS_SYS_INIT(y,0);
! CHAOS_SYS_INIT(a,1.4);
! CHAOS_SYS_INIT(b,0.3);
}
~henon()
{
! delete m_data;
}
--- 32,49 ----
henon()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_SYS_INIT(x,0,0);
! CHAOS_SYS_INIT(y,0,1);
!
! CHAOS_PAR_INIT(a,1.4);
! CHAOS_PAR_INIT(b,0.3);
!
! CHAOS_POSTCONSTRUCTOR;
}
~henon()
{
!
}
Index: latoomutalpha.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutalpha.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** latoomutalpha.hpp 12 Feb 2005 08:58:21 -0000 1.2
--- latoomutalpha.hpp 9 Jun 2005 12:52:17 -0000 1.3
***************
*** 33,49 ****
latoomutalpha()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1,0.5);
! CHAOS_SYS_INIT(x2,0.2);
! CHAOS_SYS_INIT(a,-0.966918);
! CHAOS_SYS_INIT(b,2.879879);
! CHAOS_SYS_INIT(c,0.765145);
}
~latoomutalpha()
{
! delete m_data;
}
--- 33,51 ----
latoomutalpha()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_SYS_INIT(x1,0.5,0);
! CHAOS_SYS_INIT(x2,0.2,1);
!
! CHAOS_PAR_INIT(a,-0.966918);
! CHAOS_PAR_INIT(b,2.879879);
! CHAOS_PAR_INIT(c,0.765145);
!
! CHAOS_POSTCONSTRUCTOR;
}
~latoomutalpha()
{
!
}
***************
*** 69,73 ****
#ifndef DOUBLE_PRECISION
if (PD_BIGORSMALL(m_data[i]))
! m_data[i] = 0.01;
#endif
}
--- 71,75 ----
#ifndef DOUBLE_PRECISION
if (PD_BIGORSMALL(m_data[i]))
! m_data[i] = 0.5;
#endif
}
Index: driven_van_der_pol.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/driven_van_der_pol.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** driven_van_der_pol.hpp 27 Dec 2004 22:55:41 -0000 1.1
--- driven_van_der_pol.hpp 9 Jun 2005 12:52:17 -0000 1.2
***************
*** 36,53 ****
driven_van_der_pol()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(method,0);
! CHAOS_SYS_INIT(dt,0.01);
! CHAOS_SYS_INIT(u1,0.8);
! CHAOS_SYS_INIT(u2,0.6);
! CHAOS_SYS_INIT(u3,0.4);
! CHAOS_SYS_INIT(a,5);
! CHAOS_SYS_INIT(Omega,2.466);
! CHAOS_SYS_INIT(k,5);
ode_base_alloc();
}
--- 36,53 ----
driven_van_der_pol()
{
! CHAOS_PRECONSTRUCTOR;
! CHAOS_PAR_INIT(method,0);
! CHAOS_PAR_INIT(dt,0.01);
! CHAOS_SYS_INIT(u1,0.8, 0);
! CHAOS_SYS_INIT(u2,0.6, 1);
! CHAOS_SYS_INIT(u3,0.4, 2);
! CHAOS_PAR_INIT(a,5);
! CHAOS_PAR_INIT(Omega,2.466);
! CHAOS_PAR_INIT(k,5);
+ CHAOS_POSTCONSTRUCTOR;
ode_base_alloc();
}
***************
*** 56,60 ****
{
ode_base_free();
! delete m_data;
}
--- 56,60 ----
{
ode_base_free();
!
}
Index: duffing_map.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/duffing_map.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** duffing_map.hpp 28 Dec 2004 12:38:45 -0000 1.1
--- duffing_map.hpp 9 Jun 2005 12:52:17 -0000 1.2
***************
*** 32,46 ****
duffing_map()
{
! m_num_eq = 2;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1, 0.5);
! CHAOS_SYS_INIT(x2, 0.5);
! CHAOS_SYS_INIT(a, 0.5);
! CHAOS_SYS_INIT(b, 0.5);
}
~duffing_map()
{
! delete m_data;
}
--- 32,48 ----
duffing_map()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x1, 0.5, 0);
! CHAOS_SYS_INIT(x2, 0.5, 1);
! CHAOS_PAR_INIT(a, 0.5);
! CHAOS_PAR_INIT(b, 0.5);
!
! CHAOS_POSTCONSTRUCTOR;
}
~duffing_map()
{
!
}
Index: chua.hpp
===================================================================
RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chua.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** chua.hpp 1 Jan 2005 11:06:58 -0000 1.1
--- chua.hpp 9 Jun 2005 12:52:17 -0000 1.2
***************
*** 37,49 ****
chua()
{
! m_num_eq = 3;
! m_data = new data_t[m_num_eq];
! CHAOS_SYS_INIT(x1,1);
! CHAOS_SYS_INIT(x2,1);
! CHAOS_SYS_INIT(x3,1);
! CHAOS_SYS_INIT(a,1.4);
! CHAOS_SYS_INIT(b,0.3);
! CHAOS_SYS_INIT(alpha,0.3);
! CHAOS_SYS_INIT(beta,0.3);
ode_base_alloc();
--- 37,52 ----
chua()
{
! CHAOS_PRECONSTRUCTOR;
!
! CHAOS_SYS_INIT(x1,1,0);
! CHAOS_SYS_INIT(x2,1,1);
! CHAOS_SYS_INIT(x3,1,2);
!
! CHAOS_PAR_INIT(a,1.4);
! CHAOS_PAR_INIT(b,0.3);
! CHAOS_PAR_INIT(alpha,0.3);
! CHAOS_PAR_INIT(beta,0.3);
!
! CHAOS_POSTCONSTRUCTOR;
ode_base_alloc();
***************
*** 53,57 ****
{
ode_base_free();
- delete m_data;
}
--- 56,59 ----