GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
oct-specfun.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2026 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_oct_specfun_h)
27#define octave_oct_specfun_h 1
28
29#include "octave-config.h"
30
31#include "mx-fwd.h"
32
33#include "Array-oct.h"
34#include "oct-cmplx.h"
35
38
39inline double acosh (double x) { return std::acosh (x); }
40inline float acosh (float x) { return std::acoshf (x); }
41inline Complex acosh (const Complex& x) { return std::acosh (x); }
42inline FloatComplex acosh (const FloatComplex& x) { return std::acosh (x); }
43
44extern OCTAVE_API Complex airy (const Complex& z, bool deriv, bool scaled,
46extern OCTAVE_API ComplexMatrix airy (const ComplexMatrix& z, bool deriv,
47 bool scaled, Array<octave_idx_type>& ierr);
48extern OCTAVE_API ComplexNDArray airy (const ComplexNDArray& z, bool deriv,
49 bool scaled, Array<octave_idx_type>& ierr);
50extern OCTAVE_API FloatComplex airy (const FloatComplex& z, bool deriv,
51 bool scaled, octave_idx_type& ierr);
53 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
55 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
56
57inline double asinh (double x) { return std::asinh (x); }
58inline float asinh (float x) { return std::asinhf (x); }
59inline Complex asinh (const Complex& x) { return std::asinh (x); }
60inline FloatComplex asinh (const FloatComplex& x) { return std::asinh (x); }
61
62inline double atanh (double x) { return std::atanh (x); }
63inline float atanh (float x) { return std::atanhf (x); }
64inline Complex atanh (const Complex& x) { return std::atanh (x); }
65inline FloatComplex atanh (const FloatComplex& x) { return std::atanh (x); }
66
67extern OCTAVE_API Complex besselj (double alpha, const Complex& x, bool scaled,
69extern OCTAVE_API Complex bessely (double alpha, const Complex& x, bool scaled,
71extern OCTAVE_API Complex besseli (double alpha, const Complex& x, bool scaled,
73extern OCTAVE_API Complex besselk (double alpha, const Complex& x, bool scaled,
75extern OCTAVE_API Complex besselh1 (double alpha, const Complex& x, bool scaled,
77extern OCTAVE_API Complex besselh2 (double alpha, const Complex& x, bool scaled,
79
80extern OCTAVE_API ComplexMatrix besselj (double alpha, const ComplexMatrix& x,
81 bool scaled, Array<octave_idx_type>& ierr);
82extern OCTAVE_API ComplexMatrix bessely (double alpha, const ComplexMatrix& x,
83 bool scaled, Array<octave_idx_type>& ierr);
84extern OCTAVE_API ComplexMatrix besseli (double alpha, const ComplexMatrix& x,
85 bool scaled, Array<octave_idx_type>& ierr);
86extern OCTAVE_API ComplexMatrix besselk (double alpha, const ComplexMatrix& x,
87 bool scaled, Array<octave_idx_type>& ierr);
88extern OCTAVE_API ComplexMatrix besselh1 (double alpha, const ComplexMatrix& x,
89 bool scaled, Array<octave_idx_type>& ierr);
90extern OCTAVE_API ComplexMatrix besselh2 (double alpha, const ComplexMatrix& x,
91 bool scaled, Array<octave_idx_type>& ierr);
92
93extern OCTAVE_API ComplexMatrix besselj (const Matrix& alpha, const Complex& x,
94 bool scaled, Array<octave_idx_type>& ierr);
95extern OCTAVE_API ComplexMatrix bessely (const Matrix& alpha, const Complex& x,
96 bool scaled, Array<octave_idx_type>& ierr);
97extern OCTAVE_API ComplexMatrix besseli (const Matrix& alpha, const Complex& x,
98 bool scaled, Array<octave_idx_type>& ierr);
99extern OCTAVE_API ComplexMatrix besselk (const Matrix& alpha, const Complex& x,
100 bool scaled, Array<octave_idx_type>& ierr);
101extern OCTAVE_API ComplexMatrix besselh1 (const Matrix& alpha, const Complex& x,
102 bool scaled, Array<octave_idx_type>& ierr);
103extern OCTAVE_API ComplexMatrix besselh2 (const Matrix& alpha, const Complex& x,
104 bool scaled, Array<octave_idx_type>& ierr);
105
106extern OCTAVE_API ComplexMatrix besselj (const Matrix& alpha,
107 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
108extern OCTAVE_API ComplexMatrix bessely (const Matrix& alpha,
109 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
110extern OCTAVE_API ComplexMatrix besseli (const Matrix& alpha,
111 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
112extern OCTAVE_API ComplexMatrix besselk (const Matrix& alpha,
113 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
114extern OCTAVE_API ComplexMatrix besselh1 (const Matrix& alpha,
115 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
116extern OCTAVE_API ComplexMatrix besselh2 (const Matrix& alpha,
117 const ComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
118
119extern OCTAVE_API ComplexNDArray besselj (double alpha, const ComplexNDArray& x,
120 bool scaled, Array<octave_idx_type>& ierr);
121extern OCTAVE_API ComplexNDArray bessely (double alpha, const ComplexNDArray& x,
122 bool scaled, Array<octave_idx_type>& ierr);
123extern OCTAVE_API ComplexNDArray besseli (double alpha, const ComplexNDArray& x,
124 bool scaled, Array<octave_idx_type>& ierr);
125extern OCTAVE_API ComplexNDArray besselk (double alpha, const ComplexNDArray& x,
126 bool scaled, Array<octave_idx_type>& ierr);
127extern OCTAVE_API ComplexNDArray besselh1 (double alpha,
128 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
129extern OCTAVE_API ComplexNDArray besselh2 (double alpha,
130 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
131
132extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha,
133 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
134extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha,
135 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
136extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha,
137 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
138extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha,
139 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
140extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha,
141 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
142extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha,
143 const Complex& x, bool scaled, Array<octave_idx_type>& ierr);
144
145extern OCTAVE_API ComplexNDArray besselj (const NDArray& alpha,
146 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
147extern OCTAVE_API ComplexNDArray bessely (const NDArray& alpha,
148 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
149extern OCTAVE_API ComplexNDArray besseli (const NDArray& alpha,
150 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
151extern OCTAVE_API ComplexNDArray besselk (const NDArray& alpha,
152 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
153extern OCTAVE_API ComplexNDArray besselh1 (const NDArray& alpha,
154 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
155extern OCTAVE_API ComplexNDArray besselh2 (const NDArray& alpha,
156 const ComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
157
158extern OCTAVE_API ComplexMatrix besselj (const RowVector& alpha,
159 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
160extern OCTAVE_API ComplexMatrix bessely (const RowVector& alpha,
161 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
162extern OCTAVE_API ComplexMatrix besseli (const RowVector& alpha,
163 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
164extern OCTAVE_API ComplexMatrix besselk (const RowVector& alpha,
165 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
166extern OCTAVE_API ComplexMatrix besselh1 (const RowVector& alpha,
167 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
168extern OCTAVE_API ComplexMatrix besselh2 (const RowVector& alpha,
169 const ComplexColumnVector& x, bool scaled, Array<octave_idx_type>& ierr);
170
171extern OCTAVE_API FloatComplex besselj (float alpha, const FloatComplex& x,
172 bool scaled, octave_idx_type& ierr);
173extern OCTAVE_API FloatComplex bessely (float alpha, const FloatComplex& x,
174 bool scaled, octave_idx_type& ierr);
175extern OCTAVE_API FloatComplex besseli (float alpha, const FloatComplex& x,
176 bool scaled, octave_idx_type& ierr);
177extern OCTAVE_API FloatComplex besselk (float alpha, const FloatComplex& x,
178 bool scaled, octave_idx_type& ierr);
179extern OCTAVE_API FloatComplex besselh1 (float alpha, const FloatComplex& x,
180 bool scaled, octave_idx_type& ierr);
181extern OCTAVE_API FloatComplex besselh2 (float alpha, const FloatComplex& x,
182 bool scaled, octave_idx_type& ierr);
183
184extern OCTAVE_API FloatComplexMatrix besselj (float alpha,
185 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
186extern OCTAVE_API FloatComplexMatrix bessely (float alpha,
187 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
188extern OCTAVE_API FloatComplexMatrix besseli (float alpha,
189 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
190extern OCTAVE_API FloatComplexMatrix besselk (float alpha,
191 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
192extern OCTAVE_API FloatComplexMatrix besselh1 (float alpha,
193 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
194extern OCTAVE_API FloatComplexMatrix besselh2 (float alpha,
195 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
196
198 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
200 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
202 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
204 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
206 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
208 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
209
211 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
213 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
215 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
217 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
219 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
221 const FloatComplexMatrix& x, bool scaled, Array<octave_idx_type>& ierr);
222
223extern OCTAVE_API FloatComplexNDArray besselj (float alpha,
224 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
225extern OCTAVE_API FloatComplexNDArray bessely (float alpha,
226 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
227extern OCTAVE_API FloatComplexNDArray besseli (float alpha,
228 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
229extern OCTAVE_API FloatComplexNDArray besselk (float alpha,
230 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
231extern OCTAVE_API FloatComplexNDArray besselh1 (float alpha,
232 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
233extern OCTAVE_API FloatComplexNDArray besselh2 (float alpha,
234 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
235
237 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
239 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
241 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
243 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
245 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
247 const FloatComplex& x, bool scaled, Array<octave_idx_type>& ierr);
248
250 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
252 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
254 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
256 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
258 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
260 const FloatComplexNDArray& x, bool scaled, Array<octave_idx_type>& ierr);
261
274
275extern OCTAVE_API Complex biry (const Complex& z, bool deriv, bool scaled,
277extern OCTAVE_API ComplexMatrix biry (const ComplexMatrix& z, bool deriv,
278 bool scaled, Array<octave_idx_type>& ierr);
279extern OCTAVE_API ComplexNDArray biry (const ComplexNDArray& z, bool deriv,
280 bool scaled, Array<octave_idx_type>& ierr);
281extern OCTAVE_API FloatComplex biry (const FloatComplex& z, bool deriv,
282 bool scaled, octave_idx_type& ierr);
284 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
286 bool deriv, bool scaled, Array<octave_idx_type>& ierr);
287
288inline double cbrt (double x) { return std::cbrt (x); }
289inline float cbrt (float x) { return std::cbrtf (x); }
290
291extern OCTAVE_API double dawson (double x);
292extern OCTAVE_API float dawson (float x);
293extern OCTAVE_API Complex dawson (const Complex& x);
295
296extern OCTAVE_API void ellipj (double u, double m, double& sn, double& cn,
297 double& dn, double& err);
298extern OCTAVE_API void ellipj (const Complex& u, double m, Complex& sn,
299 Complex& cn, Complex& dn, double& err);
300
301inline double erf (double x) { return std::erf (x); }
302inline float erf (float x) { return std::erff (x); }
303extern OCTAVE_API Complex erf (const Complex& x);
305
306inline double erfc (double x) { return std::erfc (x); }
307inline float erfc (float x) { return std::erfcf (x); }
308extern OCTAVE_API Complex erfc (const Complex& x);
310
311extern OCTAVE_API double erfcinv (double x);
312extern OCTAVE_API float erfcinv (float x);
313
314extern OCTAVE_API double erfcx (double x);
315extern OCTAVE_API float erfcx (float x);
316extern OCTAVE_API Complex erfcx (const Complex& x);
318
319extern OCTAVE_API double erfi (double x);
320extern OCTAVE_API float erfi (float x);
321extern OCTAVE_API Complex erfi (const Complex& x);
323
324extern OCTAVE_API double erfinv (double x);
325extern OCTAVE_API float erfinv (float x);
326
327inline double expm1 (double x) { return std::expm1 (x); }
328inline float expm1 (float x) { return std::expm1f (x); }
329extern OCTAVE_API Complex expm1 (const Complex& x);
331
332extern OCTAVE_API double gamma (double x);
333extern OCTAVE_API float gamma (float x);
334
335inline double lgamma (double x) { return std::lgamma (x); }
336inline float lgamma (float x) { return std::lgammaf (x); }
337
338inline double log1p (double x) { return std::log1p (x); }
339inline float log1p (float x) { return std::log1pf (x); }
340extern OCTAVE_API Complex log1p (const Complex& x);
342
343extern OCTAVE_API double psi (double x);
344extern OCTAVE_API float psi (float x);
345extern OCTAVE_API Complex psi (const Complex& x);
347extern OCTAVE_API double psi (octave_idx_type n, double z);
348extern OCTAVE_API float psi (octave_idx_type n, float z);
349
350extern OCTAVE_API Complex rc_lgamma (double x);
351extern OCTAVE_API FloatComplex rc_lgamma (float x);
352
353extern OCTAVE_API Complex rc_log1p (double x);
354extern OCTAVE_API FloatComplex rc_log1p (float x);
355
356OCTAVE_END_NAMESPACE(math)
357OCTAVE_END_NAMESPACE(octave)
358
359#endif
N Dimensional Array with copy-on-write semantics.
Definition Array-base.h:130
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#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
double erfc(double x)
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)
Complex besselh1(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
double asinh(double x)
Definition oct-specfun.h:57
Complex rc_lgamma(double x)
double erf(double x)
double atanh(double x)
Definition oct-specfun.h:62
double log1p(double x)
Complex airy(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
double acosh(double x)
Definition oct-specfun.h:39
double erfcx(double x)
double lgamma(double x)
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)
Complex biry(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
F77_RET_T const F77_DBLE * x