Mercurial > hg > octave-nkf
changeset 3511:d92134062783
[project @ 2000-02-01 22:06:28 by jwe]
author | jwe |
---|---|
date | Tue, 01 Feb 2000 22:10:24 +0000 |
parents | 81a6b40c0769 |
children | e72d846e6f60 |
files | liboctave/ChangeLog liboctave/LSODE.cc liboctave/LSODE.h liboctave/Quad.cc liboctave/Quad.h liboctave/base-de.h |
diffstat | 6 files changed, 39 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,6 +1,10 @@ 2000-02-01 John W. Eaton <jwe@bevo.che.wisc.edu> + * Quad.h: Use do_integrate as name of pure virtual function. + * base-de.h: Use tt instead of t as arg names. + Add method with tcrit arg. + * DAE.h, DAE.cc: Likewise, also xx for x. * DASSL.cc (dassl_fcn_ptr, dassl_jac_ptr): New typedefs.
--- a/liboctave/LSODE.cc +++ b/liboctave/LSODE.cc @@ -305,34 +305,6 @@ return retval; } -#if 0 -void -LSODE::integrate (int nsteps, double tstep, std::ostream& s) -{ - int time_to_quit = 0; - double tout = t; - - s << t << " " << x << "\n"; - - for (int i = 0; i < nsteps; i++) - { - tout += tstep; - if (stop_time_set && tout > stop_time) - { - tout = stop_time; - time_to_quit = 1; - } - - x = integrate (tout); - - s << t << " " << x << "\n"; - - if (time_to_quit) - return; - } -} -#endif - Matrix LSODE::do_integrate (const ColumnVector& tout) { @@ -362,7 +334,7 @@ } Matrix -LSODE::integrate (const ColumnVector& tout, const ColumnVector& tcrit) +LSODE::do_integrate (const ColumnVector& tout, const ColumnVector& tcrit) { Matrix retval; int n_out = tout.capacity ();
--- a/liboctave/LSODE.h +++ b/liboctave/LSODE.h @@ -149,14 +149,7 @@ Matrix do_integrate (const ColumnVector& tout); -#if 0 - void integrate (int nsteps, double tstep, std::ostream& s); -#endif - - Matrix integrate (const ColumnVector& tout) - { return do_integrate (tout); } - - Matrix integrate (const ColumnVector& tout, const ColumnVector& tcrit); + Matrix do_integrate (const ColumnVector& tout, const ColumnVector& tcrit); private:
--- a/liboctave/Quad.cc +++ b/liboctave/Quad.cc @@ -82,7 +82,7 @@ } double -DefQuad::integrate (int& ier, int& neval, double& abserr) +DefQuad::do_integrate (int& ier, int& neval, double& abserr) { int npts = singularities.capacity () + 2; double *points = singularities.fortran_vec (); @@ -114,7 +114,7 @@ } double -IndefQuad::integrate (int& ier, int& neval, double& abserr) +IndefQuad::do_integrate (int& ier, int& neval, double& abserr) { double result = 0.0;
--- a/liboctave/Quad.h +++ b/liboctave/Quad.h @@ -116,23 +116,28 @@ { int ier, neval; double abserr; - return integrate (ier, neval, abserr); + return do_integrate (ier, neval, abserr); } virtual double integrate (int& ier) { int neval; double abserr; - return integrate (ier, neval, abserr); + return do_integrate (ier, neval, abserr); } virtual double integrate (int& ier, int& neval) { double abserr; - return integrate (ier, neval, abserr); + return do_integrate (ier, neval, abserr); } - virtual double integrate (int& ier, int& neval, double& abserr) = 0; + virtual double integrate (int& ier, int& neval, double& abserr) + { + return do_integrate (ier, neval, abserr); + } + + virtual double do_integrate (int& ier, int& neval, double& abserr) = 0; protected: @@ -176,7 +181,7 @@ ~DefQuad (void) { } - double integrate (int& ier, int& neval, double& abserr); + double do_integrate (int& ier, int& neval, double& abserr); private: @@ -208,7 +213,7 @@ ~IndefQuad (void) { } - double integrate (int& ier, int& neval, double& abserr); + double do_integrate (int& ier, int& neval, double& abserr); private:
--- a/liboctave/base-de.h +++ b/liboctave/base-de.h @@ -60,6 +60,9 @@ // output time. virtual Matrix do_integrate (const ColumnVector& tt) = 0; + virtual Matrix do_integrate (const ColumnVector& tt, + const ColumnVector& ttcrit) = 0; + // There must also be a way for us to force the integration to // restart. virtual void force_restart (void) = 0; @@ -86,12 +89,28 @@ // Set new x0, t0 and integrate to return output at all points // specified by t. virtual Matrix integrate (const ColumnVector& x0, double t0, - const ColumnVector tt) + const ColumnVector& tt) { initialize (x0, t0); return do_integrate (tt); } + // Integrate from current point and return output at all points + // specified by t. + virtual Matrix integrate (const ColumnVector& tt, + const ColumnVector& ttcrit) + { return do_integrate (tt, ttcrit); } + + // Set new x0, t0 and integrate to return output at all points + // specified by t. + virtual Matrix integrate (const ColumnVector& x0, double t0, + const ColumnVector& tt, + const ColumnVector& ttcrit) + { + initialize (x0, t0); + return do_integrate (tt, ttcrit); + } + virtual void initialize (const ColumnVector& x0, double t0) { x = x0;