Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
real.h
Go to the documentation of this file.
1 /*
2  * real.h - some real valued function definitions
3  *
4  * Copyright (C) 2008 Stefan Jahn <stefan@lkcc.org>
5  * Copyright (C) 2014 Guilheme Brondani Torri <guitorri@gmail.com>
6  *
7  * This is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this package; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * $Id$
23  *
24  */
25 
26 #ifndef __REAL_H__
27 #define __REAL_H__
28 
29 #include <cmath>
30 
37 namespace qucs {
38 
39 //
40 // trigonometric
41 //
42 nr_double_t cos (const nr_double_t);
43 nr_double_t sin (const nr_double_t);
44 nr_double_t tan (const nr_double_t);
45 nr_double_t acos (const nr_double_t);
46 nr_double_t asin (const nr_double_t);
47 nr_double_t atan (const nr_double_t);
48 nr_double_t atan2 (const nr_double_t, const nr_double_t); //not used?, only for complex
49 
50 
51 //
52 // hyperbolic
53 //
54 nr_double_t cosh (const nr_double_t);
55 nr_double_t sinh (const nr_double_t);
56 nr_double_t tanh (const nr_double_t);
57 nr_double_t acosh (const nr_double_t); // c++11
58 nr_double_t asinh (const nr_double_t); // c++11
59 nr_double_t atanh (const nr_double_t); // c++11, not used?, only for complex
60 
61 
62 //
63 // exponential and logarithmic functions
64 //
65 nr_double_t exp (const nr_double_t);
66 nr_double_t log (const nr_double_t);
67 nr_double_t log10 (const nr_double_t);
68 
69 
70 //
71 // power functions
72 //
73 nr_double_t pow (const nr_double_t, const nr_double_t );
74 nr_double_t sqrt (const nr_double_t );
75 nr_double_t xhypot (const nr_double_t, const nr_double_t ); // same hypot in c++11?
76 
77 
78 //
79 // error functions
80 //
81 nr_double_t erf(const nr_double_t );
82 
83 
84 //
85 // rounding and remainder functions
86 //
87 nr_double_t ceil(const nr_double_t );
88 nr_double_t floor(const nr_double_t );
89 nr_double_t fmod(const nr_double_t ); //FIXME
90 nr_double_t trunc(const nr_double_t ); // c++11
91 nr_double_t round(const nr_double_t ); // c++11
92 
93 //
94 // Qucs extra trigonometric helper
95 //
96 nr_double_t coth (const nr_double_t );
97 nr_double_t sech (const nr_double_t );
98 nr_double_t cosech (const nr_double_t );
99 
100 
101 //
102 // Qucs extra math functions
103 //
104 nr_double_t sqr (const nr_double_t );
105 
106 unsigned int sqr (unsigned int);
107 
108 
109 nr_double_t quadr (const nr_double_t );
110 
111 
112 //
113 // extra math functions
114 //
115 nr_double_t limexp (const nr_double_t);
116 nr_double_t signum (const nr_double_t);
117 nr_double_t sign (const nr_double_t);
118 nr_double_t sinc (const nr_double_t);
119 nr_double_t fix (const nr_double_t);
120 nr_double_t step (const nr_double_t);
121 unsigned int factorial (unsigned int);
122 
123 
124 //
125 // overload complex manipulations on reals
126 //
127 nr_double_t real (const nr_double_t);
128 nr_double_t imag (const nr_double_t);
129 nr_double_t norm (const nr_double_t);
130 nr_double_t conj (const nr_double_t);
131 nr_double_t abs (const nr_double_t);
132 
133 } // namespace qucs
134 
135 #endif /* __REAL_H__ */
matrix real(matrix a)
Real part matrix.
Definition: matrix.cpp:568
matrix abs(matrix a)
Computes magnitude of each matrix element.
Definition: matrix.cpp:531
nr_complex_t erf(const nr_complex_t z)
Error function.
Definition: complex.cpp:766
nr_complex_t ceil(const nr_complex_t z)
Complex ceil Ceil is the smallest integral value not less than argument Apply ceil to real and imagin...
Definition: complex.cpp:634
nr_complex_t coth(const nr_complex_t z)
Compute complex hyperbolic cotangent.
Definition: complex.cpp:320
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
Definition: complex.cpp:238
nr_complex_t cos(const nr_complex_t z)
Compute complex cosine.
Definition: complex.cpp:57
nr_complex_t step(const nr_complex_t z)
Heaviside step function for complex number.
Definition: complex.cpp:691
nr_complex_t signum(const nr_complex_t z)
complex signum function
Definition: complex.cpp:416
nr_complex_t atan(const nr_complex_t z)
Compute complex arc tangent.
Definition: complex.cpp:117
nr_complex_t acosh(const nr_complex_t z)
Compute complex arc hyperbolic cosine.
Definition: complex.cpp:162
nr_complex_t sign(const nr_complex_t z)
complex sign function
Definition: complex.cpp:435
nr_complex_t asinh(const nr_complex_t z)
Compute complex arc hyperbolic sine.
Definition: complex.cpp:175
nr_complex_t cosh(const nr_complex_t z)
Compute complex hyperbolic cosine.
Definition: complex.cpp:135
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
Definition: complex.cpp:673
matrix imag(matrix a)
Imaginary part matrix.
Definition: matrix.cpp:581
nr_complex_t fix(const nr_complex_t z)
Complex fix.
Definition: complex.cpp:645
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
Definition: complex.cpp:271
nr_double_t xhypot(const nr_complex_t a, const nr_complex_t b)
Euclidean distance function for complex argument.
Definition: complex.cpp:465
nr_complex_t trunc(const nr_complex_t z)
Complex trunc Apply round to integer, towards zero to real and imaginary part.
Definition: complex.cpp:512
nr_complex_t acos(const nr_complex_t z)
Compute complex arc cosine.
Definition: complex.cpp:84
nr_complex_t fmod(const nr_complex_t x, const nr_complex_t y)
Complex fmod Apply fmod to the complex z.
Definition: complex.cpp:662
nr_complex_t cosech(const nr_complex_t z)
Compute complex argument hyperbolic cosec.
Definition: complex.cpp:364
nr_complex_t tanh(const nr_complex_t z)
Compute complex hyperbolic tangent.
Definition: complex.cpp:153
nr_complex_t sin(const nr_complex_t z)
Compute complex sine.
Definition: complex.cpp:66
nr_complex_t asin(const nr_complex_t z)
Compute complex arc sine.
Definition: complex.cpp:102
nr_double_t quadr(const nr_double_t r)
Quartic function.
Definition: real.cpp:324
nr_complex_t log10(const nr_complex_t z)
Compute principal value of decimal logarithm of z.
Definition: complex.cpp:225
nr_complex_t floor(const nr_complex_t z)
Complex floor.
Definition: complex.cpp:623
nr_complex_t sech(const nr_complex_t z)
Compute complex hyperbolic secant.
Definition: complex.cpp:343
nr_complex_t atan2(const nr_complex_t y, const nr_complex_t x)
Compute complex arc tangent fortran like function.
Definition: complex.cpp:377
nr_complex_t sinc(const nr_complex_t z)
Cardinal sine.
Definition: complex.cpp:448
nr_complex_t limexp(const nr_complex_t z)
Compute limited complex exponential.
Definition: complex.cpp:539
nr_double_t norm(const nr_complex_t z)
Compute euclidian norm of complex number.
Definition: complex.cpp:283
nr_complex_t sinh(const nr_complex_t z)
Compute complex hyperbolic sine.
Definition: complex.cpp:144
nr_complex_t tan(const nr_complex_t z)
Compute complex tangent.
Definition: complex.cpp:75
nr_complex_t exp(const nr_complex_t z)
Compute complex exponential.
Definition: complex.cpp:205
matrix conj(matrix a)
Conjugate complex matrix.
Definition: matrix.cpp:505
unsigned int factorial(unsigned int n)
Compute factorial n ie $n!$.
Definition: real.cpp:444
nr_complex_t log(const nr_complex_t z)
Compute principal value of natural logarithm of z.
Definition: complex.cpp:215
nr_complex_t round(const nr_complex_t z)
Complex round Round is the nearest integral value Apply round to real and imaginary part...
Definition: complex.cpp:496
nr_complex_t atanh(const nr_complex_t z)
Compute complex arc hyperbolic tangent.
Definition: complex.cpp:188