Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.57.2.3 2001/06/25 23:28:29 geraint +## Generic mtt_rate and mtt_output - allows method independent calls. +## ## Revision 1.57.2.2 2001/06/05 03:20:40 geraint ## added -ae option to select algebraic equation solution method. ## ## Revision 1.57.2.1 2001/05/04 04:07:24 geraint ## Numerical solution of algebraic equations. @@ -694,11 +697,11 @@ mtt_write (const double &t, ColumnVector &x, ColumnVector &y, const int &nrows, const bool dump_data = false, - ostream &file = cout) + std::ostream &file = std::cout) { static Matrix data; static int row; if (dump_data) @@ -728,30 +731,30 @@ if (nrows == row) { #ifdef STANDALONE $save_ascii_data_function (file, data, "MTT_data"); -// cout << data << endl; +// std::cout << data << std::endl; #else // ! STANDALONE set_global_value ("MTT_data", data); #endif row = 0; } } #ifdef STANDALONE -void dump_data (ostream &file) +void dump_data (std::ostream &file) { - ColumnVector null (0.0); + ColumnVector null (0); mtt_write (0.0, null, null, 0, true, file); } void handle_signal (int signum) { // handle some signals to ensure data is written. - cerr << "# Writing data to MTT.core (signal " << signum << ")" << endl; - ofstream corefile ("MTT.core"); + std::cerr << "# Writing data to MTT.core (signal " << signum << ")" << std::endl; + std::ofstream corefile ("MTT.core"); dump_data (corefile); switch (signum) { case SIGFPE: // Intel chips do not raise SIGFPE for DIVZERO :-( @@ -762,11 +765,11 @@ case SIGQUIT: signal (SIGQUIT, SIG_DFL); raise (SIGQUIT); break; default: - cerr << "# Warning: make_ode2odes needs updating!" << endl; + std::cerr << "# Warning: make_ode2odes needs updating!" << std::endl; signal (signum, SIG_DFL); raise (signum); break; } corefile.close (); @@ -782,13 +785,11 @@ int main (void) { set_signal_handlers (); #else DEFUN_DLD (${sys}_ode2odes, args, , -"Octave ode2odes representation of system with $method integration method -Usage: mtt_data = ${sys}_ode2odes (x0, par, simpar) -") +"Octave ode2odes representation of system with $method integration method\nUsage: mtt_data = ${sys}_ode2odes (x0, par, simpar)\n") { static octave_value_list retval; #endif // STANDALONE static ColumnVector x0; static ColumnVector par; Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,15 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.31.2.1 2001/05/04 04:07:24 geraint +## Numerical solution of algebraic equations. +## sys_ae.cc written for unsolved inputs. +## Solution of equations using hybrd from MINPACK (as used by Octave fsolve). +## ## Revision 1.31 2001/04/03 14:49:42 gawthrop ## Revised to incorporate new ssim (sensitivity simulation) ## representation (m only just now). ## ## Revision 1.30 2001/03/30 15:13:58 gawthrop @@ -634,13 +639,11 @@ #include "${system}_cr.h" #include "${system}_def.h" #include "${system}_sympar.h" DEFUN_DLD (${system}_${rep}, args, , -"Usage: [$output] = ${system}_${rep}($args) -Octave ${rep} representation of system ${system} -Generated by MTT on `date`") +"Usage: [$output] = ${system}_${rep}($args)\nOctave ${rep} representation of system ${system}\nGenerated by MTT on `date`") { octave_value_list retval; #endif // ! STANDALONE Index: mttroot/mtt/cc/include/useful-functions.hh ================================================================== --- mttroot/mtt/cc/include/useful-functions.hh +++ mttroot/mtt/cc/include/useful-functions.hh @@ -75,10 +75,10 @@ zeros (const int r, const int c) { Matrix m (r, c, 0.0); return m; } -#endif __cplusplus +#endif // __cplusplus #endif // HAVE_USEFUL_FUNCTIONS_HH Index: mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Hybrd_Solver.cc @@ -53,15 +53,15 @@ unknown_errors++; break; } if (1 != info) { - cerr << "input (" << input_errors << ") " - << " user (" << user_errors << ") " - << " converge (" << convergences << ") " - << " progress (" << progress_errors << ") " - << " limit (" << limit_errors << ")" - << " unknown (" << unknown_errors << ")" - << " (max error = " << abs(eval(_ui).max()) << ")" << endl; + std::cerr << "input (" << input_errors << ") " + << " user (" << user_errors << ") " + << " converge (" << convergences << ") " + << " progress (" << progress_errors << ") " + << " limit (" << limit_errors << ")" + << " unknown (" << unknown_errors << ")" + << " (max error = " << std::abs(eval(_ui).max()) << ")" << std::endl; } } Index: mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc +++ mttroot/mtt/lib/cc/mtt_Reduce_Solver.cc @@ -3,9 +3,9 @@ void Reduce_Solver::Solve (void) { - cerr << "Error:" - << " Symbolic solution of equations failed during model build" << endl - << " Try using one of the other algebraic solution methods" << endl; + std::cerr << "Error:" + << " Symbolic solution of equations failed during model build" << std::endl + << " Try using one of the other algebraic solution methods" << std::endl; } Index: mttroot/mtt/lib/cc/mtt_Solver.hh ================================================================== --- mttroot/mtt/lib/cc/mtt_Solver.hh +++ mttroot/mtt/lib/cc/mtt_Solver.hh @@ -8,10 +8,11 @@ #include class Solver { +protected: typedef ColumnVector (*sys_ae) // pointer to F${sys}_ae function (ColumnVector &,ColumnVector &,const double &t,ColumnVector &); public: