# HG changeset patch # User jwe # Date 812871091 0 # Node ID fe059f3bae294bdd2b6e7a4a369c8256295789e7 # Parent 8600f4f34aa9d8e508ce9fc380aa5eae656864cb [project @ 1995-10-05 05:30:03 by jwe] diff --git a/liboctave/Makefile.in b/liboctave/Makefile.in --- a/liboctave/Makefile.in +++ b/liboctave/Makefile.in @@ -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 diff --git a/liboctave/NLFunc.h b/liboctave/NLFunc.h --- a/liboctave/NLFunc.h +++ b/liboctave/NLFunc.h @@ -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: