# HG changeset patch # User jwe # Date 770864709 0 # Node ID 4caf8fbeb7780d9281659cb495b431f4ec3898ca # Parent ac2509294b09da1e8205615c527c51d074010bda [project @ 1994-06-06 01:05:09 by jwe] diff --git a/liboctave/CollocWt.cc b/liboctave/CollocWt.cc --- a/liboctave/CollocWt.cc +++ b/liboctave/CollocWt.cc @@ -1,7 +1,7 @@ // CollocWt.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include #include "CollocWt.h" diff --git a/liboctave/CollocWt.h b/liboctave/CollocWt.h --- a/liboctave/CollocWt.h +++ b/liboctave/CollocWt.h @@ -24,12 +24,17 @@ #if !defined (octave_CollocWt_h) #define octave_CollocWt_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class ostream; + +#include "dMatrix.h" +#include "dColVector.h" extern "C++" { -class ostream; - #ifndef Vector #define Vector ColumnVector #endif diff --git a/liboctave/DAE.h b/liboctave/DAE.h --- a/liboctave/DAE.h +++ b/liboctave/DAE.h @@ -24,7 +24,11 @@ #if !defined (octave_DAE_h) #define octave_DAE_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +#include "dColVector.h" #include "ODE.h" #include "DAEFunc.h" diff --git a/liboctave/DAEFunc.cc b/liboctave/DAEFunc.cc --- a/liboctave/DAEFunc.cc +++ b/liboctave/DAEFunc.cc @@ -1,7 +1,7 @@ // DAEFunc.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,18 +25,22 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include "DAEFunc.h" DAEFunc::DAEFunc (void) { - fun = NULL; - jac = NULL; + fun = 0; + jac = 0; } DAEFunc::DAEFunc (DAERHSFunc f) { fun = f; - jac = NULL; + jac = 0; } DAEFunc::DAEFunc (DAERHSFunc f, DAEJacFunc j) diff --git a/liboctave/DAEFunc.h b/liboctave/DAEFunc.h --- a/liboctave/DAEFunc.h +++ b/liboctave/DAEFunc.h @@ -24,7 +24,12 @@ #if !defined (octave_DAEFunc_h) #define octave_DAEFunc_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class Matrix; +class ColumnVector; extern "C++" { diff --git a/liboctave/DASSL.cc b/liboctave/DASSL.cc --- a/liboctave/DASSL.cc +++ b/liboctave/DASSL.cc @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include "DAE.h" #include "f77-uscore.h" #include "lo-error.h" @@ -56,15 +60,15 @@ integration_error = 0; restart = 1; - DAEFunc::set_function (NULL); - DAEFunc::set_jacobian_function (NULL); + DAEFunc::set_function (0); + DAEFunc::set_jacobian_function (0); liw = 0; lrw = 0; info = new int [15]; - iwork = (int *) NULL; - rwork = (double *) NULL; + iwork = (int *) 0; + rwork = (double *) 0; for (int i = 0; i < 15; i++) info [i] = 0; @@ -81,8 +85,8 @@ integration_error = 0; restart = 1; - DAEFunc::set_function (NULL); - DAEFunc::set_jacobian_function (NULL); + DAEFunc::set_function (0); + DAEFunc::set_jacobian_function (0); liw = 20 + n; lrw = 40 + 9*n + n*n; @@ -250,10 +254,10 @@ { integration_error = 0; - if (DAEFunc::jac == NULL) + if (DAEFunc::jac) + iwork [4] = 1; + else iwork [4] = 0; - else - iwork [4] = 1; double *px = x.fortran_vec (); double *pxdot = xdot.fortran_vec (); @@ -298,7 +302,7 @@ info[0] = 0; } - again: +// again: F77_FCN (ddassl) (ddassl_f, &n, &t, px, pxdot, &tout, info, &rel_tol, &abs_tol, &idid, rwork, &lrw, iwork, diff --git a/liboctave/FEGrid.cc b/liboctave/FEGrid.cc --- a/liboctave/FEGrid.cc +++ b/liboctave/FEGrid.cc @@ -1,7 +1,7 @@ // FEGrid.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include #include "FEGrid.h" diff --git a/liboctave/FEGrid.h b/liboctave/FEGrid.h --- a/liboctave/FEGrid.h +++ b/liboctave/FEGrid.h @@ -24,12 +24,16 @@ #if !defined (octave_FEGrid_h) #define octave_FEGrid_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class ostream; + +#include "dColVector.h" extern "C++" { -class ostream; - #ifndef Vector #define Vector ColumnVector #endif diff --git a/liboctave/FSQP.cc b/liboctave/FSQP.cc --- a/liboctave/FSQP.cc +++ b/liboctave/FSQP.cc @@ -1,7 +1,7 @@ // FSQP.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #ifndef FSQP_MISSING #include "FSQP.h" diff --git a/liboctave/FSQP.h b/liboctave/FSQP.h --- a/liboctave/FSQP.h +++ b/liboctave/FSQP.h @@ -24,9 +24,12 @@ #if !defined (octave_FSQP_h) #define octave_FSQP_h 1 +#if defined (__GNUG__) +#pragma interface +#endif + #ifndef FSQP_MISSING -#include "Matrix.h" #include "NLP.h" extern "C++" { diff --git a/liboctave/LP.cc b/liboctave/LP.cc --- a/liboctave/LP.cc +++ b/liboctave/LP.cc @@ -1,7 +1,7 @@ // LP.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include "LP.h" LP::LP (void) {} diff --git a/liboctave/LP.h b/liboctave/LP.h --- a/liboctave/LP.h +++ b/liboctave/LP.h @@ -24,7 +24,11 @@ #if !defined (octave_LP_h) #define octave_LP_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +#include "dColVector.h" #include "Bounds.h" #include "LinConst.h" diff --git a/liboctave/LPsolve.cc b/liboctave/LPsolve.cc --- a/liboctave/LPsolve.cc +++ b/liboctave/LPsolve.cc @@ -1,7 +1,7 @@ // LPsolve.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,11 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + +#include "dColVector.h" #include "LPsolve.h" Vector diff --git a/liboctave/LPsolve.h b/liboctave/LPsolve.h --- a/liboctave/LPsolve.h +++ b/liboctave/LPsolve.h @@ -24,7 +24,12 @@ #if !defined (octave_LPsolve_h) #define octave_LPsolve_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class ColumnVector; + #include "LP.h" extern "C++" { diff --git a/liboctave/LinConst.cc b/liboctave/LinConst.cc --- a/liboctave/LinConst.cc +++ b/liboctave/LinConst.cc @@ -1,7 +1,7 @@ // LinConst.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include #include "LinConst.h" diff --git a/liboctave/LinConst.h b/liboctave/LinConst.h --- a/liboctave/LinConst.h +++ b/liboctave/LinConst.h @@ -24,15 +24,21 @@ #if !defined (octave_LinConst_h) #define octave_LinConst_h 1 -#include - -extern "C++" { +#if defined (__GNUG__) +#pragma interface +#endif class ostream; -#include "Matrix.h" +class ColumnVector; + +#include + +#include "dMatrix.h" #include "Bounds.h" +extern "C++" { + #ifndef Vector #define Vector ColumnVector #endif diff --git a/liboctave/NLConst.cc b/liboctave/NLConst.cc --- a/liboctave/NLConst.cc +++ b/liboctave/NLConst.cc @@ -1,7 +1,7 @@ // NLConst.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include "NLConst.h" NLConst::NLConst (void) : Bounds (), NLFunc () @@ -35,7 +39,7 @@ { } -NLConst::NLConst (const Vector l, const NLFunc f, const Vector u) +NLConst::NLConst (const Vector& l, const NLFunc f, const Vector& u) : Bounds (l, u), NLFunc (f) { } diff --git a/liboctave/NLConst.h b/liboctave/NLConst.h --- a/liboctave/NLConst.h +++ b/liboctave/NLConst.h @@ -24,7 +24,12 @@ #if !defined (octave_NLConst_h) #define octave_NLConst_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class ColumnVector; + #include "Bounds.h" #include "NLFunc.h" @@ -40,7 +45,7 @@ NLConst (void); NLConst (int n); - NLConst (const Vector lb, const NLFunc f, const ColumnVector ub); + NLConst (const Vector& lb, const NLFunc f, const Vector& ub); NLConst (const NLConst& a); NLConst& operator = (const NLConst& a); diff --git a/liboctave/NLEqn.cc b/liboctave/NLEqn.cc --- a/liboctave/NLEqn.cc +++ b/liboctave/NLEqn.cc @@ -25,9 +25,15 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include +#include #include "NLEqn.h" +#include "dMatrix.h" #include "f77-uscore.h" #include "lo-error.h" @@ -221,16 +227,7 @@ user_fun = fun; user_jac = jac; - if (jac == NULL) - { - int lwa = (n*(3*n+13))/2; - double *wa = new double [lwa]; - - F77_FCN (hybrd1) (hybrd1_fcn, &n, px, fvec, &tol, &tmp_info, wa, &lwa); - - delete [] wa; - } - else + if (jac) { int lwa = (n*(n+13))/2; double *wa = new double [lwa]; @@ -242,6 +239,15 @@ delete [] wa; delete [] fjac; } + else + { + int lwa = (n*(3*n+13))/2; + double *wa = new double [lwa]; + + F77_FCN (hybrd1) (hybrd1_fcn, &n, px, fvec, &tol, &tmp_info, wa, &lwa); + + delete [] wa; + } Vector retval; diff --git a/liboctave/NLEqn.h b/liboctave/NLEqn.h --- a/liboctave/NLEqn.h +++ b/liboctave/NLEqn.h @@ -24,7 +24,11 @@ #if !defined (octave_NLEqn_h) #define octave_NLEqn_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +#include "dColVector.h" #include "NLFunc.h" extern "C++" { diff --git a/liboctave/NLP.h b/liboctave/NLP.h --- a/liboctave/NLP.h +++ b/liboctave/NLP.h @@ -24,7 +24,11 @@ #if !defined (octave_NLP_h) #define octave_NLP_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +#include "dColVector.h" #include "Objective.h" #include "Bounds.h" #include "LinConst.h" diff --git a/liboctave/ODEFunc.cc b/liboctave/ODEFunc.cc --- a/liboctave/ODEFunc.cc +++ b/liboctave/ODEFunc.cc @@ -1,7 +1,7 @@ // ODEFunc.cc -*- C++ -*- /* -Copyright (C) 1992, 1993 John W. Eaton +Copyright (C) 1992, 1993, 1994 John W. Eaton This file is part of Octave. @@ -25,18 +25,22 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include "ODEFunc.h" ODEFunc::ODEFunc (void) { - fun = NULL; - jac = NULL; + fun = 0; + jac = 0; } ODEFunc::ODEFunc (ODERHSFunc f) { fun = f; - jac = NULL; + jac = 0; } ODEFunc::ODEFunc (ODERHSFunc f, ODEJacFunc j) diff --git a/liboctave/ODEFunc.h b/liboctave/ODEFunc.h --- a/liboctave/ODEFunc.h +++ b/liboctave/ODEFunc.h @@ -24,7 +24,12 @@ #if !defined (octave_ODEFunc_h) #define octave_ODEFunc_h 1 -#include "Matrix.h" +#if defined (__GNUG__) +#pragma interface +#endif + +class Matrix; +class ColumnVector; extern "C++" { diff --git a/liboctave/QPSOL.cc b/liboctave/QPSOL.cc --- a/liboctave/QPSOL.cc +++ b/liboctave/QPSOL.cc @@ -25,6 +25,10 @@ #include "config.h" #endif +#if defined (__GNUG__) +#pragma implementation +#endif + #include #include diff --git a/liboctave/QPSOL.h b/liboctave/QPSOL.h --- a/liboctave/QPSOL.h +++ b/liboctave/QPSOL.h @@ -24,9 +24,14 @@ #if !defined (octave_QPSOL_h) #define octave_QPSOL_h 1 +#if defined (__GNUG__) +#pragma interface +#endif + #ifndef QPSOL_MISSING -#include "Matrix.h" +#include "dMatrix.h" +#include "dColVector.h" #include "QP.h" extern "C++" {