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