diff liboctave/DAERTFunc.h @ 4049:a35a3c5d4740

[project @ 2002-08-16 08:54:31 by jwe]
author jwe
date Fri, 16 Aug 2002 08:54:31 +0000
parents f23bc69132cc
children 4c8a2e4e0717
line wrap: on
line diff
--- a/liboctave/DAERTFunc.h
+++ b/liboctave/DAERTFunc.h
@@ -33,22 +33,22 @@
   typedef ColumnVector (*DAERTConstrFunc) (const ColumnVector& x, double t);
 
   DAERTFunc (void)
-    : DAEFunc (), constr (0) { }
+    : DAEFunc (), constr (0), reset (true) { }
 
   DAERTFunc (DAERHSFunc f)
-    : DAEFunc (f), constr (0) { }
+    : DAEFunc (f), constr (0), reset (true) { }
 
   DAERTFunc (DAERHSFunc f, DAEJacFunc j)
-    : DAEFunc (f, j), constr (0) { }
+    : DAEFunc (f, j), constr (0), reset (true) { }
 
   DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf)
-    : DAEFunc (f), constr (cf) { }
+    : DAEFunc (f), constr (cf), reset (true) { }
 
   DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf, DAEJacFunc j)
-    : DAEFunc (f, j), constr (cf) { }
+    : DAEFunc (f, j), constr (cf), reset (true) { }
 
   DAERTFunc (const DAERTFunc& a)
-    : DAEFunc (a), constr (a.constr) { }
+    : DAEFunc (a), constr (a.constr), reset (a.reset) { }
 
   DAERTFunc& operator = (const DAERTFunc& a)
     {
@@ -56,6 +56,7 @@
 	{
 	  DAEFunc::operator = (a);
 	  constr = a.constr;
+	  reset = a.reset;
 	}
       return *this;
     }
@@ -67,12 +68,20 @@
   DAERTFunc& set_constraint_function (DAERTConstrFunc cf)
     {
       constr = cf;
+      reset = true;
       return *this;
     }
 
 protected:
 
   DAERTConstrFunc constr;
+
+  // 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