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

  1. // NLEqn.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_NLEqn_h)
  25. #define octave_NLEqn_h 1
  26.  
  27. #include "dColVector.h"
  28. #include "NLFunc.h"
  29.  
  30. extern "C++" {
  31.  
  32. #ifndef Vector
  33. #define Vector ColumnVector
  34. #endif
  35.  
  36. class NLEqn_options
  37. {
  38.  public:
  39.  
  40.   NLEqn_options (void);
  41.   NLEqn_options (const NLEqn_options& opt);
  42.  
  43.   NLEqn_options& operator = (const NLEqn_options& opt);
  44.  
  45.   ~NLEqn_options (void);
  46.  
  47.   void init (void);
  48.   void copy (const NLEqn_options& opt);
  49.  
  50.   void set_default_options (void);
  51.  
  52.   void set_tolerance (double);
  53.  
  54.   double tolerance (void);
  55.  
  56.  private:
  57.  
  58.   double x_tolerance;
  59. };
  60.  
  61. class NLEqn : public NLFunc, public NLEqn_options
  62. {
  63.  public:
  64.  
  65.   NLEqn (void);
  66.   NLEqn (const Vector&, const NLFunc);
  67.  
  68.   NLEqn (const NLEqn &);
  69.  
  70.   NLEqn& operator = (const NLEqn& a);
  71.  
  72.   void resize (int);
  73.  
  74.   void set_states (const Vector&);
  75.  
  76.   Vector states (void) const;
  77.  
  78.   int size (void) const;
  79.  
  80.   Vector solve (void);
  81.   Vector solve (const Vector&);
  82.  
  83.   Vector solve (int& info);
  84.   Vector solve (const Vector&, int& info);
  85.  
  86.  private:
  87.  
  88.   int n;
  89.   Vector x;
  90.  
  91.   void error (const char* msg);
  92. };
  93.  
  94. } // extern "C++"
  95.  
  96. #endif
  97.  
  98. /*
  99. ;;; Local Variables: ***
  100. ;;; mode: C++ ***
  101. ;;; page-delimiter: "^/\\*" ***
  102. ;;; End: ***
  103. */
  104.