GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CollocWt.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2015 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_CollocWt_h)
24 #define octave_CollocWt_h 1
25 
26 #include <iosfwd>
27 
28 #include "dMatrix.h"
29 #include "dColVector.h"
30 
31 class
32 OCTAVE_API
34 {
35 public:
36 
37  CollocWt (void)
38  : n (0), inc_left (0), inc_right (0), lb (0.0), rb (1.0),
39  Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (false) { }
40 
42  : n (nc), inc_left (il), inc_right (ir), lb (0.0), rb (1.0),
43  Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (false) { }
44 
46  double l, double rr)
47  : n (nc), inc_left (il), inc_right (ir), lb (l), rb (rr),
48  Alpha (0.0), Beta (0.0), r (), q (), A (), B (), initialized (false) { }
49 
50  CollocWt (octave_idx_type nc, double a, double b, octave_idx_type il,
51  octave_idx_type ir)
52  : n (nc), inc_left (il), inc_right (ir), lb (0.0), rb (1.0),
53  Alpha (a), Beta (b), r (), q (), A (), B (), initialized (false) { }
54 
55  CollocWt (octave_idx_type nc, double a, double b, octave_idx_type il,
56  octave_idx_type ir,
57  double ll, double rr)
58  : n (nc), inc_left (il), inc_right (ir), lb (ll), rb (rr),
59  Alpha (a), Beta (b), r (), q (), A (), B (), initialized (false) { }
60 
61  CollocWt (const CollocWt& a)
62  : n (a.n), inc_left (a.inc_left), inc_right (a.inc_right),
63  lb (a.lb), rb (a.rb), Alpha (a.Alpha), Beta (a.Beta),
64  r (a.r), q (a.q), A (a.A), B (a.B),
65  initialized (a.initialized) { }
66 
67  CollocWt& operator = (const CollocWt& a)
68  {
69  if (this != &a)
70  {
71  n = a.n;
72  inc_left = a.inc_left;
73  inc_right = a.inc_right;
74  lb = a.lb;
75  rb = a.rb;
76  r = a.r;
77  q = a.q;
78  A = a.A;
79  B = a.B;
80  initialized = a.initialized;
81  }
82  return *this;
83  }
84 
85  ~CollocWt (void) { }
86 
88  {
89  n = nc;
90  initialized = false;
91  return *this;
92  }
93 
95  {
96  inc_left = 1;
97  initialized = false;
98  return *this;
99  }
100 
102  {
103  inc_left = 0;
104  initialized = false;
105  return *this;
106  }
107 
108  CollocWt& set_left (double val);
109 
111  {
112  inc_right = 1;
113  initialized = false;
114  return *this;
115  }
116 
118  {
119  inc_right = 0;
120  initialized = false;
121  return *this;
122  }
123 
124  CollocWt& set_right (double val);
125 
126  CollocWt& set_alpha (double val)
127  {
128  Alpha = val;
129  initialized = false;
130  return *this;
131  }
132 
133  CollocWt& set_beta (double val)
134  {
135  Beta = val;
136  initialized = false;
137  return *this;
138  }
139 
140  octave_idx_type ncol (void) const { return n; }
141 
142  octave_idx_type left_included (void) const { return inc_left; }
143  octave_idx_type right_included (void) const { return inc_right; }
144 
145  double left (void) const { return lb; }
146  double right (void) const { return rb; }
147 
148  double width (void) const { return rb - lb; }
149 
150  double alpha (void) const { return Alpha; }
151  double beta (void) const { return Beta; }
152 
153  ColumnVector roots (void) { if (!initialized) init (); return r; }
154  ColumnVector quad (void) { if (!initialized) init (); return q; }
155 
156  ColumnVector quad_weights (void) { return quad (); }
157 
158  Matrix first (void) { if (!initialized) init (); return A; }
159 
160  Matrix second (void) { if (!initialized) init (); return B; }
161 
162  friend std::ostream& operator << (std::ostream&, const CollocWt&);
163 
164 protected:
165 
167 
170 
171  double lb;
172  double rb;
173 
174  double Alpha;
175  double Beta;
176 
179 
182 
184 
185  void init (void);
186 
187  void error (const char *msg);
188 };
189 
190 #endif
double Alpha
Definition: CollocWt.h:174
double Beta
Definition: CollocWt.h:175
octave_idx_type right_included(void) const
Definition: CollocWt.h:143
CollocWt(octave_idx_type nc, double a, double b, octave_idx_type il, octave_idx_type ir, double ll, double rr)
Definition: CollocWt.h:55
F77_RET_T const octave_idx_type Complex * A
Definition: CmplxGEPBAL.cc:39
double beta(void) const
Definition: CollocWt.h:151
double left(void) const
Definition: CollocWt.h:145
void error(const char *fmt,...)
Definition: error.cc:476
double width(void) const
Definition: CollocWt.h:148
bool initialized
Definition: CollocWt.h:183
CollocWt & set_alpha(double val)
Definition: CollocWt.h:126
CollocWt(octave_idx_type nc, double a, double b, octave_idx_type il, octave_idx_type ir)
Definition: CollocWt.h:50
CollocWt & delete_right(void)
Definition: CollocWt.h:117
double alpha(void) const
Definition: CollocWt.h:150
~CollocWt(void)
Definition: CollocWt.h:85
CollocWt(const CollocWt &a)
Definition: CollocWt.h:61
CollocWt & add_right(void)
Definition: CollocWt.h:110
CollocWt & resize(octave_idx_type nc)
Definition: CollocWt.h:87
double rb
Definition: CollocWt.h:172
ColumnVector r
Definition: CollocWt.h:177
Matrix B
Definition: CollocWt.h:181
CollocWt & set_beta(double val)
Definition: CollocWt.h:133
ColumnVector roots(void)
Definition: CollocWt.h:153
CollocWt & delete_left(void)
Definition: CollocWt.h:101
CollocWt(octave_idx_type nc, octave_idx_type il, octave_idx_type ir, double l, double rr)
Definition: CollocWt.h:45
Definition: dMatrix.h:35
CollocWt & add_left(void)
Definition: CollocWt.h:94
F77_RET_T const octave_idx_type Complex const octave_idx_type Complex * B
Definition: CmplxGEPBAL.cc:39
octave_idx_type ncol(void) const
Definition: CollocWt.h:140
Matrix first(void)
Definition: CollocWt.h:158
ColumnVector quad(void)
Definition: CollocWt.h:154
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
ColumnVector q
Definition: CollocWt.h:178
double lb
Definition: CollocWt.h:171
octave_idx_type n
Definition: CollocWt.h:166
CollocWt(octave_idx_type nc, octave_idx_type il, octave_idx_type ir)
Definition: CollocWt.h:41
octave_idx_type left_included(void) const
Definition: CollocWt.h:142
CollocWt(void)
Definition: CollocWt.h:37
ColumnVector quad_weights(void)
Definition: CollocWt.h:156
double right(void) const
Definition: CollocWt.h:146
Matrix A
Definition: CollocWt.h:180
octave_idx_type inc_right
Definition: CollocWt.h:169
octave_idx_type inc_left
Definition: CollocWt.h:168
Matrix second(void)
Definition: CollocWt.h:160