GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
lo-specfun.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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_lo_specfun_h)
27#define octave_lo_specfun_h 1
28
29#include "octave-config.h"
30
31#include "mx-fwd.h"
32
33#include "Array.h"
34#include "oct-cmplx.h"
35
37
39
40inline double acosh (double x) { return std::acosh (x); }
41inline float acosh (float x) { return std::acoshf (x); }
42inline Complex acosh (const Complex& x) { return std::acosh (x); }
43inline FloatComplex acosh (const FloatComplex& x) { return std::acosh (x); }
44
45extern OCTAVE_API Complex airy (const Complex& z, bool deriv, bool scaled,
47extern OCTAVE_API ComplexMatrix airy (const ComplexMatrix& z, bool deriv,
48 bool scaled, Array<octave_idx_type>& ierr);
49extern OCTAVE_API ComplexNDArray airy (const ComplexNDArray& z, bool deriv,
50 bool scaled, Array<octave_idx_type>& ierr);
51extern OCTAVE_API FloatComplex airy (const FloatComplex& z, bool deriv,
52 bool scaled, octave_idx_type& ierr);
54 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
56 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
57
58inline double asinh (double x) { return std::asinh (x); }
59inline float asinh (float x) { return std::asinhf (x); }
60inline Complex asinh (const Complex& x) { return std::asinh (x); }
61inline FloatComplex asinh (const FloatComplex& x) { return std::asinh (x); }
62
63inline double atanh (double x) { return std::atanh (x); }
64inline float atanh (float x) { return std::atanhf (x); }
65inline Complex atanh (const Complex& x) { return std::atanh (x); }
66inline FloatComplex atanh (const FloatComplex& x) { return std::atanh (x); }
67
68extern OCTAVE_API Complex besselj (double alpha, const Complex& x, bool scaled,
70extern OCTAVE_API Complex bessely (double alpha, const Complex& x, bool scaled,
72extern OCTAVE_API Complex besseli (double alpha, const Complex& x, bool scaled,
74extern OCTAVE_API Complex besselk (double alpha, const Complex& x, bool scaled,
76extern OCTAVE_API Complex besselh1 (double alpha, const Complex& x, bool scaled,
78extern OCTAVE_API Complex besselh2 (double alpha, const Complex& x, bool scaled,
80
81extern OCTAVE_API ComplexMatrix besselj (double alpha, const ComplexMatrix& x,
82 bool scaled, Array<octave_idx_type>& ierr);
83extern OCTAVE_API ComplexMatrix bessely (double alpha, const ComplexMatrix& x,
84 bool scaled, Array<octave_idx_type>& ierr);
85extern OCTAVE_API ComplexMatrix besseli (double alpha, const ComplexMatrix& x,
86 bool scaled, Array<octave_idx_type>& ierr);
87extern OCTAVE_API ComplexMatrix besselk (double alpha, const ComplexMatrix& x,
88 bool scaled, Array<octave_idx_type>& ierr);
89extern OCTAVE_API ComplexMatrix besselh1 (double alpha, const ComplexMatrix& x,
90 bool scaled, Array<octave_idx_type>& ierr);
91extern OCTAVE_API ComplexMatrix besselh2 (double alpha, const ComplexMatrix& x,
92 bool scaled, Array<octave_idx_type>& ierr);
93
94extern OCTAVE_API ComplexMatrix besselj (const Matrix& alpha, const Complex& x,
95 bool scaled, Array<octave_idx_type>& ierr);
96extern OCTAVE_API ComplexMatrix bessely (const Matrix& alpha, const Complex& x,
97 bool scaled, Array<octave_idx_type>& ierr);
98extern OCTAVE_API ComplexMatrix besseli (const Matrix& alpha, const Complex& x,
99 bool scaled, Array<octave_idx_type>& ierr);
100extern OCTAVE_API ComplexMatrix besselk (const Matrix& alpha, const Complex& x,
101 bool scaled, Array<octave_idx_type>& ierr);
102extern OCTAVE_API ComplexMatrix besselh1 (const Matrix& alpha, const Complex& x,
103 bool scaled, Array<octave_idx_type>& ierr);
104extern OCTAVE_API ComplexMatrix besselh2 (const Matrix& alpha, const Complex& x,
105 bool scaled, Array<octave_idx_type>& ierr);
106
107extern OCTAVE_API ComplexMatrix besselj (const Matrix& alpha,
108 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
109extern OCTAVE_API ComplexMatrix bessely (const Matrix& alpha,
110 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
111extern OCTAVE_API ComplexMatrix besseli (const Matrix& alpha,
112 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
113extern OCTAVE_API ComplexMatrix besselk (const Matrix& alpha,
114 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
115extern OCTAVE_API ComplexMatrix besselh1 (const Matrix& alpha,
116 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
117extern OCTAVE_API ComplexMatrix besselh2 (const Matrix& alpha,
118 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
119
120extern OCTAVE_API ComplexNDArray besselj (double alpha, const ComplexNDArray& x,
121 bool scaled, Array<octave_idx_type>& ierr);
122extern OCTAVE_API ComplexNDArray bessely (double alpha, const ComplexNDArray& x,
123 bool scaled, Array<octave_idx_type>& ierr);
124extern OCTAVE_API ComplexNDArray besseli (double alpha, const ComplexNDArray& x,
125 bool scaled, Array<octave_idx_type>& ierr);
126extern OCTAVE_API ComplexNDArray besselk (double alpha, const ComplexNDArray& x,
127 bool scaled, Array<octave_idx_type>& ierr);
128extern OCTAVE_API ComplexNDArray besselh1 (double alpha,
129 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
130extern OCTAVE_API ComplexNDArray besselh2 (double alpha,
131 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
132
133extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha,
134 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
135extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha,
136 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
137extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha,
138 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
139extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha,
140 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
141extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha,
142 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
143extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha,
144 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
145
146extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha,
147 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
148extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha,
149 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
150extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha,
151 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
152extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha,
153 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
154extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha,
155 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
156extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha,
157 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
158
159extern OCTAVE_API ComplexMatrix besselj (const RowVector& alpha,
160 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
161extern OCTAVE_API ComplexMatrix bessely (const RowVector& alpha,
162 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
163extern OCTAVE_API ComplexMatrix besseli (const RowVector& alpha,
164 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
165extern OCTAVE_API ComplexMatrix besselk (const RowVector& alpha,
166 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
167extern OCTAVE_API ComplexMatrix besselh1 (const RowVector& alpha,
168 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
169extern OCTAVE_API ComplexMatrix besselh2 (const RowVector& alpha,
170 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
171
172extern OCTAVE_API FloatComplex besselj (float alpha, const FloatComplex& x,
173 bool scaled, octave_idx_type& ierr);
174extern OCTAVE_API FloatComplex bessely (float alpha, const FloatComplex& x,
175 bool scaled, octave_idx_type& ierr);
176extern OCTAVE_API FloatComplex besseli (float alpha, const FloatComplex& x,
177 bool scaled, octave_idx_type& ierr);
178extern OCTAVE_API FloatComplex besselk (float alpha, const FloatComplex& x,
179 bool scaled, octave_idx_type& ierr);
180extern OCTAVE_API FloatComplex besselh1 (float alpha, const FloatComplex& x,
181 bool scaled, octave_idx_type& ierr);
182extern OCTAVE_API FloatComplex besselh2 (float alpha, const FloatComplex& x,
183 bool scaled, octave_idx_type& ierr);
184
185extern OCTAVE_API FloatComplexMatrix besselj (float alpha,
186 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
187extern OCTAVE_API FloatComplexMatrix bessely (float alpha,
188 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
189extern OCTAVE_API FloatComplexMatrix besseli (float alpha,
190 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
191extern OCTAVE_API FloatComplexMatrix besselk (float alpha,
192 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
193extern OCTAVE_API FloatComplexMatrix besselh1 (float alpha,
194 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
195extern OCTAVE_API FloatComplexMatrix besselh2 (float alpha,
196 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
197
199 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
201 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
203 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
205 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
207 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
209 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
210
212 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
214 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
216 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
218 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
220 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
222 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
223
224extern OCTAVE_API FloatComplexNDArray besselj (float alpha,
225 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
226extern OCTAVE_API FloatComplexNDArray bessely (float alpha,
227 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
228extern OCTAVE_API FloatComplexNDArray besseli (float alpha,
229 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
230extern OCTAVE_API FloatComplexNDArray besselk (float alpha,
231 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
232extern OCTAVE_API FloatComplexNDArray besselh1 (float alpha,
233 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
234extern OCTAVE_API FloatComplexNDArray besselh2 (float alpha,
235 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
236
238 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
240 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
242 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
244 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
246 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
248 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
249
251 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
253 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
255 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
257 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
259 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
261 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
262
275
276extern OCTAVE_API Complex biry (const Complex& z, bool deriv, bool scaled,
278extern OCTAVE_API ComplexMatrix biry (const ComplexMatrix& z, bool deriv,
279 bool scaled, Array<octave_idx_type>& ierr);
280extern OCTAVE_API ComplexNDArray biry (const ComplexNDArray& z, bool deriv,
281 bool scaled, Array<octave_idx_type>& ierr);
282extern OCTAVE_API FloatComplex biry (const FloatComplex& z, bool deriv,
283 bool scaled, octave_idx_type& ierr);
285 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
287 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
288
289inline double cbrt (double x) { return std::cbrt (x); }
290inline float cbrt (float x) { return std::cbrtf (x); }
291
292extern OCTAVE_API double dawson (double x);
293extern OCTAVE_API float dawson (float x);
294extern OCTAVE_API Complex dawson (const Complex& x);
296
297extern OCTAVE_API void ellipj (double u, double m, double& sn, double& cn,
298 double& dn, double& err);
299extern OCTAVE_API void ellipj (const Complex& u, double m, Complex& sn,
300 Complex& cn, Complex& dn, double& err);
301
302inline double erf (double x) { return std::erf (x); }
303inline float erf (float x) { return std::erff (x); }
304extern OCTAVE_API Complex erf (const Complex& x);
306
307inline double erfc (double x) { return std::erfc (x); }
308inline float erfc (float x) { return std::erfcf (x); }
309extern OCTAVE_API Complex erfc (const Complex& x);
311
312extern OCTAVE_API double erfcinv (double x);
313extern OCTAVE_API float erfcinv (float x);
314
315extern OCTAVE_API double erfcx (double x);
316extern OCTAVE_API float erfcx (float x);
317extern OCTAVE_API Complex erfcx (const Complex& x);
319
320extern OCTAVE_API double erfi (double x);
321extern OCTAVE_API float erfi (float x);
322extern OCTAVE_API Complex erfi (const Complex& x);
324
325extern OCTAVE_API double erfinv (double x);
326extern OCTAVE_API float erfinv (float x);
327
328inline double expm1 (double x) { return std::expm1 (x); }
329inline float expm1 (float x) { return std::expm1f (x); }
330extern OCTAVE_API Complex expm1 (const Complex& x);
332
333extern OCTAVE_API double gamma (double x);
334extern OCTAVE_API float gamma (float x);
335
336inline double lgamma (double x) { return std::lgamma (x); }
337inline float lgamma (float x) { return std::lgammaf (x); }
338
339inline double log1p (double x) { return std::log1p (x); }
340inline float log1p (float x) { return std::log1pf (x); }
341extern OCTAVE_API Complex log1p (const Complex& x);
343
344extern OCTAVE_API double psi (double x);
345extern OCTAVE_API float psi (float x);
346extern OCTAVE_API Complex psi (const Complex& x);
348extern OCTAVE_API double psi (octave_idx_type n, double z);
349extern OCTAVE_API float psi (octave_idx_type n, float z);
350
351extern OCTAVE_API Complex rc_lgamma (double x);
352extern OCTAVE_API FloatComplex rc_lgamma (float x);
353
354extern OCTAVE_API Complex rc_log1p (double x);
355extern OCTAVE_API FloatComplex rc_log1p (float x);
356
357OCTAVE_END_NAMESPACE(math)
358OCTAVE_END_NAMESPACE(octave)
359
360#endif
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
F77_RET_T const F77_DBLE * x
double erfc(double x)
Definition lo-specfun.h:307
Complex besselj(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double erfinv(double x)
double erfi(double x)
Complex besselh2(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double gamma(double x)
double dawson(double x)
double psi(double x)
double erfcinv(double x)
Complex rc_log1p(double x)
Complex bessely(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
Complex besselk(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double cbrt(double x)
Definition lo-specfun.h:289
Complex besselh1(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double asinh(double x)
Definition lo-specfun.h:58
Complex rc_lgamma(double x)
double erf(double x)
Definition lo-specfun.h:302
double atanh(double x)
Definition lo-specfun.h:63
double log1p(double x)
Definition lo-specfun.h:339
Complex airy(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
double acosh(double x)
Definition lo-specfun.h:40
double erfcx(double x)
double lgamma(double x)
Definition lo-specfun.h:336
void ellipj(double u, double m, double &sn, double &cn, double &dn, double &err)
Complex besseli(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double expm1(double x)
Definition lo-specfun.h:328
Complex biry(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
#define OCTAVE_API
Definition main.in.cc:55
std::complex< double > Complex
Definition oct-cmplx.h:33
std::complex< float > FloatComplex
Definition oct-cmplx.h:34