1
|
1 // mappers.h -*- C++ -*- |
|
2 /* |
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
1
|
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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_mappers_h) |
|
25 #define octave_mappers_h 1 |
1
|
26 |
164
|
27 class Complex; |
1
|
28 |
529
|
29 typedef double (*d_d_Mapper)(double); |
|
30 typedef double (*d_c_Mapper)(const Complex&); |
|
31 typedef Complex (*c_c_Mapper)(const Complex&); |
|
32 |
|
33 // If can_return_complex_for_real_arg is 1, lower_limit and |
|
34 // upper_limit specify the range of values for which a real arg |
|
35 // returns a real value. Outside that range, we have to convert args |
|
36 // to complex, and call the complex valued function. |
|
37 // |
|
38 // If can_return_complex_for_real_arg is 0, lower_limit and |
|
39 // upper_limit are ignored. |
|
40 |
|
41 struct Mapper_fcn |
|
42 { |
628
|
43 char *name; |
529
|
44 int can_return_complex_for_real_arg; |
|
45 double lower_limit; |
|
46 double upper_limit; |
|
47 d_d_Mapper d_d_mapper; |
|
48 d_c_Mapper d_c_mapper; |
|
49 c_c_Mapper c_c_mapper; |
|
50 }; |
|
51 |
|
52 struct builtin_mapper_function |
|
53 { |
|
54 char *name; |
|
55 int can_return_complex_for_real_arg; |
|
56 double lower_limit; |
|
57 double upper_limit; |
|
58 d_d_Mapper d_d_mapper; |
|
59 d_c_Mapper d_c_mapper; |
|
60 c_c_Mapper c_c_mapper; |
|
61 char *help_string; |
|
62 }; |
1
|
63 |
|
64 extern double arg (double x); |
|
65 extern double conj (double x); |
|
66 extern double fix (double x); |
|
67 extern double imag (double x); |
|
68 extern double real (double x); |
|
69 extern double round (double x); |
|
70 extern double signum (double x); |
529
|
71 extern double xisnan (double x); |
1
|
72 extern double xfinite (double x); |
|
73 extern double xisinf (double x); |
|
74 |
529
|
75 extern double xisnan (const Complex& x); |
1
|
76 extern double xfinite (const Complex& x); |
|
77 extern double xisinf (const Complex& x); |
|
78 |
|
79 extern Complex acos (const Complex& x); |
|
80 extern Complex acosh (const Complex& x); |
|
81 extern Complex asin (const Complex& x); |
|
82 extern Complex asinh (const Complex& x); |
|
83 extern Complex atan (const Complex& x); |
|
84 extern Complex atanh (const Complex& x); |
|
85 extern Complex ceil (const Complex& x); |
|
86 extern Complex fix (const Complex& x); |
|
87 extern Complex floor (const Complex& x); |
|
88 extern Complex log10 (const Complex& x); |
|
89 extern Complex round (const Complex& x); |
|
90 extern Complex signum (const Complex& x); |
|
91 extern Complex tan (const Complex& x); |
|
92 extern Complex tanh (const Complex& x); |
|
93 |
529
|
94 extern void install_mapper_functions (void); |
|
95 |
1
|
96 #endif |
|
97 |
|
98 /* |
|
99 ;;; Local Variables: *** |
|
100 ;;; mode: C++ *** |
|
101 ;;; page-delimiter: "^/\\*" *** |
|
102 ;;; End: *** |
|
103 */ |