Mercurial > octave
annotate liboctave/lo-specfun.h @ 7601:8a939b217863
Treat negative values to lgamma and beta correctly
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 18 Mar 2008 21:32:48 -0400 |
parents | a1dbe9d80eee |
children | 2df457529cfa |
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 | |
6108 | 60 extern OCTAVE_API double xgamma (double x); |
61 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
|
62 extern OCTAVE_API Complex xlgamma (const Complex& x); |
3146 | 63 |
6108 | 64 extern OCTAVE_API Complex |
5275 | 65 besselj (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 66 |
6108 | 67 extern OCTAVE_API Complex |
5275 | 68 bessely (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 69 |
6108 | 70 extern OCTAVE_API Complex |
5275 | 71 besseli (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 72 |
6108 | 73 extern OCTAVE_API Complex |
5275 | 74 besselk (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 75 |
6108 | 76 extern OCTAVE_API Complex |
5275 | 77 besselh1 (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 78 |
6108 | 79 extern OCTAVE_API Complex |
5275 | 80 besselh2 (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); |
3220 | 81 |
6108 | 82 extern OCTAVE_API ComplexMatrix |
3220 | 83 besselj (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 84 Array2<octave_idx_type>& ierr); |
3220 | 85 |
6108 | 86 extern OCTAVE_API ComplexMatrix |
3220 | 87 bessely (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 88 Array2<octave_idx_type>& ierr); |
3220 | 89 |
6108 | 90 extern OCTAVE_API ComplexMatrix |
3220 | 91 besseli (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 92 Array2<octave_idx_type>& ierr); |
3220 | 93 |
6108 | 94 extern OCTAVE_API ComplexMatrix |
3220 | 95 besselk (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 96 Array2<octave_idx_type>& ierr); |
3220 | 97 |
6108 | 98 extern OCTAVE_API ComplexMatrix |
3220 | 99 besselh1 (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 100 Array2<octave_idx_type>& ierr); |
3220 | 101 |
6108 | 102 extern OCTAVE_API ComplexMatrix |
3220 | 103 besselh2 (double alpha, const ComplexMatrix& x, bool scaled, |
5275 | 104 Array2<octave_idx_type>& ierr); |
3220 | 105 |
6108 | 106 extern OCTAVE_API ComplexMatrix |
3220 | 107 besselj (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 108 Array2<octave_idx_type>& ierr); |
3220 | 109 |
6108 | 110 extern OCTAVE_API ComplexMatrix |
3220 | 111 bessely (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 112 Array2<octave_idx_type>& ierr); |
3220 | 113 |
6108 | 114 extern OCTAVE_API ComplexMatrix |
3220 | 115 besseli (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 116 Array2<octave_idx_type>& ierr); |
3220 | 117 |
6108 | 118 extern OCTAVE_API ComplexMatrix |
3220 | 119 besselk (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 120 Array2<octave_idx_type>& ierr); |
3146 | 121 |
6108 | 122 extern OCTAVE_API ComplexMatrix |
3220 | 123 besselh1 (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 124 Array2<octave_idx_type>& ierr); |
3220 | 125 |
6108 | 126 extern OCTAVE_API ComplexMatrix |
3220 | 127 besselh2 (const Matrix& alpha, const Complex& x, bool scaled, |
5275 | 128 Array2<octave_idx_type>& ierr); |
3220 | 129 |
6108 | 130 extern OCTAVE_API ComplexMatrix |
3220 | 131 besselj (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 132 Array2<octave_idx_type>& ierr); |
3220 | 133 |
6108 | 134 extern OCTAVE_API ComplexMatrix |
3220 | 135 bessely (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 136 Array2<octave_idx_type>& ierr); |
3220 | 137 |
6108 | 138 extern OCTAVE_API ComplexMatrix |
3220 | 139 besseli (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 140 Array2<octave_idx_type>& ierr); |
3220 | 141 |
6108 | 142 extern OCTAVE_API ComplexMatrix |
3220 | 143 besselk (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 144 Array2<octave_idx_type>& ierr); |
3220 | 145 |
6108 | 146 extern OCTAVE_API ComplexMatrix |
3220 | 147 besselh1 (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 148 Array2<octave_idx_type>& ierr); |
3220 | 149 |
6108 | 150 extern OCTAVE_API ComplexMatrix |
3220 | 151 besselh2 (const Matrix& alpha, const ComplexMatrix& x, bool scaled, |
5275 | 152 Array2<octave_idx_type>& ierr); |
3220 | 153 |
6108 | 154 extern OCTAVE_API ComplexNDArray |
4844 | 155 besselj (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 156 ArrayN<octave_idx_type>& ierr); |
4844 | 157 |
6108 | 158 extern OCTAVE_API ComplexNDArray |
4844 | 159 bessely (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 160 ArrayN<octave_idx_type>& ierr); |
4844 | 161 |
6108 | 162 extern OCTAVE_API ComplexNDArray |
4844 | 163 besseli (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 164 ArrayN<octave_idx_type>& ierr); |
4844 | 165 |
6108 | 166 extern OCTAVE_API ComplexNDArray |
4844 | 167 besselk (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 168 ArrayN<octave_idx_type>& ierr); |
4844 | 169 |
6108 | 170 extern OCTAVE_API ComplexNDArray |
4844 | 171 besselh1 (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 172 ArrayN<octave_idx_type>& ierr); |
4844 | 173 |
6108 | 174 extern OCTAVE_API ComplexNDArray |
4844 | 175 besselh2 (double alpha, const ComplexNDArray& x, bool scaled, |
5275 | 176 ArrayN<octave_idx_type>& ierr); |
4844 | 177 |
6108 | 178 extern OCTAVE_API ComplexNDArray |
4844 | 179 besselj (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 180 ArrayN<octave_idx_type>& ierr); |
4844 | 181 |
6108 | 182 extern OCTAVE_API ComplexNDArray |
4844 | 183 bessely (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 184 ArrayN<octave_idx_type>& ierr); |
4844 | 185 |
6108 | 186 extern OCTAVE_API ComplexNDArray |
4844 | 187 besseli (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 188 ArrayN<octave_idx_type>& ierr); |
4844 | 189 |
6108 | 190 extern OCTAVE_API ComplexNDArray |
4844 | 191 besselk (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 192 ArrayN<octave_idx_type>& ierr); |
4844 | 193 |
6108 | 194 extern OCTAVE_API ComplexNDArray |
4844 | 195 besselh1 (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 196 ArrayN<octave_idx_type>& ierr); |
4844 | 197 |
6108 | 198 extern OCTAVE_API ComplexNDArray |
4844 | 199 besselh2 (const NDArray& alpha, const Complex& x, bool scaled, |
5275 | 200 ArrayN<octave_idx_type>& ierr); |
4844 | 201 |
6108 | 202 extern OCTAVE_API ComplexNDArray |
4844 | 203 besselj (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 204 ArrayN<octave_idx_type>& ierr); |
4844 | 205 |
6108 | 206 extern OCTAVE_API ComplexNDArray |
4844 | 207 bessely (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 208 ArrayN<octave_idx_type>& ierr); |
4844 | 209 |
6108 | 210 extern OCTAVE_API ComplexNDArray |
4844 | 211 besseli (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 212 ArrayN<octave_idx_type>& ierr); |
4844 | 213 |
6108 | 214 extern OCTAVE_API ComplexNDArray |
4844 | 215 besselk (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 216 ArrayN<octave_idx_type>& ierr); |
4844 | 217 |
6108 | 218 extern OCTAVE_API ComplexNDArray |
4844 | 219 besselh1 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 220 ArrayN<octave_idx_type>& ierr); |
4844 | 221 |
6108 | 222 extern OCTAVE_API ComplexNDArray |
4844 | 223 besselh2 (const NDArray& alpha, const ComplexNDArray& x, bool scaled, |
5275 | 224 ArrayN<octave_idx_type>& ierr); |
4844 | 225 |
6108 | 226 extern OCTAVE_API ComplexMatrix |
3220 | 227 besselj (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 228 Array2<octave_idx_type>& ierr); |
3220 | 229 |
6108 | 230 extern OCTAVE_API ComplexMatrix |
3220 | 231 bessely (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 232 Array2<octave_idx_type>& ierr); |
3220 | 233 |
6108 | 234 extern OCTAVE_API ComplexMatrix |
3220 | 235 besseli (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 236 Array2<octave_idx_type>& ierr); |
3220 | 237 |
6108 | 238 extern OCTAVE_API ComplexMatrix |
3220 | 239 besselk (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 240 Array2<octave_idx_type>& ierr); |
3220 | 241 |
6108 | 242 extern OCTAVE_API ComplexMatrix |
3220 | 243 besselh1 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 244 Array2<octave_idx_type>& ierr); |
3220 | 245 |
6108 | 246 extern OCTAVE_API ComplexMatrix |
3220 | 247 besselh2 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, |
5275 | 248 Array2<octave_idx_type>& ierr); |
3220 | 249 |
6108 | 250 extern OCTAVE_API Complex airy (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr); |
251 extern OCTAVE_API Complex biry (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr); | |
3220 | 252 |
6108 | 253 extern OCTAVE_API ComplexMatrix |
5275 | 254 airy (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr); |
3220 | 255 |
6108 | 256 extern OCTAVE_API ComplexMatrix |
5275 | 257 biry (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr); |
3146 | 258 |
6108 | 259 extern OCTAVE_API ComplexNDArray |
5275 | 260 airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); |
4844 | 261 |
6108 | 262 extern OCTAVE_API ComplexNDArray |
5275 | 263 biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); |
4844 | 264 |
6108 | 265 extern OCTAVE_API double betainc (double x, double a, double b); |
266 extern OCTAVE_API Matrix betainc (double x, double a, const Matrix& b); | |
267 extern OCTAVE_API Matrix betainc (double x, const Matrix& a, double b); | |
268 extern OCTAVE_API Matrix betainc (double x, const Matrix& a, const Matrix& b); | |
3146 | 269 |
6108 | 270 extern OCTAVE_API NDArray betainc (double x, double a, const NDArray& b); |
271 extern OCTAVE_API NDArray betainc (double x, const NDArray& a, double b); | |
272 extern OCTAVE_API NDArray betainc (double x, const NDArray& a, const NDArray& b); | |
4844 | 273 |
6108 | 274 extern OCTAVE_API Matrix betainc (const Matrix& x, double a, double b); |
275 extern OCTAVE_API Matrix betainc (const Matrix& x, double a, const Matrix& b); | |
276 extern OCTAVE_API Matrix betainc (const Matrix& x, const Matrix& a, double b); | |
277 extern OCTAVE_API Matrix betainc (const Matrix& x, const Matrix& a, const Matrix& b); | |
3146 | 278 |
6108 | 279 extern OCTAVE_API NDArray betainc (const NDArray& x, double a, double b); |
280 extern OCTAVE_API NDArray betainc (const NDArray& x, double a, const NDArray& b); | |
281 extern OCTAVE_API NDArray betainc (const NDArray& x, const NDArray& a, double b); | |
282 extern OCTAVE_API NDArray betainc (const NDArray& x, const NDArray& a, const NDArray& b); | |
4844 | 283 |
6108 | 284 extern OCTAVE_API double gammainc (double x, double a, bool& err); |
285 extern OCTAVE_API Matrix gammainc (double x, const Matrix& a); | |
286 extern OCTAVE_API Matrix gammainc (const Matrix& x, double a); | |
287 extern OCTAVE_API Matrix gammainc (const Matrix& x, const Matrix& a); | |
3146 | 288 |
6108 | 289 extern OCTAVE_API NDArray gammainc (double x, const NDArray& a); |
290 extern OCTAVE_API NDArray gammainc (const NDArray& x, double a); | |
291 extern OCTAVE_API NDArray gammainc (const NDArray& x, const NDArray& a); | |
4844 | 292 |
4004 | 293 inline double gammainc (double x, double a) |
294 { | |
295 bool err; | |
296 return gammainc (x, a, err); | |
297 } | |
298 | |
3146 | 299 #endif |
300 | |
301 /* | |
302 ;;; Local Variables: *** | |
303 ;;; mode: C *** | |
304 ;;; page-delimiter: "^/\\*" *** | |
305 ;;; End: *** | |
306 */ |