Mercurial > hg > octave-lyh
comparison liboctave/base-de.h @ 3997:d4091aff6468
[project @ 2002-07-17 18:00:06 by jwe]
author | jwe |
---|---|
date | Wed, 17 Jul 2002 18:00:07 +0000 |
parents | ee0304212be0 |
children | a35a3c5d4740 |
comparison
equal
deleted
inserted
replaced
3996:98107d72871c | 3997:d4091aff6468 |
---|---|
33 { | 33 { |
34 public: | 34 public: |
35 | 35 |
36 base_diff_eqn (void) | 36 base_diff_eqn (void) |
37 : x (), t (0.0), stop_time (0.0), stop_time_set (false), | 37 : x (), t (0.0), stop_time (0.0), stop_time_set (false), |
38 restart (true), integration_error (false) { } | 38 restart (true), integration_error (false), istate (0) { } |
39 | 39 |
40 base_diff_eqn (const ColumnVector& xx, double tt) | 40 base_diff_eqn (const ColumnVector& xx, double tt) |
41 : x (xx), t (tt), stop_time (0.0), stop_time_set (false), | 41 : x (xx), t (tt), stop_time (0.0), stop_time_set (false), |
42 restart (true), integration_error (false) { } | 42 restart (true), integration_error (false), istate (0) { } |
43 | 43 |
44 base_diff_eqn (const base_diff_eqn& a) | 44 base_diff_eqn (const base_diff_eqn& a) |
45 : x (a.x), t (a.t), stop_time (0.0), stop_time_set (false), | 45 : x (a.x), t (a.t), stop_time (0.0), stop_time_set (false), |
46 restart (true), integration_error (false) { } | 46 restart (true), integration_error (false), istate (0) { } |
47 | 47 |
48 virtual ~base_diff_eqn (void) { } | 48 virtual ~base_diff_eqn (void) { } |
49 | 49 |
50 base_diff_eqn& operator = (const base_diff_eqn& a) | 50 base_diff_eqn& operator = (const base_diff_eqn& a) |
51 { | 51 { |
55 t = a.t; | 55 t = a.t; |
56 stop_time = a.stop_time; | 56 stop_time = a.stop_time; |
57 stop_time_set = a.stop_time_set; | 57 stop_time_set = a.stop_time_set; |
58 restart = a.restart; | 58 restart = a.restart; |
59 integration_error = a.integration_error; | 59 integration_error = a.integration_error; |
60 istate = a.istate; | |
60 } | 61 } |
61 | 62 |
62 return *this; | 63 return *this; |
63 } | 64 } |
64 | 65 |
65 void initialize (const ColumnVector& x0, double t0) | 66 void initialize (const ColumnVector& x0, double t0) |
66 { | 67 { |
67 x = x0; | 68 x = x0; |
68 t = t0; | 69 t = t0; |
69 integration_error = false; | 70 integration_error = false; |
71 istate = 0; | |
70 force_restart (); | 72 force_restart (); |
71 } | 73 } |
72 | 74 |
73 int size (void) const { return x.capacity (); } | 75 int size (void) const { return x.capacity (); } |
74 | 76 |
86 | 88 |
87 virtual void force_restart (void) { restart = true; } | 89 virtual void force_restart (void) { restart = true; } |
88 | 90 |
89 bool integration_ok (void) const { return ! integration_error; } | 91 bool integration_ok (void) const { return ! integration_error; } |
90 | 92 |
93 int integration_state (void) const { return istate; } | |
94 | |
91 virtual std::string error_message (void) const = 0; | 95 virtual std::string error_message (void) const = 0; |
92 | 96 |
93 protected: | 97 protected: |
94 | 98 |
95 ColumnVector x; | 99 ColumnVector x; |
101 bool stop_time_set; | 105 bool stop_time_set; |
102 | 106 |
103 bool restart; | 107 bool restart; |
104 | 108 |
105 bool integration_error; | 109 bool integration_error; |
110 | |
111 int istate; | |
106 }; | 112 }; |
107 | 113 |
108 #endif | 114 #endif |
109 | 115 |
110 /* | 116 /* |