3
|
1 // CollocWt.h -*- C++ -*- |
|
2 /* |
|
3 |
382
|
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 |
382
|
24 #if !defined (octave_CollocWt_h) |
|
25 #define octave_CollocWt_h 1 |
|
26 |
384
|
27 #include "Matrix.h" |
|
28 |
382
|
29 extern "C++" { |
3
|
30 |
238
|
31 class ostream; |
3
|
32 |
|
33 #ifndef Vector |
|
34 #define Vector ColumnVector |
|
35 #endif |
|
36 |
|
37 class CollocWt |
|
38 { |
|
39 public: |
|
40 |
|
41 CollocWt (void); |
|
42 CollocWt (int ncol, int include_left, int include_right); |
|
43 CollocWt (int ncol, int include_left, int include_right, double left, |
|
44 double right); |
|
45 CollocWt (int ncol, double alpha, double beta, int include_left, |
|
46 int include_right); |
|
47 CollocWt (int ncol, double alpha, double beta, int include_left, |
|
48 int include_right, double left, double right); |
|
49 |
|
50 CollocWt (const CollocWt&); |
|
51 |
|
52 CollocWt& operator = (const CollocWt&); |
|
53 |
|
54 CollocWt& resize (int ncol); |
|
55 |
|
56 CollocWt& add_left (void); |
|
57 CollocWt& delete_left (void); |
|
58 CollocWt& set_left (double val); |
|
59 |
|
60 CollocWt& add_right (void); |
|
61 CollocWt& delete_right (void); |
|
62 CollocWt& set_right (double val); |
|
63 |
|
64 CollocWt& set_alpha (double val); |
|
65 CollocWt& set_beta (double val); |
|
66 |
|
67 int ncol (void) const; |
|
68 int left_included (void) const; |
|
69 int right_included (void) const; |
|
70 |
|
71 double left (void) const; |
|
72 double right (void) const; |
|
73 double width (void) const; |
|
74 |
|
75 double alpha (void) const; |
|
76 double beta (void) const; |
|
77 |
|
78 Vector roots (void); |
|
79 Vector quad (void); |
|
80 Vector quad_weights (void); |
|
81 |
|
82 Matrix first (void); |
|
83 Matrix second (void); |
|
84 |
|
85 friend ostream& operator << (ostream&, const CollocWt&); |
|
86 |
|
87 protected: |
|
88 |
|
89 int n; |
|
90 int nt; |
|
91 |
|
92 int inc_left; |
|
93 int inc_right; |
|
94 |
|
95 double lb; |
|
96 double rb; |
|
97 |
|
98 double Alpha; |
|
99 double Beta; |
|
100 |
|
101 Vector r; |
|
102 Vector q; |
|
103 |
|
104 Matrix A; |
|
105 Matrix B; |
|
106 |
|
107 int initialized; |
|
108 |
|
109 void init (void); |
|
110 |
|
111 void error (const char *msg); |
|
112 }; |
|
113 |
|
114 inline int |
|
115 CollocWt::ncol (void) const |
|
116 { |
|
117 return n; |
|
118 } |
|
119 |
|
120 inline int CollocWt::left_included (void) const { return inc_left; } |
|
121 inline int CollocWt::right_included (void) const { return inc_right; } |
|
122 inline double CollocWt::left (void) const { return lb; } |
|
123 inline double CollocWt::right (void) const { return rb; } |
|
124 inline double CollocWt::width (void) const { return rb - lb; } |
|
125 inline double CollocWt::alpha (void) const { return Alpha; } |
|
126 inline double CollocWt::beta (void) const { return Beta; } |
|
127 |
|
128 inline Vector CollocWt::roots (void) |
|
129 { if (!initialized) init (); return r; } |
|
130 |
|
131 inline Vector CollocWt::quad (void) |
|
132 { if (!initialized) init (); return q; } |
|
133 |
|
134 inline Vector CollocWt::quad_weights (void) |
|
135 { return quad (); } |
|
136 |
|
137 inline Matrix CollocWt::first (void) |
|
138 { if (!initialized) init (); return A; } |
|
139 |
|
140 inline Matrix CollocWt::second (void) |
|
141 { if (!initialized) init (); return B; } |
|
142 |
382
|
143 } // extern "C++" |
|
144 |
3
|
145 #endif |
|
146 |
|
147 /* |
|
148 ;;; Local Variables: *** |
|
149 ;;; mode: C++ *** |
|
150 ;;; page-delimiter: "^/\\*" *** |
|
151 ;;; End: *** |
|
152 */ |