Update of /cvsroot/pure-data/externals/tb/chaos/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32291
Modified Files: bernoulli_map.hpp bungalow_tent_map.hpp chaos.hpp chaos_base.hpp chaos_dsp.hpp chua.hpp circle_map.hpp coupled_logistic.hpp delayed_logistic.hpp driven_anharmonic.hpp driven_van_der_pol.hpp duffing_map.hpp gauss_map.hpp gaussian_map.hpp henon_map.hpp hydrogen.hpp ikeda_laser_map.hpp latoocarfian.hpp latoomutalpha.hpp latoomutbeta.hpp latoomutgamma.hpp logistic_map.hpp lorenz.hpp lozi_map.hpp main.cpp map_base.hpp ode_base.hpp roessler.hpp sine_map.hpp standard_map.hpp tent_map.hpp Added Files: linear_congruental.hpp linear_congruental_dsp.cpp linear_congruental_msg.cpp linear_congruental_search.cpp Log Message: cleanups and new system
Index: coupled_logistic.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/coupled_logistic.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** coupled_logistic.hpp 16 Jun 2005 13:02:01 -0000 1.4 --- coupled_logistic.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 30,37 **** { public: ! coupled_logistic() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(e, 0.06); CHAOS_PAR_INIT(r, 3.7); --- 30,36 ---- { public: ! coupled_logistic(): ! map_base(2) { CHAOS_PAR_INIT(e, 0.06); CHAOS_PAR_INIT(r, 3.7); *************** *** 39,44 **** CHAOS_SYS_INIT(x, 0.1,0); CHAOS_SYS_INIT(y, 0.2,1); - - CHAOS_POSTCONSTRUCTOR; }
--- 38,41 ----
Index: main.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/main.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.cpp 16 Jun 2005 13:02:02 -0000 1.11 --- main.cpp 22 Oct 2005 15:11:45 -0000 1.12 *************** *** 24,28 **** void chaos_library_setup() { ! post("chaos~ version 0.01, compiled on "__DATE__" \n");
--- 24,29 ---- void chaos_library_setup() { ! post("chaos~ version 0.01, compiled on "__DATE__); ! post("(C)2005 Tim Blechmann, www.mokabar.tk\n\n");
*************** *** 35,38 **** --- 36,40 ---- CHAOS_ADD(driven_anharmonic); CHAOS_ADD(driven_van_der_pol); + CHAOS_ADD(duffing); CHAOS_ADD(duffing_map); CHAOS_ADD(gauss_map); *************** *** 45,48 **** --- 47,51 ---- CHAOS_ADD(latoomutbeta); CHAOS_ADD(latoomutgamma); + CHAOS_ADD(linear_congruental); CHAOS_ADD(logistic); CHAOS_ADD(lorenz);
Index: roessler.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/roessler.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roessler.hpp 16 Jun 2005 13:02:02 -0000 1.4 --- roessler.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 30,37 **** { public: ! roessler() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.001); --- 30,36 ---- { public: ! roessler(): ! ode_base(3) { CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.001); *************** *** 44,56 **** CHAOS_PAR_INIT(b,4); CHAOS_PAR_INIT(c,4); - - CHAOS_POSTCONSTRUCTOR; - ode_base_alloc(); } ~roessler() { - ode_base_free(); - }
--- 43,50 ----
Index: tent_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/tent_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tent_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- tent_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 30,42 **** { public: ! tent_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x, 0.6,0); - - CHAOS_POSTCONSTRUCTOR; } ! ~tent_map() { --- 30,39 ---- { public: ! tent_map(): ! map_base(1) { CHAOS_SYS_INIT(x, 0.6,0); } ! ~tent_map() { *************** *** 50,54 **** m_data[0] = 1 - 2*CHAOS_ABS(data); } ! CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_x); bool m_pred_x(t_float f) --- 47,51 ---- m_data[0] = 1 - 2*CHAOS_ABS(data); } ! CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_x); bool m_pred_x(t_float f)
Index: circle_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/circle_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** circle_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- circle_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 32,44 **** public: circle_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x, 0.4,0);
CHAOS_PAR_INIT(omega, 0.1); CHAOS_PAR_INIT(r, 3); - - CHAOS_POSTCONSTRUCTOR; }
--- 32,41 ---- public: circle_map() + : map_base(1) { CHAOS_SYS_INIT(x, 0.4,0);
CHAOS_PAR_INIT(omega, 0.1); CHAOS_PAR_INIT(r, 3); }
Index: sine_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/sine_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sine_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- sine_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 31,41 **** public: ! sine_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x,0,0); - - CHAOS_POSTCONSTRUCTOR; }
--- 31,38 ---- public: ! sine_map(): ! map_base(1) { CHAOS_SYS_INIT(x,0,0); }
Index: gaussian_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/gaussian_map.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gaussian_map.hpp 16 Jun 2005 13:02:02 -0000 1.1 --- gaussian_map.hpp 22 Oct 2005 15:11:45 -0000 1.2 *************** *** 30,43 **** { public: ! gaussian_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x, 0.5, 0);
CHAOS_PAR_INIT(b,7); CHAOS_PAR_INIT(c,0.5); - - CHAOS_POSTCONSTRUCTOR; }
--- 30,40 ---- { public: ! gaussian_map(): ! map_base(1) { CHAOS_SYS_INIT(x, 0.5, 0);
CHAOS_PAR_INIT(b,7); CHAOS_PAR_INIT(c,0.5); }
Index: bungalow_tent_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/bungalow_tent_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bungalow_tent_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- bungalow_tent_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 37,48 **** { public: ! bungalow_tent() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x, 0.6,0); CHAOS_PAR_INIT(r, 0.5); - - CHAOS_POSTCONSTRUCTOR; }
--- 37,45 ---- { public: ! bungalow_tent(): ! map_base(1) { CHAOS_SYS_INIT(x, 0.6,0); CHAOS_PAR_INIT(r, 0.5); }
Index: latoomutbeta.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutbeta.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** latoomutbeta.hpp 16 Jun 2005 13:02:02 -0000 1.4 --- latoomutbeta.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 31,38 **** { public: ! latoomutbeta() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); --- 31,37 ---- { public: ! latoomutbeta(): ! map_base(2) { CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); *************** *** 40,45 **** CHAOS_PAR_INIT(a,-0.966918); CHAOS_PAR_INIT(b,2.879879); - - CHAOS_POSTCONSTRUCTOR; } --- 39,42 ----
Index: driven_anharmonic.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/driven_anharmonic.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** driven_anharmonic.hpp 9 Jun 2005 12:52:17 -0000 1.4 --- driven_anharmonic.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 33,40 **** { public: ! driven_anharmonic() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.01); --- 33,39 ---- { public: ! driven_anharmonic(): ! ode_base(2) { CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.01); *************** *** 50,55 **** CHAOS_PAR_INIT(k2,1);
- CHAOS_POSTCONSTRUCTOR; - ode_base_alloc(); m_t = 0; } --- 49,52 ---- *************** *** 57,62 **** ~driven_anharmonic() { - ode_base_free(); - }
--- 54,57 ----
Index: gauss_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/gauss_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gauss_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- gauss_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 32,42 **** { public: ! gauss_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x,0.5, 0); - - CHAOS_POSTCONSTRUCTOR; }
--- 32,39 ---- { public: ! gauss_map(): ! map_base(1) { CHAOS_SYS_INIT(x,0.5, 0); }
--- NEW FILE: linear_congruental_msg.cpp --- // // // chaos~ // Copyright (C) 2005 Tim Blechmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA.
#include "linear_congruental.hpp" #include "chaos_msg.hpp" CHAOS_MSG_CLASS(linear_congruental,LINEAR_CONGRUENTAL);
Index: latoomutgamma.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutgamma.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** latoomutgamma.hpp 21 Aug 2005 14:57:28 -0000 1.5 --- latoomutgamma.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 31,38 **** { public: ! latoomutgamma() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); --- 31,37 ---- { public: ! latoomutgamma(): ! map_base(2) { CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.5,1); *************** *** 40,45 **** CHAOS_PAR_INIT(a,-0.966918); CHAOS_PAR_INIT(b,2.879879); - - CHAOS_POSTCONSTRUCTOR; } --- 39,42 ----
Index: chaos_base.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos_base.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** chaos_base.hpp 16 Jun 2005 13:02:01 -0000 1.8 --- chaos_base.hpp 22 Oct 2005 15:11:45 -0000 1.9 *************** *** 28,33 **** class chaos_base { - public: inline t_sample get_data(unsigned int i) { --- 28,39 ---- 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) { *************** *** 35,39 **** }
! inline int get_num_eq() { return m_num_eq; --- 41,45 ---- }
! inline int get_num_eq() const { return m_num_eq; *************** *** 66,88 **** }; ! 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 \ public: \ --- 72,84 ---- }; ! data_t * m_data; // state of the system
protected: virtual void m_step() = 0; // iteration ! const int m_num_eq; // number of equations of the system flext::AtomList Parameter; // parameter flext::AtomList System; // system };
#define CHAOS_CALLBACKS \ public: \
Index: lozi_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/lozi_map.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** lozi_map.hpp 16 Jun 2005 13:02:02 -0000 1.6 --- lozi_map.hpp 22 Oct 2005 15:11:45 -0000 1.7 *************** *** 30,37 **** { public: ! lozi_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x,0,0); CHAOS_SYS_INIT(y,0,1); --- 30,36 ---- { public: ! lozi_map(): ! map_base(2) { CHAOS_SYS_INIT(x,0,0); CHAOS_SYS_INIT(y,0,1); *************** *** 39,44 **** CHAOS_PAR_INIT(a,1.4); CHAOS_PAR_INIT(b,0.3); - - CHAOS_POSTCONSTRUCTOR; }
--- 38,41 ----
Index: bernoulli_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/bernoulli_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bernoulli_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- bernoulli_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 30,40 **** public:
! bernoulli() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x,0.5,0); - - CHAOS_POSTCONSTRUCTOR; }
--- 30,37 ---- public:
! bernoulli(): ! map_base(1) { CHAOS_SYS_INIT(x,0.5,0); }
Index: delayed_logistic.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/delayed_logistic.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** delayed_logistic.hpp 16 Jun 2005 13:02:01 -0000 1.1 --- delayed_logistic.hpp 22 Oct 2005 15:11:45 -0000 1.2 *************** *** 30,43 **** { public: ! delayed_logistic() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x, 0.5, 0); - CHAOS_PAR_INIT(alpha, 3.8);
- CHAOS_POSTCONSTRUCTOR; - m_delayed = get_x(); /* the initial state of the delay */ } --- 30,39 ---- { public: ! delayed_logistic(): ! map_base(1) { CHAOS_SYS_INIT(x, 0.5, 0); CHAOS_PAR_INIT(alpha, 3.8);
m_delayed = get_x(); /* the initial state of the delay */ }
Index: hydrogen.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/hydrogen.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hydrogen.hpp 16 Jun 2005 13:02:02 -0000 1.1 --- hydrogen.hpp 22 Oct 2005 15:11:45 -0000 1.2 *************** *** 30,37 ****
public: ! hydrogen() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.01); --- 30,36 ----
public: ! hydrogen(): ! ode_base(4) { CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.01); *************** *** 44,49 **** CHAOS_PAR_INIT(etilde,-0.3);
- CHAOS_POSTCONSTRUCTOR; - ode_base_alloc(); reset = 0; } --- 43,46 ---- *************** *** 51,55 **** ~hydrogen() { - ode_base_free(); }
--- 48,51 ----
Index: latoocarfian.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoocarfian.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** latoocarfian.hpp 16 Jun 2005 13:02:02 -0000 1.4 --- latoocarfian.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 32,39 **** { public: ! latoocarfian() { - CHAOS_PRECONSTRUCTOR - CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0,1); --- 32,38 ---- { public: ! latoocarfian(): ! map_base(2) { CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0,1); *************** *** 43,53 **** CHAOS_PAR_INIT(c,0.765145); CHAOS_PAR_INIT(d,0.744728); - - CHAOS_POSTCONSTRUCTOR; } ~latoocarfian() { - }
--- 42,49 ----
Index: ikeda_laser_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/ikeda_laser_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ikeda_laser_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- ikeda_laser_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 36,43 **** { public: ! ikeda_laser_map() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(c1,0.4); CHAOS_PAR_INIT(c2,0.9); --- 36,42 ---- { public: ! ikeda_laser_map(): ! map_base(1) { CHAOS_PAR_INIT(c1,0.4); CHAOS_PAR_INIT(c2,0.9); *************** *** 47,57 **** CHAOS_SYS_INIT(x,0.5,0); CHAOS_SYS_INIT(y,0.5,1); - - CHAOS_POSTCONSTRUCTOR; }
~ikeda_laser_map() { - }
--- 46,53 ----
Index: map_base.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/map_base.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** map_base.hpp 1 Jan 2005 11:06:58 -0000 1.3 --- map_base.hpp 22 Oct 2005 15:11:45 -0000 1.4 *************** *** 28,31 **** --- 28,36 ---- { protected: + map_base(int n): + chaos_base(n) + { + } + virtual void m_step() {
Index: henon_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/henon_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** henon_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- henon_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 30,37 **** { public: ! henon() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x,0,0); CHAOS_SYS_INIT(y,0,1); --- 30,36 ---- { public: ! henon(): ! map_base(2) { CHAOS_SYS_INIT(x,0,0); CHAOS_SYS_INIT(y,0,1); *************** *** 39,44 **** CHAOS_PAR_INIT(a,1.4); CHAOS_PAR_INIT(b,0.3); - - CHAOS_POSTCONSTRUCTOR; }
--- 38,41 ----
Index: logistic_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/logistic_map.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** logistic_map.hpp 16 Jun 2005 13:02:02 -0000 1.8 --- logistic_map.hpp 22 Oct 2005 15:11:45 -0000 1.9 *************** *** 29,45 **** { public: ! logistic() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(alpha, 3.8); CHAOS_SYS_INIT(x, 0.5,0); - - CHAOS_POSTCONSTRUCTOR; }
~logistic() { - delete m_data; }
--- 29,41 ---- { public: ! logistic(): ! map_base(1) { CHAOS_PAR_INIT(alpha, 3.8); CHAOS_SYS_INIT(x, 0.5,0); }
~logistic() { }
--- NEW FILE: linear_congruental_dsp.cpp --- // // // chaos~ // Copyright (C) 2005 Tim Blechmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA.
#include "linear_congruental.hpp" #include "chaos_dsp.hpp" CHAOS_DSP_CLASS(linear_congruental,LINEAR_CONGRUENTAL);
Index: lorenz.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/lorenz.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** lorenz.hpp 16 Jun 2005 13:02:02 -0000 1.8 --- lorenz.hpp 22 Oct 2005 15:11:45 -0000 1.9 *************** *** 30,37 **** { public: ! lorenz() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.01); --- 30,36 ---- { public: ! lorenz(): ! ode_base(3) { CHAOS_PAR_INIT(method,0); CHAOS_PAR_INIT(dt,0.01); *************** *** 44,57 **** CHAOS_PAR_INIT(b,4); CHAOS_PAR_INIT(r,40); - - CHAOS_POSTCONSTRUCTOR; - - ode_base_alloc(); } ~lorenz() { - ode_base_free(); - }
--- 43,50 ----
Index: standard_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/standard_map.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** standard_map.hpp 9 Jun 2005 12:52:17 -0000 1.5 --- standard_map.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 31,44 **** { public: ! 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; }
--- 31,41 ---- { public: ! standard_map(): ! map_base(2) { CHAOS_SYS_INIT(I,0.1,0); CHAOS_SYS_INIT(theta,0.2,1);
CHAOS_PAR_INIT(k, 0.8); }
--- NEW FILE: linear_congruental_search.cpp --- // // // chaos~ // Copyright (C) 2005 Tim Blechmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA.
#include "linear_congruental.hpp" #include "chaos_search.hpp"
CHAOS_SEARCH_CLASS(linear_congruental, LINEAR_CONGRUENTAL);
--- NEW FILE: linear_congruental.hpp --- // // // chaos~ // Copyright (C) 2004 Tim Blechmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA.
#include "map_base.hpp"
// tent map: x[n+1] = A*x[n] + B mod C // // taken from Julien C. Sprott, Chaos and Time-Series Analysis
class linear_congruental: public map_base { public: linear_congruental(): map_base(1) { CHAOS_SYS_INIT(x, 0, 0); CHAOS_PAR_INIT(A, 1741); CHAOS_PAR_INIT(B, 54773); CHAOS_PAR_INIT(C, 259200); }
virtual void m_step() { data_t x = m_data[0];
m_data[0] = chaos_mod( CHAOS_PARAMETER(A) * x + CHAOS_PARAMETER(B), CHAOS_PARAMETER(C)); }
CHAOS_SYSVAR_FUNCS(x,0);
CHAOS_SYSPAR_FUNCS(A); CHAOS_SYSPAR_FUNCS(B); CHAOS_SYSPAR_FUNCS(C); };
#define LINEAR_CONGRUENTAL_CALLBACKS \ MAP_CALLBACKS; \ CHAOS_SYS_CALLBACKS(A); \ CHAOS_SYS_CALLBACKS(B); \ CHAOS_SYS_CALLBACKS(C); \ CHAOS_SYS_CALLBACKS(x);
#define LINEAR_CONGRUENTAL_ATTRIBUTES \ MAP_ATTRIBUTES; \ CHAOS_SYS_ATTRIBUTE(A); \ CHAOS_SYS_ATTRIBUTE(B); \ CHAOS_SYS_ATTRIBUTE(C); \ CHAOS_SYS_ATTRIBUTE(x);
Index: latoomutalpha.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/latoomutalpha.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** latoomutalpha.hpp 16 Jun 2005 13:02:02 -0000 1.4 --- latoomutalpha.hpp 22 Oct 2005 15:11:45 -0000 1.5 *************** *** 31,38 **** { public: ! latoomutalpha() { - CHAOS_PRECONSTRUCTOR; - CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.2,1); --- 31,37 ---- { public: ! latoomutalpha(): ! map_base(2) { CHAOS_SYS_INIT(x1,0.5,0); CHAOS_SYS_INIT(x2,0.2,1); *************** *** 41,46 **** CHAOS_PAR_INIT(b,2.879879); CHAOS_PAR_INIT(c,0.765145); - - CHAOS_POSTCONSTRUCTOR; } --- 40,43 ----
Index: driven_van_der_pol.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/driven_van_der_pol.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** driven_van_der_pol.hpp 16 Jun 2005 13:02:02 -0000 1.3 --- driven_van_der_pol.hpp 22 Oct 2005 15:11:45 -0000 1.4 *************** *** 34,41 **** { public: ! driven_van_der_pol() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.01); --- 34,40 ---- { public: ! driven_van_der_pol(): ! ode_base(3) { CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.01); *************** *** 48,60 **** CHAOS_PAR_INIT(Omega,2.466); CHAOS_PAR_INIT(k,5); - - CHAOS_POSTCONSTRUCTOR; - ode_base_alloc(); } ~driven_van_der_pol() { - ode_base_free(); - }
--- 47,54 ----
Index: chaos.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** chaos.hpp 16 Jun 2005 13:02:01 -0000 1.8 --- chaos.hpp 22 Oct 2005 15:11:45 -0000 1.9 *************** *** 25,28 **** --- 25,29 ---- #define _USE_MATH_DEFINES /* tg says: define this before including cmath */ #include "flext.h" + #include "assert.h" #include "chaos_defs.hpp" #include <cmath>
Index: ode_base.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/ode_base.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ode_base.hpp 16 Jun 2005 13:02:02 -0000 1.5 --- ode_base.hpp 22 Oct 2005 15:11:45 -0000 1.6 *************** *** 28,31 **** --- 28,51 ---- { public: + ode_base(int n): + chaos_base (n) + { + for (int i = 0; i != 3; ++i) + { + m_k[i] = new data_t[n]; + } + m_tmp = new data_t[n]; + + } + + ~ode_base() + { + for (int i = 0; i != 3; ++i) + { + delete[] m_k[i]; + } + delete[] m_tmp; + } + void set_method(int i) { *************** *** 66,90 **** } - void ode_base_alloc() - { - int dimension = get_num_eq(); - - for (int i = 0; i != 3; ++i) - { - m_k[i] = new data_t[dimension]; - } - - m_tmp = new data_t[dimension]; - } - - void ode_base_free() - { - for (int i = 0; i != 3; ++i) - { - delete m_k[i]; - } - delete m_tmp; - } - protected: void (ode_base::*m_routine)(void); --- 86,89 ----
Index: chaos_dsp.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chaos_dsp.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** chaos_dsp.hpp 9 Oct 2005 10:23:37 -0000 1.13 --- chaos_dsp.hpp 22 Oct 2005 15:11:45 -0000 1.14 *************** *** 237,245 **** { \ delete m_system; \ ! delete m_values; \ ! delete m_slopes; \ ! delete m_nextvalues; \ ! delete m_nextmidpts; \ ! delete m_curves; \ } \ \ --- 237,245 ---- { \ delete m_system; \ ! delete[] m_values; \ ! delete[] m_slopes; \ ! delete[] m_nextvalues; \ ! delete[] m_nextmidpts; \ ! delete[] m_curves; \ } \ \
Index: duffing_map.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/duffing_map.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** duffing_map.hpp 9 Jun 2005 12:52:17 -0000 1.2 --- duffing_map.hpp 22 Oct 2005 15:11:45 -0000 1.3 *************** *** 30,43 **** { public: ! 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; }
--- 30,40 ---- { public: ! duffing_map(): ! map_base(2) { 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); }
Index: chua.hpp =================================================================== RCS file: /cvsroot/pure-data/externals/tb/chaos/src/chua.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** chua.hpp 16 Jun 2005 13:02:01 -0000 1.3 --- chua.hpp 22 Oct 2005 15:11:45 -0000 1.4 *************** *** 35,42 **** { public: ! chua() { - CHAOS_PRECONSTRUCTOR; - CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.05); --- 35,41 ---- { public: ! chua(): ! ode_base(3) { CHAOS_PAR_INIT(method,2); CHAOS_PAR_INIT(dt,0.05); *************** *** 50,62 **** CHAOS_PAR_INIT(alpha,30); CHAOS_PAR_INIT(beta,30); - - CHAOS_POSTCONSTRUCTOR; - - ode_base_alloc(); }
~chua() { - ode_base_free(); }
--- 49,56 ----