GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
CollocWt.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_CollocWt_h)
27#define octave_CollocWt_h 1
28
29#include "octave-config.h"
30
31#include <iosfwd>
32
33#include "dMatrix.h"
34#include "dColVector.h"
35
36namespace octave
37{
39 {
40 public:
41
42 CollocWt (void)
43 : m_n (0), m_inc_left (0), m_inc_right (0), m_lb (0.0), m_rb (1.0),
44 m_alpha (0.0), m_beta (0.0), m_r (), m_q (), m_A (), m_B (),
45 m_initialized (false)
46 { }
47
49 : m_n (nc), m_inc_left (il), m_inc_right (ir), m_lb (0.0), m_rb (1.0),
50 m_alpha (0.0), m_beta (0.0), m_r (), m_q (), m_A (), m_B (),
51 m_initialized (false)
52 { }
53
55 double l, double rr)
56 : m_n (nc), m_inc_left (il), m_inc_right (ir), m_lb (l), m_rb (rr),
57 m_alpha (0.0), m_beta (0.0), m_r (), m_q (), m_A (), m_B (),
58 m_initialized (false)
59 { }
60
61 CollocWt (octave_idx_type nc, double a, double b, octave_idx_type il,
63 : m_n (nc), m_inc_left (il), m_inc_right (ir), m_lb (0.0), m_rb (1.0),
64 m_alpha (a), m_beta (b), m_r (), m_q (), m_A (), m_B (),
65 m_initialized (false)
66 { }
67
68 CollocWt (octave_idx_type nc, double a, double b, octave_idx_type il,
70 double ll, double rr)
71 : m_n (nc), m_inc_left (il), m_inc_right (ir), m_lb (ll), m_rb (rr),
72 m_alpha (a), m_beta (b), m_r (), m_q (), m_A (), m_B (),
73 m_initialized (false)
74 { }
75
76 CollocWt (const CollocWt& a) = default;
77
78 CollocWt& operator = (const CollocWt& a) = default;
79
80 ~CollocWt (void) = default;
81
83 {
84 m_n = nc;
85 m_initialized = false;
86 return *this;
87 }
88
90 {
91 m_inc_left = 1;
92 m_initialized = false;
93 return *this;
94 }
95
97 {
98 m_inc_left = 0;
99 m_initialized = false;
100 return *this;
101 }
102
103 CollocWt& set_left (double val);
104
106 {
107 m_inc_right = 1;
108 m_initialized = false;
109 return *this;
110 }
111
113 {
114 m_inc_right = 0;
115 m_initialized = false;
116 return *this;
117 }
118
119 CollocWt& set_right (double val);
120
121 CollocWt& set_alpha (double val)
122 {
123 m_alpha = val;
124 m_initialized = false;
125 return *this;
126 }
127
128 CollocWt& set_beta (double val)
129 {
130 m_beta = val;
131 m_initialized = false;
132 return *this;
133 }
134
135 octave_idx_type ncol (void) const { return m_n; }
136
137 octave_idx_type left_included (void) const { return m_inc_left; }
138 octave_idx_type right_included (void) const { return m_inc_right; }
139
140 double left (void) const { return m_lb; }
141 double right (void) const { return m_rb; }
142
143 double width (void) const { return m_rb - m_lb; }
144
145 double alpha (void) const { return m_alpha; }
146 double beta (void) const { return m_beta; }
147
149 {
150 if (! m_initialized)
151 init ();
152
153 return m_r;
154 }
155
157 {
158 if (! m_initialized)
159 init ();
160
161 return m_q;
162 }
163
164 ColumnVector quad_weights (void) { return quad (); }
165
167 {
168 if (! m_initialized)
169 init ();
170
171 return m_A;
172 }
173
175 {
176 if (! m_initialized)
177 init ();
178
179 return m_B;
180 }
181
182 friend std::ostream& operator << (std::ostream&, const CollocWt&);
183
184 protected:
185
187
190
191 double m_lb;
192 double m_rb;
193
194 double m_alpha;
195 double m_beta;
196
199
202
204
205 void init (void);
206
207 void error (const char *msg);
208 };
209}
210
211#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
212OCTAVE_DEPRECATED (7, "use 'octave::CollocWt' instead")
213typedef octave::CollocWt CollocWt;
214#endif
215
216#endif
Definition: dMatrix.h:42
ColumnVector quad_weights(void)
Definition: CollocWt.h:164
CollocWt(void)
Definition: CollocWt.h:42
ColumnVector m_r
Definition: CollocWt.h:197
CollocWt & add_right(void)
Definition: CollocWt.h:105
octave_idx_type m_inc_left
Definition: CollocWt.h:188
double right(void) const
Definition: CollocWt.h:141
CollocWt(octave_idx_type nc, octave_idx_type il, octave_idx_type ir, double l, double rr)
Definition: CollocWt.h:54
Matrix second(void)
Definition: CollocWt.h:174
ColumnVector quad(void)
Definition: CollocWt.h:156
double m_alpha
Definition: CollocWt.h:194
octave_idx_type ncol(void) const
Definition: CollocWt.h:135
CollocWt & resize(octave_idx_type nc)
Definition: CollocWt.h:82
CollocWt(octave_idx_type nc, octave_idx_type il, octave_idx_type ir)
Definition: CollocWt.h:48
CollocWt(const CollocWt &a)=default
ColumnVector roots(void)
Definition: CollocWt.h:148
Matrix first(void)
Definition: CollocWt.h:166
double alpha(void) const
Definition: CollocWt.h:145
double width(void) const
Definition: CollocWt.h:143
CollocWt & delete_left(void)
Definition: CollocWt.h:96
octave_idx_type left_included(void) const
Definition: CollocWt.h:137
CollocWt & add_left(void)
Definition: CollocWt.h:89
octave_idx_type m_n
Definition: CollocWt.h:186
bool m_initialized
Definition: CollocWt.h:203
octave_idx_type right_included(void) const
Definition: CollocWt.h:138
ColumnVector m_q
Definition: CollocWt.h:198
CollocWt & set_beta(double val)
Definition: CollocWt.h:128
double beta(void) const
Definition: CollocWt.h:146
double left(void) const
Definition: CollocWt.h:140
CollocWt(octave_idx_type nc, double a, double b, octave_idx_type il, octave_idx_type ir)
Definition: CollocWt.h:61
~CollocWt(void)=default
octave_idx_type m_inc_right
Definition: CollocWt.h:189
CollocWt & delete_right(void)
Definition: CollocWt.h:112
CollocWt & set_alpha(double val)
Definition: CollocWt.h:121
CollocWt(octave_idx_type nc, double a, double b, octave_idx_type il, octave_idx_type ir, double ll, double rr)
Definition: CollocWt.h:68
void error(const char *fmt,...)
Definition: error.cc:980
#define OCTAVE_API
Definition: main.in.cc:55
std::ostream & operator<<(std::ostream &os, const CollocWt &a)
Definition: CollocWt.cc:482