Mercurial > octave
annotate liboctave/lo-specfun.h @ 7638:2df457529cfa
implement expm1 and log1p functions
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 25 Mar 2008 19:47:21 -0400 |
parents | 8a939b217863 |
children | 82be108cc558 |
rev | line source |
---|---|
3146 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 2002, 2004, 2005, 2006, 2007 |
4 John W. Eaton | |
3146 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
3146 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
3146 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_liboctave_specfun_h) | |
25 #define octave_liboctave_specfun_h 1 | |
26 | |
3220 | 27 #include "oct-cmplx.h" |
5275 | 28 #include "oct-types.h" |
4844 | 29 #include "ArrayN.h" |
3220 | 30 |
31 template <class T> class Array2; | |
3146 | 32 class Matrix; |
3220 | 33 class ComplexMatrix; |
4844 | 34 class NDArray; |
35 class ComplexNDArray; | |
3220 | 36 class RowVector; |
37 class ComplexColumnVector; | |
3146 | 38 class Range; |
39 | |
40 #if !defined (HAVE_ACOSH) | |
6108 | 41 extern OCTAVE_API double acosh (double); |
3146 | 42 #endif |
43 | |
44 #if !defined (HAVE_ASINH) | |
6108 | 45 extern OCTAVE_API double asinh (double); |
3146 | 46 #endif |
47 | |
48 #if !defined (HAVE_ATANH) | |
6108 | 49 extern OCTAVE_API double atanh (double); |
3146 | 50 #endif |
51 | |
52 #if !defined (HAVE_ERF) | |
6108 | 53 extern OCTAVE_API double erf (double); |
3146 | 54 #endif |
55 | |
56 #if !defined (HAVE_ERFC) | |
6108 | 57 extern OCTAVE_API double erfc (double); |
3146 | 58 #endif |
59 | |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
60 #if !defined (HAVE_EXPM1) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
61 extern OCTAVE_API double expm1 (double x); |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
62 #endif |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
63 extern OCTAVE_API Complex expm1 (const Complex& x); |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
64 |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
65 #if !defined (HAVE_LOG1P) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
66 extern OCTAVE_API double log1p (double x); |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
67 #endif |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
68 extern OCTAVE_API Complex log1p (const Complex& x); |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7601
diff
changeset
|
69 |
6108 | 70 extern OCTAVE_API double xgamma (double x); |
71 extern OCTAVE_API double xlgamma (double x); | |
7601
8a939b217863
Treat negative values to lgamma and beta correctly
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
72 extern OCTAVE_API Complex xlgamma (const Complex& x); |
3146 | 73 |
6108 | 74 extern OCTAVE_API Complex |
5275 | 75 besselj (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 76 |
6108 | 77 extern OCTAVE_API Complex |
5275 | 78 bessely (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 79 |
6108 | 80 extern OCTAVE_API Complex |
5275 | 81 besseli (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 82 |
6108 | 83 extern OCTAVE_API Complex |
5275 | 84 besselk (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 85 |
6108 | 86 extern OCTAVE_API Complex |
5275 | 87 besselh1 (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 88 |
6108 | 89 extern OCTAVE_API Complex |
5275 | 90 besselh2 (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 91 |
6108 | 92 extern OCTAVE_API ComplexMatrix |
3220 | 93 besselj (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 94 Array2<octave_idx_type>& ierr); |
3220 | 95 |
6108 | 96 extern OCTAVE_API ComplexMatrix |
3220 | 97 bessely (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 98 Array2<octave_idx_type>& ierr); |
3220 | 99 |
6108 | 100 extern OCTAVE_API ComplexMatrix |
3220 | 101 besseli (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 102 Array2<octave_idx_type>& ierr); |
3220 | 103 |
6108 | 104 extern OCTAVE_API ComplexMatrix |
3220 | 105 besselk (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 106 Array2<octave_idx_type>& ierr); |
3220 | 107 |
6108 | 108 extern OCTAVE_API ComplexMatrix |
3220 | 109 besselh1 (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 110 Array2<octave_idx_type>& ierr); |
3220 | 111 |
6108 | 112 extern OCTAVE_API ComplexMatrix |
3220 | 113 besselh2 (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 114 Array2<octave_idx_type>& ierr); |
3220 | 115 |
6108 | 116 extern OCTAVE_API ComplexMatrix |
3220 | 117 besselj (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 118 Array2<octave_idx_type>& ierr); |
3220 | 119 |
6108 | 120 extern OCTAVE_API ComplexMatrix |
3220 | 121 bessely (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 122 Array2<octave_idx_type>& ierr); |
3220 | 123 |
6108 | 124 extern OCTAVE_API ComplexMatrix |
3220 | 125 besseli (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 126 Array2<octave_idx_type>& ierr); |
3220 | 127 |
6108 | 128 extern OCTAVE_API ComplexMatrix |
3220 | 129 besselk (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 130 Array2<octave_idx_type>& ierr); |
3146 | 131 |
6108 | 132 extern OCTAVE_API ComplexMatrix |
3220 | 133 besselh1 (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 134 Array2<octave_idx_type>& ierr); |
3220 | 135 |
6108 | 136 extern OCTAVE_API ComplexMatrix |
3220 | 137 besselh2 (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 138 Array2<octave_idx_type>& ierr); |
3220 | 139 |
6108 | 140 extern OCTAVE_API ComplexMatrix |
3220 | 141 besselj (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 142 Array2<octave_idx_type>& ierr); |
3220 | 143 |
6108 | 144 extern OCTAVE_API ComplexMatrix |
3220 | 145 bessely (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 146 Array2<octave_idx_type>& ierr); |
3220 | 147 |
6108 | 148 extern OCTAVE_API ComplexMatrix |
3220 | 149 besseli (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 150 Array2<octave_idx_type>& ierr); |
3220 | 151 |
6108 | 152 extern OCTAVE_API ComplexMatrix |
3220 | 153 besselk (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 154 Array2<octave_idx_type>& ierr); |
3220 | 155 |
6108 | 156 extern OCTAVE_API ComplexMatrix |
3220 | 157 besselh1 (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 158 Array2<octave_idx_type>& ierr); |
3220 | 159 |
6108 | 160 extern OCTAVE_API ComplexMatrix |
3220 | 161 besselh2 (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 162 Array2<octave_idx_type>& ierr); |
3220 | 163 |
6108 | 164 extern OCTAVE_API ComplexNDArray |
4844 | 165 besselj (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 166 ArrayN<octave_idx_type>& ierr); |
4844 | 167 |
6108 | 168 extern OCTAVE_API ComplexNDArray |
4844 | 169 bessely (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 170 ArrayN<octave_idx_type>& ierr); |
4844 | 171 |
6108 | 172 extern OCTAVE_API ComplexNDArray |
4844 | 173 besseli (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 174 ArrayN<octave_idx_type>& ierr); |
4844 | 175 |
6108 | 176 extern OCTAVE_API ComplexNDArray |
4844 | 177 besselk (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 178 ArrayN<octave_idx_type>& ierr); |
4844 | 179 |
6108 | 180 extern OCTAVE_API ComplexNDArray |
4844 | 181 besselh1 (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 182 ArrayN<octave_idx_type>& ierr); |
4844 | 183 |
6108 | 184 extern OCTAVE_API ComplexNDArray |
4844 | 185 besselh2 (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 186 ArrayN<octave_idx_type>& ierr); |
4844 | 187 |
6108 | 188 extern OCTAVE_API ComplexNDArray |
4844 | 189 besselj (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 190 ArrayN<octave_idx_type>& ierr); |
4844 | 191 |
6108 | 192 extern OCTAVE_API ComplexNDArray |
4844 | 193 bessely (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 194 ArrayN<octave_idx_type>& ierr); |
4844 | 195 |
6108 | 196 extern OCTAVE_API ComplexNDArray |
4844 | 197 besseli (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 198 ArrayN<octave_idx_type>& ierr); |
4844 | 199 |
6108 | 200 extern OCTAVE_API ComplexNDArray |
4844 | 201 besselk (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 202 ArrayN<octave_idx_type>& ierr); |
4844 | 203 |
6108 | 204 extern OCTAVE_API ComplexNDArray |
4844 | 205 besselh1 (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 206 ArrayN<octave_idx_type>& ierr); |
4844 | 207 |
6108 | 208 extern OCTAVE_API ComplexNDArray |
4844 | 209 besselh2 (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 210 ArrayN<octave_idx_type>& ierr); |
4844 | 211 |
6108 | 212 extern OCTAVE_API ComplexNDArray |
4844 | 213 besselj (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 214 ArrayN<octave_idx_type>& ierr); |
4844 | 215 |
6108 | 216 extern OCTAVE_API ComplexNDArray |
4844 | 217 bessely (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 218 ArrayN<octave_idx_type>& ierr); |
4844 | 219 |
6108 | 220 extern OCTAVE_API ComplexNDArray |
4844 | 221 besseli (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 222 ArrayN<octave_idx_type>& ierr); |
4844 | 223 |
6108 | 224 extern OCTAVE_API ComplexNDArray |
4844 | 225 besselk (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 226 ArrayN<octave_idx_type>& ierr); |
4844 | 227 |
6108 | 228 extern OCTAVE_API ComplexNDArray |
4844 | 229 besselh1 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 230 ArrayN<octave_idx_type>& ierr); |
4844 | 231 |
6108 | 232 extern OCTAVE_API ComplexNDArray |
4844 | 233 besselh2 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 234 ArrayN<octave_idx_type>& ierr); |
4844 | 235 |
6108 | 236 extern OCTAVE_API ComplexMatrix |
3220 | 237 besselj (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 238 Array2<octave_idx_type>& ierr); |
3220 | 239 |
6108 | 240 extern OCTAVE_API ComplexMatrix |
3220 | 241 bessely (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 242 Array2<octave_idx_type>& ierr); |
3220 | 243 |
6108 | 244 extern OCTAVE_API ComplexMatrix |
3220 | 245 besseli (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 246 Array2<octave_idx_type>& ierr); |
3220 | 247 |
6108 | 248 extern OCTAVE_API ComplexMatrix |
3220 | 249 besselk (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 250 Array2<octave_idx_type>& ierr); |
3220 | 251 |
6108 | 252 extern OCTAVE_API ComplexMatrix |
3220 | 253 besselh1 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 254 Array2<octave_idx_type>& ierr); |
3220 | 255 |
6108 | 256 extern OCTAVE_API ComplexMatrix |
3220 | 257 besselh2 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 258 Array2<octave_idx_type>& ierr); |
3220 | 259 |
6108 | 260 extern OCTAVE_API Complex airy (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr); |
261 extern OCTAVE_API Complex biry (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr); | |
3220 | 262 |
6108 | 263 extern OCTAVE_API ComplexMatrix |
5275 | 264 airy (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr); |
3220 | 265 |
6108 | 266 extern OCTAVE_API ComplexMatrix |
5275 | 267 biry (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr); |
3146 | 268 |
6108 | 269 extern OCTAVE_API ComplexNDArray |
5275 | 270 airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); |
4844 | 271 |
6108 | 272 extern OCTAVE_API ComplexNDArray |
5275 | 273 biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); |
4844 | 274 |
6108 | 275 extern OCTAVE_API double betainc (double x, double a, double b); |
276 extern OCTAVE_API Matrix betainc (double x, double a, const Matrix& b); | |
277 extern OCTAVE_API Matrix betainc (double x, const Matrix& a, double b); | |
278 extern OCTAVE_API Matrix betainc (double x, const Matrix& a, const Matrix& b); | |
3146 | 279 |
6108 | 280 extern OCTAVE_API NDArray betainc (double x, double a, const NDArray& b); |
281 extern OCTAVE_API NDArray betainc (double x, const NDArray& a, double b); | |
282 extern OCTAVE_API NDArray betainc (double x, const NDArray& a, const NDArray& b); | |
4844 | 283 |
6108 | 284 extern OCTAVE_API Matrix betainc (const Matrix& x, double a, double b); |
285 extern OCTAVE_API Matrix betainc (const Matrix& x, double a, const Matrix& b); | |
286 extern OCTAVE_API Matrix betainc (const Matrix& x, const Matrix& a, double b); | |
287 extern OCTAVE_API Matrix betainc (const Matrix& x, const Matrix& a, const Matrix& b); | |
3146 | 288 |
6108 | 289 extern OCTAVE_API NDArray betainc (const NDArray& x, double a, double b); |
290 extern OCTAVE_API NDArray betainc (const NDArray& x, double a, const NDArray& b); | |
291 extern OCTAVE_API NDArray betainc (const NDArray& x, const NDArray& a, double b); | |
292 extern OCTAVE_API NDArray betainc (const NDArray& x, const NDArray& a, const NDArray& b); | |
4844 | 293 |
6108 | 294 extern OCTAVE_API double gammainc (double x, double a, bool& err); |
295 extern OCTAVE_API Matrix gammainc (double x, const Matrix& a); | |
296 extern OCTAVE_API Matrix gammainc (const Matrix& x, double a); | |
297 extern OCTAVE_API Matrix gammainc (const Matrix& x, const Matrix& a); | |
3146 | 298 |
6108 | 299 extern OCTAVE_API NDArray gammainc (double x, const NDArray& a); |
300 extern OCTAVE_API NDArray gammainc (const NDArray& x, double a); | |
301 extern OCTAVE_API NDArray gammainc (const NDArray& x, const NDArray& a); | |
4844 | 302 |
4004 | 303 inline double gammainc (double x, double a) |
304 { | |
305 bool err; | |
306 return gammainc (x, a, err); | |
307 } | |
308 | |
3146 | 309 #endif |
310 | |
311 /* | |
312 ;;; Local Variables: *** | |
313 ;;; mode: C *** | |
314 ;;; page-delimiter: "^/\\*" *** | |
315 ;;; End: *** | |
316 */ |