changeset 1533:fe059f3bae29

[project @ 1995-10-05 05:30:03 by jwe]
author jwe
date Thu, 05 Oct 1995 05:31:31 +0000
parents 8600f4f34aa9
children b67df2551a8e
files liboctave/Makefile.in liboctave/NLFunc.h
diffstat 2 files changed, 49 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Makefile.in	Thu Oct 05 05:25:32 1995 +0000
+++ b/liboctave/Makefile.in	Thu Oct 05 05:31:31 1995 +0000
@@ -43,11 +43,12 @@
 	dbleAEPBAL.cc dbleCHOL.cc dbleDET.cc dbleGEPBAL.cc dbleHESS.cc \
 	dbleLU.cc dbleQR.cc dbleQRP.cc dbleSCHUR.cc dbleSVD.cc
 
-SOURCES = Bounds.cc CollocWt.cc DAE.cc FEGrid.cc FSQP.cc \
-	LinConst.cc LPsolve.cc NLEqn.cc NLFunc.cc \
-	NPSOL.cc Objective.cc ODE.cc ODEFunc.cc QLD.cc QPSOL.cc \
-	Quad.cc Range.cc lo-error.cc sun-utils.cc $(TEMPLATE_SRC) \
-	$(TI_SRC) $(MATRIX_SRC)
+SOURCES = Bounds.cc CollocWt.cc DAE.cc FEGrid.cc FSQP.cc LinConst.cc \
+	LPsolve.cc NLEqn.cc NPSOL.cc Objective.cc ODE.cc ODEFunc.cc \
+	QLD.cc QPSOL.cc Quad.cc Range.cc lo-error.cc sun-utils.cc \
+	$(TEMPLATE_SRC) \
+	$(TI_SRC) \
+	$(MATRIX_SRC)
 
 EXTRAS = mx-inlines.cc
 
--- a/liboctave/NLFunc.h	Thu Oct 05 05:25:32 1995 +0000
+++ b/liboctave/NLFunc.h	Thu Oct 05 05:31:31 1995 +0000
@@ -31,32 +31,60 @@
 class ColumnVector;
 class Matrix;
 
-#ifndef Vector
-#define Vector ColumnVector
-#endif
-
-typedef Vector (*nonlinear_fcn) (const Vector&);
-typedef Matrix (*jacobian_fcn) (const Vector&);
+typedef ColumnVector (*nonlinear_fcn) (const ColumnVector&);
+typedef Matrix (*jacobian_fcn) (const ColumnVector&);
 
 class NLFunc
 {
 public:
 
-  NLFunc (void);
-  NLFunc (const nonlinear_fcn);
-  NLFunc (const nonlinear_fcn, const jacobian_fcn);
+  NLFunc (void)
+    {
+      fun = 0;
+      jac = 0;
+    }
+
+  NLFunc (const nonlinear_fcn f)
+    {
+      fun = f;
+      jac = 0;
+    }
 
-  NLFunc (const NLFunc& a);
+  NLFunc (const nonlinear_fcn f, const jacobian_fcn j)
+    {
+      fun = f;
+      jac = j;
+    }
 
-  NLFunc& operator = (const NLFunc& a);
+  NLFunc (const NLFunc& a)
+    {
+      fun = a.function ();
+      jac = a.jacobian_function ();
+    }
 
-  nonlinear_fcn function (void) const;
+  NLFunc& operator = (const NLFunc& a)
+    {
+      fun = a.function ();
+      jac = a.jacobian_function ();
 
-  NLFunc& set_function (const nonlinear_fcn f);
+      return *this;
+    }
+
+  nonlinear_fcn function (void) const { return fun; }
 
-  jacobian_fcn jacobian_function (void) const;
+  NLFunc& set_function (const nonlinear_fcn f)
+    {
+      fun = f;
+      return *this;
+    }
 
-  NLFunc& set_jacobian_function (const jacobian_fcn j);
+  jacobian_fcn jacobian_function (void) const { return jac; }
+
+  NLFunc& set_jacobian_function (const jacobian_fcn j)
+    {
+      jac = j;
+      return *this;
+    }
 
 protected: