00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_DASRT_h)
00024 #define octave_DASRT_h 1
00025
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029
00030 #include <cfloat>
00031 #include <cmath>
00032
00033 #include "DASRT-opts.h"
00034
00035 class
00036 DASRT_result
00037 {
00038 public:
00039
00040 DASRT_result (void) { }
00041
00042 DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt)
00043 : x (xx), xdot (xxdot), t (tt) { }
00044
00045 DASRT_result (const DASRT_result& r)
00046 : x (r.x), xdot (r.xdot), t (r.t) { }
00047
00048 DASRT_result& operator = (const DASRT_result& r)
00049 {
00050 if (this != &r)
00051 {
00052 x = r.x;
00053 xdot = r.xdot;
00054 t = r.t;
00055 }
00056 return *this;
00057 }
00058
00059 ~DASRT_result (void) { }
00060
00061 Matrix state (void) const { return x; }
00062 Matrix deriv (void) const { return xdot; }
00063 ColumnVector times (void) const { return t; }
00064
00065 private:
00066
00067 Matrix x;
00068 Matrix xdot;
00069 ColumnVector t;
00070 };
00071
00072 class
00073 DASRT : public DAERT, public DASRT_options
00074 {
00075 public:
00076
00077 DASRT (void) : DAERT (), DASRT_options (), initialized (false) { }
00078
00079 DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
00080 : DAERT (s, tm, f), DASRT_options (), initialized (false) { }
00081
00082 DASRT (const ColumnVector& s, const ColumnVector& deriv,
00083 double tm, DAERTFunc& f)
00084 : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false) { }
00085
00086 ~DASRT (void) { }
00087
00088 DASRT_result integrate (const ColumnVector& tout);
00089
00090 DASRT_result integrate (const ColumnVector& tout,
00091 const ColumnVector& tcrit);
00092
00093 std::string error_message (void) const;
00094
00095 private:
00096
00097 bool initialized;
00098
00099 int liw;
00100 int lrw;
00101
00102 int ng;
00103
00104 Array<int> info;
00105 Array<int> iwork;
00106 Array<int> jroot;
00107
00108 Array<double> rwork;
00109
00110 Array<double> abs_tol;
00111 Array<double> rel_tol;
00112
00113 double *px;
00114 double *pxdot;
00115 double *pabs_tol;
00116 double *prel_tol;
00117 int *pinfo;
00118 int *piwork;
00119 double *prwork;
00120 int *pjroot;
00121
00122 void integrate (double t);
00123 };
00124
00125 #endif
00126
00127
00128
00129
00130
00131