home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-bin.lha / include / octave / DAE.h < prev    next >
C/C++ Source or Header  |  1996-10-12  |  2KB  |  100 lines

  1. // DAE.h                                                -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. #if !defined (octave_DAE_h)
  25. #define octave_DAE_h 1
  26.  
  27. #include "dColVector.h"
  28. #include "ODE.h"
  29. #include "DAEFunc.h"
  30.  
  31. extern "C++" {
  32.  
  33. #ifndef Vector
  34. #define Vector ColumnVector
  35. #endif
  36.  
  37. class DAE : public ODE, public DAEFunc
  38. {
  39. public:
  40.  
  41.   DAE (void);
  42.  
  43.   DAE (int);
  44.  
  45.   DAE (const Vector& x, double time, DAEFunc& f);
  46.  
  47.   DAE (const Vector& x, const Vector& xdot, double time, DAEFunc& f);
  48.  
  49.  ~DAE (void);
  50.  
  51.   Vector deriv (void);
  52.  
  53.   virtual void initialize (const Vector& x, double t);
  54.   virtual void initialize (const Vector& x, const Vector& xdot, double t);
  55.  
  56.   Vector integrate (double t);
  57.  
  58.   Matrix integrate (const Vector& tout, Matrix& xdot_out);
  59.   Matrix integrate (const Vector& tout, Matrix& xdot_out,
  60.             const Vector& tcrit); 
  61.  
  62. protected:
  63.  
  64. /*
  65.  * Some of this is probably too closely related to DASSL, but hey,
  66.  * this is just a first attempt...
  67.  */
  68.  
  69.   Vector xdot;
  70.  
  71. private:
  72.  
  73.   int integration_error;
  74.   int restart;
  75.   int liw;  
  76.   int lrw;
  77.   int idid;
  78.   int *info;
  79.   int *iwork;
  80.   double *rwork;
  81.  
  82.   friend int ddassl_j (double *time, double *state, double *deriv,
  83.                double *pd, double *cj, double *rpar, int *ipar);
  84.  
  85.   friend int ddassl_f (double *time, double *state, double *deriv,
  86.                double *delta, int *ires, double *rpar, int *ipar);
  87.  
  88. };
  89.  
  90. } // extern "C++"
  91.  
  92. #endif
  93.  
  94. /*
  95. ;;; Local Variables: ***
  96. ;;; mode: C++ ***
  97. ;;; page-delimiter: "^/\\*" ***
  98. ;;; End: ***
  99. */
  100.