My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
real.cpp File Reference
#include <math.h>
#include <assert.h>
#include "consts.h"
#include "real.h"
Include dependency graph for real.cpp:

Go to the source code of this file.

Functions

nr_double_t round (const nr_double_t arg)
 
nr_double_t trunc (const double arg)
 
nr_double_t acosh (const double arg)
 
nr_double_t asinh (const double arg)
 
unsigned int factorial (unsigned int n)
 Compute factorial n ie $n!$.
 
nr_double_t real (const nr_double_t r)
 Real part of real number.
 
nr_double_t imag (const nr_double_t r)
 Imaginary part of complex number.
 
nr_double_t norm (const nr_double_t r)
 Compute euclidian norm of real number.
 
nr_double_t abs (const nr_double_t r)
 Compute complex modulus of real number.
 
nr_double_t conj (const nr_double_t r)
 Conjugate of real number.
 
nr_double_t limexp (const nr_double_t r)
 Compute limited exponential.
 
nr_double_t signum (const nr_double_t d)
 real signum function
 
nr_double_t sign (const nr_double_t d)
 real sign function
 
nr_double_t xhypot (const nr_double_t a, const nr_double_t b)
 Euclidean distance function.
 
nr_double_t sinc (const nr_double_t d)
 Real cardinal sinus.
 
nr_double_t fix (const nr_double_t d)
 Fix function.
 
nr_double_t step (const nr_double_t d)
 Heaviside step function.
 

Function Documentation

nr_double_t abs ( const nr_double_t  r)

Compute complex modulus of real number.

Parameters
[in]rReal number
Returns
Modulus of r
Todo:
Why not inline

Definition at line 115 of file real.cpp.

nr_double_t acosh ( const double  arg)

Definition at line 48 of file real.cpp.

Here is the call graph for this function:

nr_double_t asinh ( const double  arg)

Definition at line 54 of file real.cpp.

Here is the call graph for this function:

nr_double_t conj ( const nr_double_t  r)

Conjugate of real number.

Parameters
[in]rReal number
Returns
Conjugate of real r ie r
Todo:
Why not inline?

Definition at line 125 of file real.cpp.

unsigned int factorial ( unsigned int  n)

Compute factorial n ie $n!$.

Definition at line 63 of file real.cpp.

nr_double_t fix ( const nr_double_t  d)

Fix function.

Fix is nearest integral value in direction of 0,

\[ \operatorname{fix} d=\begin{cases} \operatorname{floor} d & \text{if } d > 0 \\ \operatorname{ceil} d & \text{else} \end{cases} \]

Parameters
[in]dreal number
Returns
fixed complex number
Todo:
Why not inline?

Definition at line 238 of file real.cpp.

Here is the call graph for this function:

nr_double_t imag ( const nr_double_t  r)

Imaginary part of complex number.

Parameters
[in]rReal number
Returns
Imaginary part of r
Todo:
Why not inline?

Definition at line 94 of file real.cpp.

nr_double_t limexp ( const nr_double_t  r)

Compute limited exponential.

Compute limited exponential:

\[ \begin{cases} \exp r & \text{if } r < \text{M\_LIMEXP} \\ \exp (\text{M\_LIMEXP})\left[1.0 + (r - \text{M\_LIMEXP})\right] & \text{else} \end{cases} \]

M_LIMEXP is a constant

Parameters
[in]rreal number
Returns
limited exponential of r
Todo:

Change limexp(real) limexp(complex) file order

Document M_LIMEXP

Definition at line 146 of file real.cpp.

Here is the call graph for this function:

nr_double_t norm ( const nr_double_t  r)

Compute euclidian norm of real number.

Compute $r^2$

Parameters
[in]rReal number
Returns
Euclidian norm of r
Todo:
Why not inline

Definition at line 105 of file real.cpp.

nr_double_t real ( const nr_double_t  r)

Real part of real number.

Parameters
[in]rReal number
Returns
Real part of r ie r
Todo:
Why not inline?

Definition at line 84 of file real.cpp.

nr_double_t round ( const nr_double_t  arg)

Definition at line 36 of file real.cpp.

Here is the call graph for this function:

nr_double_t sign ( const nr_double_t  d)

real sign function

compute

\[ \mathrm{sign}\;d= = \begin{cases} 1 & \text{if } d\ge 0 \\ -1 & \text{if } d<0 \end{cases} \]

Parameters
[in]dreal number
Returns
sign of d
Todo:
Move near complex sign

Definition at line 182 of file real.cpp.

nr_double_t signum ( const nr_double_t  d)

real signum function

compute

\[ \mathrm{signum}\;d= = \begin{cases} O & \text{if } d=0 \\ 1 & \text{if } d>0 \\ -1 & \text{if } d<0 \end{cases} \]

Parameters
[in]dreal number
Returns
signum of d
Todo:
Move near complex signum

Definition at line 164 of file real.cpp.

nr_double_t sinc ( const nr_double_t  d)

Real cardinal sinus.

Compute $\mathrm{sinc}\;d=\frac{\sin d}{d}$

Parameters
[in]dreal number
Returns
cardianal sinus of s
Todo:
Why not inline

Definition at line 219 of file real.cpp.

Here is the call graph for this function:

nr_double_t step ( const nr_double_t  d)

Heaviside step function.

The Heaviside step function, H, also called unit step function, is a discontinuous function whose value is zero for negative argument and one for positive argument. For zero by convention, H(0)=0.5

Parameters
[in]dHeaviside argument
Returns
Heaviside step
Todo:
Create Heaviside alias

Definition at line 251 of file real.cpp.

nr_double_t trunc ( const double  arg)

Definition at line 42 of file real.cpp.

Here is the call graph for this function:

nr_double_t xhypot ( const nr_double_t  a,
const nr_double_t  b 
)

Euclidean distance function.

The xhypot() function returns $\sqrt{a^2+b^2}$. This is the length of the hypotenuse of a right-angle triangle with sides of length a and b, or the distance of the point (a,b) from the origin.

Parameters
[in]afirst length
[in]bsecond length
Returns
Euclidean distance from (0,0) to (a,b): $\sqrt{a^2+b^2}$

Definition at line 197 of file real.cpp.

Here is the call graph for this function: