changeset 465:4caf8fbeb778

[project @ 1994-06-06 01:05:09 by jwe]
author jwe
date Mon, 06 Jun 1994 01:05:09 +0000
parents ac2509294b09
children 05d84a40195d
files liboctave/CollocWt.cc liboctave/CollocWt.h liboctave/DAE.h liboctave/DAEFunc.cc liboctave/DAEFunc.h liboctave/DASSL.cc liboctave/FEGrid.cc liboctave/FEGrid.h liboctave/FSQP.cc liboctave/FSQP.h liboctave/LP.cc liboctave/LP.h liboctave/LPsolve.cc liboctave/LPsolve.h liboctave/LinConst.cc liboctave/LinConst.h liboctave/NLConst.cc liboctave/NLConst.h liboctave/NLEqn.cc liboctave/NLEqn.h liboctave/NLP.h liboctave/ODEFunc.cc liboctave/ODEFunc.h liboctave/QPSOL.cc liboctave/QPSOL.h
diffstat 25 files changed, 167 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CollocWt.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/CollocWt.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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 <iostream.h>
 
 #include "CollocWt.h"
--- a/liboctave/CollocWt.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/CollocWt.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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
--- a/liboctave/DAE.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/DAE.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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"
 
--- a/liboctave/DAEFunc.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/DAEFunc.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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)
--- a/liboctave/DAEFunc.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/DAEFunc.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {
 
--- a/liboctave/DASSL.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/DASSL.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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,
--- a/liboctave/FEGrid.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/FEGrid.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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 <iostream.h>
 
 #include "FEGrid.h"
--- a/liboctave/FEGrid.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/FEGrid.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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
--- a/liboctave/FSQP.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/FSQP.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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"
--- a/liboctave/FSQP.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/FSQP.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {
--- a/liboctave/LP.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LP.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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) {}
--- a/liboctave/LP.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LP.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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"
 
--- a/liboctave/LPsolve.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LPsolve.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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
--- a/liboctave/LPsolve.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LPsolve.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {
--- a/liboctave/LinConst.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LinConst.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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 <iostream.h>
 
 #include "LinConst.h"
--- a/liboctave/LinConst.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/LinConst.h	Mon Jun 06 01:05:09 1994 +0000
@@ -24,15 +24,21 @@
 #if !defined (octave_LinConst_h)
 #define octave_LinConst_h 1
 
-#include <float.h>
-
-extern "C++" {
+#if defined (__GNUG__)
+#pragma interface
+#endif
 
 class ostream;
 
-#include "Matrix.h"
+class ColumnVector;
+
+#include <float.h>
+
+#include "dMatrix.h"
 #include "Bounds.h"
 
+extern "C++" {
+
 #ifndef Vector
 #define Vector ColumnVector
 #endif
--- a/liboctave/NLConst.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/NLConst.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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)
 {
 }
--- a/liboctave/NLConst.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/NLConst.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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);
--- a/liboctave/NLEqn.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/NLEqn.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -25,9 +25,15 @@
 #include "config.h"
 #endif
 
+#if defined (__GNUG__)
+#pragma implementation
+#endif
+
 #include <float.h>
+#include <math.h>
 
 #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;
 
--- a/liboctave/NLEqn.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/NLEqn.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {
--- a/liboctave/NLP.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/NLP.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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"
--- a/liboctave/ODEFunc.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/ODEFunc.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -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)
--- a/liboctave/ODEFunc.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/ODEFunc.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {
 
--- a/liboctave/QPSOL.cc	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/QPSOL.cc	Mon Jun 06 01:05:09 1994 +0000
@@ -25,6 +25,10 @@
 #include "config.h"
 #endif
 
+#if defined (__GNUG__)
+#pragma implementation
+#endif
+
 #include <math.h>
 #include <float.h>
 
--- a/liboctave/QPSOL.h	Mon Jun 06 01:00:10 1994 +0000
+++ b/liboctave/QPSOL.h	Mon Jun 06 01:05:09 1994 +0000
@@ -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++" {