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_ODESSA_h)
00024 #define octave_ODESSA_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 "ODESSA-opts.h"
00034
00035 class
00036 ODESSA_result
00037 {
00038 public:
00039
00040 ODESSA_result (void) { }
00041
00042 ODESSA_result (const Matrix& xx,
00043 const Array<Matrix>& xx_s)
00044
00045 : x (xx), x_s (xx_s) { }
00046
00047 ODESSA_result (const ODESSA_result& r)
00048 : x (r.x), x_s (r.x_s) { }
00049
00050 ODESSA_result& operator = (const ODESSA_result& r)
00051 {
00052 if (this != &r)
00053 {
00054 x = r.x;
00055 x_s = r.x_s;
00056 }
00057 return *this;
00058 }
00059
00060 ~ODESSA_result (void) { }
00061
00062 Matrix state (void) const { return x; }
00063 Array<Matrix> state_sensitivity (void) const { return x_s; }
00064
00065 private:
00066
00067 Matrix x;
00068 Array<Matrix> x_s;
00069 };
00070
00071 class
00072 ODESSA : public ODES, public ODESSA_options
00073 {
00074 public:
00075
00076 ODESSA (void);
00077
00078 ODESSA (const ColumnVector& x, double time, ODESFunc& f);
00079
00080 ODESSA (const ColumnVector& x, const ColumnVector& theta,
00081 const Matrix& sensitivity_guess, double time, ODESFunc& f);
00082
00083 ~ODESSA (void) { }
00084
00085 ODESSA_result integrate (const ColumnVector& tout);
00086
00087 ODESSA_result integrate (const ColumnVector& tout,
00088 const ColumnVector& tcrit);
00089
00090 std::string error_message (void) const;
00091
00092 private:
00093
00094 bool initialized;
00095
00096 bool sanity_checked;
00097
00098 int liw;
00099 int lrw;
00100 int method_flag;
00101 int maxord;
00102 Array<int> iwork;
00103 Array<double> rwork;
00104 int itask;
00105 Array<int> iopt;
00106 int isopt;
00107
00108 Array<int> neq;
00109
00110 int n;
00111 int npar;
00112
00113
00114 Array<double> par;
00115
00116 Matrix sx0;
00117
00118 Matrix y;
00119
00120 double *py;
00121 double *ppar;
00122 int *piwork;
00123 int *piopt;
00124 int *pneq;
00125 double *prwork;
00126
00127 void init_work_size (int);
00128
00129 void integrate (double t);
00130 };
00131
00132 #endif
00133
00134
00135
00136
00137
00138