diff liboctave/DAEFunc.h @ 4049:a35a3c5d4740

[project @ 2002-08-16 08:54:31 by jwe]
author jwe
date Fri, 16 Aug 2002 08:54:31 +0000
parents 48d2bc4a3729
children 23b37da9fd5b
line wrap: on
line diff
--- a/liboctave/DAEFunc.h
+++ b/liboctave/DAEFunc.h
@@ -44,16 +44,16 @@
 				double t, double cj);
 
   DAEFunc (void)
-    : fun (0), jac (0) { }
+    : fun (0), jac (0), reset (true) { }
 
   DAEFunc (DAERHSFunc f)
-    : fun (f), jac (0) { }
+    : fun (f), jac (0), reset (true) { }
 
   DAEFunc (DAERHSFunc f, DAEJacFunc j)
-    : fun (f), jac (j) { }
+    : fun (f), jac (j), reset (true) { }
 
   DAEFunc (const DAEFunc& a)
-    : fun (a.fun), jac (a.jac) { }
+    : fun (a.fun), jac (a.jac), reset (a.reset) { }
 
   DAEFunc& operator = (const DAEFunc& a)
     {
@@ -61,6 +61,7 @@
 	{
 	  fun = a.fun;
 	  jac = a.jac;
+	  reset = a.reset;
 	}
       return *this;
     }
@@ -72,6 +73,7 @@
   DAEFunc& set_function (DAERHSFunc f)
     {
       fun = f;
+      reset = true;
       return *this;
     }
 
@@ -80,6 +82,7 @@
   DAEFunc& set_jacobian_function (DAEJacFunc j)
     {
       jac = j;
+      reset = true;
       return *this;
     }
 
@@ -87,6 +90,13 @@
 
   DAERHSFunc fun;
   DAEJacFunc jac;
+
+  // This variable is TRUE when this object is constructed, and also
+  // after any internal data has changed.  Derived classes may use
+  // this information (and change it) to know when to (re)initialize
+  // their own internal data related to this object.
+
+  bool reset;
 };
 
 #endif