comparison liboctave/lo-specfun.h @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents 2df457529cfa
children e998e81224b5
comparison
equal deleted inserted replaced
7788:45f5faba05a2 7789:82be108cc558
33 class ComplexMatrix; 33 class ComplexMatrix;
34 class NDArray; 34 class NDArray;
35 class ComplexNDArray; 35 class ComplexNDArray;
36 class RowVector; 36 class RowVector;
37 class ComplexColumnVector; 37 class ComplexColumnVector;
38 class FloatMatrix;
39 class FloatComplexMatrix;
40 class FloatNDArray;
41 class FloatComplexNDArray;
42 class FloatRowVector;
43 class FloatComplexColumnVector;
38 class Range; 44 class Range;
39 45
40 #if !defined (HAVE_ACOSH) 46 #if !defined (HAVE_ACOSH)
41 extern OCTAVE_API double acosh (double); 47 extern OCTAVE_API double acosh (double);
42 #endif 48 #endif
55 61
56 #if !defined (HAVE_ERFC) 62 #if !defined (HAVE_ERFC)
57 extern OCTAVE_API double erfc (double); 63 extern OCTAVE_API double erfc (double);
58 #endif 64 #endif
59 65
66 #if !defined (HAVE_ACOSHF)
67 extern OCTAVE_API float acoshf (float);
68 #endif
69
70 #if !defined (HAVE_ASINHF)
71 extern OCTAVE_API float asinhf (float);
72 #endif
73
74 #if !defined (HAVE_ATANHF)
75 extern OCTAVE_API float atanhf (float);
76 #endif
77
78 #if !defined (HAVE_ERFF)
79 extern OCTAVE_API float erf (float);
80 #endif
81
82 #if !defined (HAVE_ERFCF)
83 extern OCTAVE_API float erfc (float);
84 #endif
85
60 #if !defined (HAVE_EXPM1) 86 #if !defined (HAVE_EXPM1)
61 extern OCTAVE_API double expm1 (double x); 87 extern OCTAVE_API double expm1 (double x);
62 #endif 88 #endif
63 extern OCTAVE_API Complex expm1 (const Complex& x); 89 extern OCTAVE_API Complex expm1 (const Complex& x);
64 90
91 #if !defined (HAVE_EXPM1F)
92 extern OCTAVE_API float expm1f (float x);
93 #endif
94 extern OCTAVE_API FloatComplex expm1f (const FloatComplex& x);
95
65 #if !defined (HAVE_LOG1P) 96 #if !defined (HAVE_LOG1P)
66 extern OCTAVE_API double log1p (double x); 97 extern OCTAVE_API double log1p (double x);
67 #endif 98 #endif
68 extern OCTAVE_API Complex log1p (const Complex& x); 99 extern OCTAVE_API Complex log1p (const Complex& x);
100
101 #if !defined (HAVE_LOG1PF)
102 extern OCTAVE_API float log1pf (float x);
103 #endif
104 extern OCTAVE_API FloatComplex log1pf (const FloatComplex& x);
69 105
70 extern OCTAVE_API double xgamma (double x); 106 extern OCTAVE_API double xgamma (double x);
71 extern OCTAVE_API double xlgamma (double x); 107 extern OCTAVE_API double xlgamma (double x);
72 extern OCTAVE_API Complex xlgamma (const Complex& x); 108 extern OCTAVE_API Complex xlgamma (const Complex& x);
73 109
110 extern OCTAVE_API float xgamma (float x);
111 extern OCTAVE_API float xlgamma (float x);
112 extern OCTAVE_API FloatComplex xlgamma (const FloatComplex& x);
113
74 extern OCTAVE_API Complex 114 extern OCTAVE_API Complex
75 besselj (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); 115 besselj (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr);
76 116
77 extern OCTAVE_API Complex 117 extern OCTAVE_API Complex
78 bessely (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr); 118 bessely (double alpha, const Complex& x, bool scaled, octave_idx_type& ierr);
255 295
256 extern OCTAVE_API ComplexMatrix 296 extern OCTAVE_API ComplexMatrix
257 besselh2 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled, 297 besselh2 (const RowVector& alpha, const ComplexColumnVector& x, bool scaled,
258 Array2<octave_idx_type>& ierr); 298 Array2<octave_idx_type>& ierr);
259 299
300 extern OCTAVE_API FloatComplex
301 besselj (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
302
303 extern OCTAVE_API FloatComplex
304 bessely (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
305
306 extern OCTAVE_API FloatComplex
307 besseli (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
308
309 extern OCTAVE_API FloatComplex
310 besselk (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
311
312 extern OCTAVE_API FloatComplex
313 besselh1 (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
314
315 extern OCTAVE_API FloatComplex
316 besselh2 (float alpha, const FloatComplex& x, bool scaled, octave_idx_type& ierr);
317
318 extern OCTAVE_API FloatComplexMatrix
319 besselj (float alpha, const FloatComplexMatrix& x, bool scaled,
320 Array2<octave_idx_type>& ierr);
321
322 extern OCTAVE_API FloatComplexMatrix
323 bessely (float alpha, const FloatComplexMatrix& x, bool scaled,
324 Array2<octave_idx_type>& ierr);
325
326 extern OCTAVE_API FloatComplexMatrix
327 besseli (float alpha, const FloatComplexMatrix& x, bool scaled,
328 Array2<octave_idx_type>& ierr);
329
330 extern OCTAVE_API FloatComplexMatrix
331 besselk (float alpha, const FloatComplexMatrix& x, bool scaled,
332 Array2<octave_idx_type>& ierr);
333
334 extern OCTAVE_API FloatComplexMatrix
335 besselh1 (float alpha, const FloatComplexMatrix& x, bool scaled,
336 Array2<octave_idx_type>& ierr);
337
338 extern OCTAVE_API FloatComplexMatrix
339 besselh2 (float alpha, const FloatComplexMatrix& x, bool scaled,
340 Array2<octave_idx_type>& ierr);
341
342 extern OCTAVE_API FloatComplexMatrix
343 besselj (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
344 Array2<octave_idx_type>& ierr);
345
346 extern OCTAVE_API FloatComplexMatrix
347 bessely (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
348 Array2<octave_idx_type>& ierr);
349
350 extern OCTAVE_API FloatComplexMatrix
351 besseli (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
352 Array2<octave_idx_type>& ierr);
353
354 extern OCTAVE_API FloatComplexMatrix
355 besselk (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
356 Array2<octave_idx_type>& ierr);
357
358 extern OCTAVE_API FloatComplexMatrix
359 besselh1 (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
360 Array2<octave_idx_type>& ierr);
361
362 extern OCTAVE_API FloatComplexMatrix
363 besselh2 (const FloatMatrix& alpha, const FloatComplex& x, bool scaled,
364 Array2<octave_idx_type>& ierr);
365
366 extern OCTAVE_API FloatComplexMatrix
367 besselj (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
368 Array2<octave_idx_type>& ierr);
369
370 extern OCTAVE_API FloatComplexMatrix
371 bessely (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
372 Array2<octave_idx_type>& ierr);
373
374 extern OCTAVE_API FloatComplexMatrix
375 besseli (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
376 Array2<octave_idx_type>& ierr);
377
378 extern OCTAVE_API FloatComplexMatrix
379 besselk (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
380 Array2<octave_idx_type>& ierr);
381
382 extern OCTAVE_API FloatComplexMatrix
383 besselh1 (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
384 Array2<octave_idx_type>& ierr);
385
386 extern OCTAVE_API FloatComplexMatrix
387 besselh2 (const FloatMatrix& alpha, const FloatComplexMatrix& x, bool scaled,
388 Array2<octave_idx_type>& ierr);
389
390 extern OCTAVE_API FloatComplexNDArray
391 besselj (float alpha, const FloatComplexNDArray& x, bool scaled,
392 ArrayN<octave_idx_type>& ierr);
393
394 extern OCTAVE_API FloatComplexNDArray
395 bessely (float alpha, const FloatComplexNDArray& x, bool scaled,
396 ArrayN<octave_idx_type>& ierr);
397
398 extern OCTAVE_API FloatComplexNDArray
399 besseli (float alpha, const FloatComplexNDArray& x, bool scaled,
400 ArrayN<octave_idx_type>& ierr);
401
402 extern OCTAVE_API FloatComplexNDArray
403 besselk (float alpha, const FloatComplexNDArray& x, bool scaled,
404 ArrayN<octave_idx_type>& ierr);
405
406 extern OCTAVE_API FloatComplexNDArray
407 besselh1 (float alpha, const FloatComplexNDArray& x, bool scaled,
408 ArrayN<octave_idx_type>& ierr);
409
410 extern OCTAVE_API FloatComplexNDArray
411 besselh2 (float alpha, const FloatComplexNDArray& x, bool scaled,
412 ArrayN<octave_idx_type>& ierr);
413
414 extern OCTAVE_API FloatComplexNDArray
415 besselj (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
416 ArrayN<octave_idx_type>& ierr);
417
418 extern OCTAVE_API FloatComplexNDArray
419 bessely (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
420 ArrayN<octave_idx_type>& ierr);
421
422 extern OCTAVE_API FloatComplexNDArray
423 besseli (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
424 ArrayN<octave_idx_type>& ierr);
425
426 extern OCTAVE_API FloatComplexNDArray
427 besselk (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
428 ArrayN<octave_idx_type>& ierr);
429
430 extern OCTAVE_API FloatComplexNDArray
431 besselh1 (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
432 ArrayN<octave_idx_type>& ierr);
433
434 extern OCTAVE_API FloatComplexNDArray
435 besselh2 (const FloatNDArray& alpha, const FloatComplex& x, bool scaled,
436 ArrayN<octave_idx_type>& ierr);
437
438 extern OCTAVE_API FloatComplexNDArray
439 besselj (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
440 ArrayN<octave_idx_type>& ierr);
441
442 extern OCTAVE_API FloatComplexNDArray
443 bessely (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
444 ArrayN<octave_idx_type>& ierr);
445
446 extern OCTAVE_API FloatComplexNDArray
447 besseli (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
448 ArrayN<octave_idx_type>& ierr);
449
450 extern OCTAVE_API FloatComplexNDArray
451 besselk (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
452 ArrayN<octave_idx_type>& ierr);
453
454 extern OCTAVE_API FloatComplexNDArray
455 besselh1 (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
456 ArrayN<octave_idx_type>& ierr);
457
458 extern OCTAVE_API FloatComplexNDArray
459 besselh2 (const FloatNDArray& alpha, const FloatComplexNDArray& x, bool scaled,
460 ArrayN<octave_idx_type>& ierr);
461
462 extern OCTAVE_API FloatComplexMatrix
463 besselj (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
464 Array2<octave_idx_type>& ierr);
465
466 extern OCTAVE_API FloatComplexMatrix
467 bessely (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
468 Array2<octave_idx_type>& ierr);
469
470 extern OCTAVE_API FloatComplexMatrix
471 besseli (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
472 Array2<octave_idx_type>& ierr);
473
474 extern OCTAVE_API FloatComplexMatrix
475 besselk (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
476 Array2<octave_idx_type>& ierr);
477
478 extern OCTAVE_API FloatComplexMatrix
479 besselh1 (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
480 Array2<octave_idx_type>& ierr);
481
482 extern OCTAVE_API FloatComplexMatrix
483 besselh2 (const FloatRowVector& alpha, const FloatComplexColumnVector& x, bool scaled,
484 Array2<octave_idx_type>& ierr);
485
260 extern OCTAVE_API Complex airy (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr); 486 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); 487 extern OCTAVE_API Complex biry (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr);
262 488
263 extern OCTAVE_API ComplexMatrix 489 extern OCTAVE_API ComplexMatrix
264 airy (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr); 490 airy (const ComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr);
269 extern OCTAVE_API ComplexNDArray 495 extern OCTAVE_API ComplexNDArray
270 airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); 496 airy (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr);
271 497
272 extern OCTAVE_API ComplexNDArray 498 extern OCTAVE_API ComplexNDArray
273 biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr); 499 biry (const ComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr);
500
501 extern OCTAVE_API FloatComplex airy (const FloatComplex& z, bool deriv, bool scaled, octave_idx_type& ierr);
502 extern OCTAVE_API FloatComplex biry (const FloatComplex& z, bool deriv, bool scaled, octave_idx_type& ierr);
503
504 extern OCTAVE_API FloatComplexMatrix
505 airy (const FloatComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr);
506
507 extern OCTAVE_API FloatComplexMatrix
508 biry (const FloatComplexMatrix& z, bool deriv, bool scaled, Array2<octave_idx_type>& ierr);
509
510 extern OCTAVE_API FloatComplexNDArray
511 airy (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr);
512
513 extern OCTAVE_API FloatComplexNDArray
514 biry (const FloatComplexNDArray& z, bool deriv, bool scaled, ArrayN<octave_idx_type>& ierr);
274 515
275 extern OCTAVE_API double betainc (double x, double a, double b); 516 extern OCTAVE_API double betainc (double x, double a, double b);
276 extern OCTAVE_API Matrix betainc (double x, double a, const Matrix& b); 517 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); 518 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); 519 extern OCTAVE_API Matrix betainc (double x, const Matrix& a, const Matrix& b);
289 extern OCTAVE_API NDArray betainc (const NDArray& x, double a, double b); 530 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); 531 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); 532 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); 533 extern OCTAVE_API NDArray betainc (const NDArray& x, const NDArray& a, const NDArray& b);
293 534
535 extern OCTAVE_API float betainc (float x, float a, float b);
536 extern OCTAVE_API FloatMatrix betainc (float x, float a, const FloatMatrix& b);
537 extern OCTAVE_API FloatMatrix betainc (float x, const FloatMatrix& a, float b);
538 extern OCTAVE_API FloatMatrix betainc (float x, const FloatMatrix& a, const FloatMatrix& b);
539
540 extern OCTAVE_API FloatNDArray betainc (float x, float a, const FloatNDArray& b);
541 extern OCTAVE_API FloatNDArray betainc (float x, const FloatNDArray& a, float b);
542 extern OCTAVE_API FloatNDArray betainc (float x, const FloatNDArray& a, const FloatNDArray& b);
543
544 extern OCTAVE_API FloatMatrix betainc (const FloatMatrix& x, float a, float b);
545 extern OCTAVE_API FloatMatrix betainc (const FloatMatrix& x, float a, const FloatMatrix& b);
546 extern OCTAVE_API FloatMatrix betainc (const FloatMatrix& x, const FloatMatrix& a, float b);
547 extern OCTAVE_API FloatMatrix betainc (const FloatMatrix& x, const FloatMatrix& a, const FloatMatrix& b);
548
549 extern OCTAVE_API FloatNDArray betainc (const FloatNDArray& x, float a, float b);
550 extern OCTAVE_API FloatNDArray betainc (const FloatNDArray& x, float a, const FloatNDArray& b);
551 extern OCTAVE_API FloatNDArray betainc (const FloatNDArray& x, const FloatNDArray& a, float b);
552 extern OCTAVE_API FloatNDArray betainc (const FloatNDArray& x, const FloatNDArray& a, const FloatNDArray& b);
553
294 extern OCTAVE_API double gammainc (double x, double a, bool& err); 554 extern OCTAVE_API double gammainc (double x, double a, bool& err);
295 extern OCTAVE_API Matrix gammainc (double x, const Matrix& a); 555 extern OCTAVE_API Matrix gammainc (double x, const Matrix& a);
296 extern OCTAVE_API Matrix gammainc (const Matrix& x, double a); 556 extern OCTAVE_API Matrix gammainc (const Matrix& x, double a);
297 extern OCTAVE_API Matrix gammainc (const Matrix& x, const Matrix& a); 557 extern OCTAVE_API Matrix gammainc (const Matrix& x, const Matrix& a);
298 558
299 extern OCTAVE_API NDArray gammainc (double x, const NDArray& a); 559 extern OCTAVE_API NDArray gammainc (double x, const NDArray& a);
300 extern OCTAVE_API NDArray gammainc (const NDArray& x, double a); 560 extern OCTAVE_API NDArray gammainc (const NDArray& x, double a);
301 extern OCTAVE_API NDArray gammainc (const NDArray& x, const NDArray& a); 561 extern OCTAVE_API NDArray gammainc (const NDArray& x, const NDArray& a);
302 562
303 inline double gammainc (double x, double a) 563 inline double gammainc (double x, double a)
564 {
565 bool err;
566 return gammainc (x, a, err);
567 }
568
569 extern OCTAVE_API float gammainc (float x, float a, bool& err);
570 extern OCTAVE_API FloatMatrix gammainc (float x, const FloatMatrix& a);
571 extern OCTAVE_API FloatMatrix gammainc (const FloatMatrix& x, float a);
572 extern OCTAVE_API FloatMatrix gammainc (const FloatMatrix& x, const FloatMatrix& a);
573
574 extern OCTAVE_API FloatNDArray gammainc (float x, const FloatNDArray& a);
575 extern OCTAVE_API FloatNDArray gammainc (const FloatNDArray& x, float a);
576 extern OCTAVE_API FloatNDArray gammainc (const FloatNDArray& x, const FloatNDArray& a);
577
578 inline float gammainc (float x, float a)
304 { 579 {
305 bool err; 580 bool err;
306 return gammainc (x, a, err); 581 return gammainc (x, a, err);
307 } 582 }
308 583