Mercurial > octave
annotate liboctave/numeric/Quad.h @ 31249:de6fc38c78c6
Make Jacobian types offered by dlsode.f accessible by lsode (bug #31626).
* liboctave/numeric/LSODE-opts.in: Add options "jacobian type", "lower jacobian
subdiagonals", and "upper jacobian subdiagonals".
* liboctave/numeric/LSODE.cc (file scope, lsode_j,
LSODE::do_integrate (double)): Handle new configurable Jacobian types.
* build-aux/mk-opts.pl: Don't implicitly convert to integer in condition.
author | Olaf Till <olaf.till@uni-jena.de> |
---|---|
date | Fri, 12 Nov 2010 08:53:05 +0100 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30101
diff
changeset
|
3 // Copyright (C) 1993-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
3 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_Quad_h) |
382 | 27 #define octave_Quad_h 1 |
28 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21218
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21218
diff
changeset
|
30 |
1296 | 31 #include "dColVector.h" |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
32 #include "fColVector.h" |
3 | 33 |
34 typedef double (*integrand_fcn) (double x); | |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
35 typedef float (*float_integrand_fcn) (float x); |
3 | 36 |
3998 | 37 #include "Quad-opts.h" |
289 | 38 |
1859 | 39 class |
6108 | 40 OCTAVE_API |
1859 | 41 Quad : public Quad_options |
3 | 42 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
43 public: |
3 | 44 |
1859 | 45 Quad (integrand_fcn fcn) |
30101
6e5e6ce2e705
maint: use "m_" prefix for member variables in class Quad.
Rik <rik@octave.org>
parents:
30082
diff
changeset
|
46 : Quad_options (), m_f (fcn), m_ff () { } |
1859 | 47 |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
48 Quad (float_integrand_fcn fcn) |
30101
6e5e6ce2e705
maint: use "m_" prefix for member variables in class Quad.
Rik <rik@octave.org>
parents:
30082
diff
changeset
|
49 : Quad_options (), m_f (), m_ff (fcn) { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
50 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
51 virtual ~Quad (void) = default; |
2424 | 52 |
1528 | 53 virtual double integrate (void) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
54 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
55 octave_idx_type ier, neval; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 double abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
58 } |
3 | 59 |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
60 virtual float float_integrate (void) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 octave_idx_type ier, neval; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 float abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
66 |
5275 | 67 virtual double integrate (octave_idx_type& ier) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
68 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
69 octave_idx_type neval; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
70 double abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
71 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
72 } |
1528 | 73 |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
74 virtual float float_integrate (octave_idx_type& ier) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
75 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
76 octave_idx_type neval; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 float abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
78 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
80 |
5275 | 81 virtual double integrate (octave_idx_type& ier, octave_idx_type& neval) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
82 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
83 double abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
84 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 } |
1528 | 86 |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
87 virtual float float_integrate (octave_idx_type& ier, octave_idx_type& neval) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
88 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 float abserr; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
91 } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
92 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
93 virtual double integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
94 double& abserr) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
95 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
96 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
97 } |
3511 | 98 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
99 virtual float float_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
100 float& abserr) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
101 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
102 return do_integrate (ier, neval, abserr); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
104 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
105 virtual double do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
106 double& abserr) = 0; |
3 | 107 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
108 virtual float do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
109 float& abserr) = 0; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
110 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
111 protected: |
3 | 112 |
30101
6e5e6ce2e705
maint: use "m_" prefix for member variables in class Quad.
Rik <rik@octave.org>
parents:
30082
diff
changeset
|
113 integrand_fcn m_f; |
6e5e6ce2e705
maint: use "m_" prefix for member variables in class Quad.
Rik <rik@octave.org>
parents:
30082
diff
changeset
|
114 float_integrand_fcn m_ff; |
3 | 115 }; |
116 | |
1859 | 117 class |
6108 | 118 OCTAVE_API |
1859 | 119 DefQuad : public Quad |
3 | 120 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
121 public: |
3 | 122 |
1859 | 123 DefQuad (integrand_fcn fcn) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
124 : Quad (fcn), m_lower_limit (0.0), m_upper_limit (1.0), m_singularities () |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
125 { } |
1528 | 126 |
1859 | 127 DefQuad (integrand_fcn fcn, double ll, double ul) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
128 : Quad (fcn), m_lower_limit (ll), m_upper_limit (ul), m_singularities () |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
129 { } |
1528 | 130 |
131 DefQuad (integrand_fcn fcn, double ll, double ul, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
132 const ColumnVector& sing) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
133 : Quad (fcn), m_lower_limit (ll), m_upper_limit (ul), |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
134 m_singularities (sing) { } |
1528 | 135 |
1859 | 136 DefQuad (integrand_fcn fcn, const ColumnVector& sing) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
137 : Quad (fcn), m_lower_limit (0.0), m_upper_limit (1.0), |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
138 m_singularities (sing) { } |
1528 | 139 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
140 ~DefQuad (void) = default; |
2424 | 141 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 double do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
143 double& abserr); |
3 | 144 |
21137
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
145 OCTAVE_NORETURN float do_integrate (octave_idx_type& ier, |
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
146 octave_idx_type& neval, float& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
147 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
148 private: |
3 | 149 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
150 double m_lower_limit; |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
151 double m_upper_limit; |
3 | 152 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
153 ColumnVector m_singularities; |
3 | 154 }; |
155 | |
1859 | 156 class |
6108 | 157 OCTAVE_API |
1859 | 158 IndefQuad : public Quad |
3 | 159 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
160 public: |
3 | 161 |
162 enum IntegralType { bound_to_inf, neg_inf_to_bound, doubly_infinite }; | |
163 | |
1859 | 164 IndefQuad (integrand_fcn fcn) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
165 : Quad (fcn), m_bound (0.0), m_type (bound_to_inf) { } |
1528 | 166 |
1859 | 167 IndefQuad (integrand_fcn fcn, double b, IntegralType t) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
168 : Quad (fcn), m_bound (b), m_type (t) { } |
1528 | 169 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
170 ~IndefQuad (void) = default; |
2424 | 171 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
172 double do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 double& abserr); |
3 | 174 |
22402
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
175 OCTAVE_NORETURN float do_integrate (octave_idx_type& ier, |
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
176 octave_idx_type& neval, float& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
177 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
178 private: |
3 | 179 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
180 double m_bound; |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
181 IntegralType m_type; |
3 | 182 }; |
183 | |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
184 class |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
185 OCTAVE_API |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
186 FloatDefQuad : public Quad |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
187 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
188 public: |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
189 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
190 FloatDefQuad (float_integrand_fcn fcn) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
191 : Quad (fcn), m_lower_limit (0.0), m_upper_limit (1.0), m_singularities () |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
192 { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
193 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
194 FloatDefQuad (float_integrand_fcn fcn, float ll, float ul) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
195 : Quad (fcn), m_lower_limit (ll), m_upper_limit (ul), m_singularities () |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
196 { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
197 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
198 FloatDefQuad (float_integrand_fcn fcn, float ll, float ul, |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
199 const FloatColumnVector& sing) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
200 : Quad (fcn), m_lower_limit (ll), m_upper_limit (ul), |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
201 m_singularities (sing) { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
202 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
203 FloatDefQuad (float_integrand_fcn fcn, const FloatColumnVector& sing) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
204 : Quad (fcn), m_lower_limit (0.0), m_upper_limit (1.0), |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
205 m_singularities (sing) { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
206 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
207 ~FloatDefQuad (void) = default; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
208 |
21137
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
209 OCTAVE_NORETURN double do_integrate (octave_idx_type& ier, |
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
210 octave_idx_type& neval, double& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
211 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
212 float do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
213 float& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
214 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
215 private: |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
216 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
217 float m_lower_limit; |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
218 float m_upper_limit; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
219 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
220 FloatColumnVector m_singularities; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
221 }; |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
222 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
223 class |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
224 OCTAVE_API |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
225 FloatIndefQuad : public Quad |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
226 { |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
227 public: |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
228 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
229 enum IntegralType { bound_to_inf, neg_inf_to_bound, doubly_infinite }; |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
230 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
231 FloatIndefQuad (float_integrand_fcn fcn) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
232 : Quad (fcn), m_bound (0.0), m_type (bound_to_inf) { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
233 |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
234 FloatIndefQuad (float_integrand_fcn fcn, double b, IntegralType t) |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
235 : Quad (fcn), m_bound (b), m_type (t) { } |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
236 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
237 ~FloatIndefQuad (void) = default; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
238 |
21137
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
239 OCTAVE_NORETURN double do_integrate (octave_idx_type& ier, |
623fc7d08cc6
maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
240 octave_idx_type& neval, double& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
241 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
242 float do_integrate (octave_idx_type& ier, octave_idx_type& neval, |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
243 float& abserr); |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
244 |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
245 private: |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
246 |
30082
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
247 float m_bound; |
1788b9f6db6a
maint: use "m_" prefix for member variables in file 'Quad.h'.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
248 IntegralType m_type; |
7805
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
249 }; |
62affb34e648
Make quad work with single precision
David Bateman <dbateman@free.fr>
parents:
7231
diff
changeset
|
250 |
3 | 251 #endif |