Classes | Functions | Variables
OwnMath.h File Reference

Mathematical functions. More...

#include "KernelMath.h"
#include <stdlib.h>
#include <math.h>
Include dependency graph for OwnMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tSinCosLookupTable

Functions

int * Add (int *a, int *b, int size)
double Ceil (double value, int precision=0)
double Deg2Rad (double a)
int * Div (int *a, int b, int size)
int * Div (int *a, int b, int *c, int size)
double FastCos (double x)
double FastSin (double x)
bool FloatIsEqual (const double a, const double b, const double epsilon=1e-10)
double Floor (double value, int precision=0)
int ipow (int base, int exponent)
 An integer pow-function.
int log2upw (int value)
 calculates log_2, rounded upward
int log8upw (int value)
 calculates log_8, rounded upward
double Mod (double a, double b)
double Mod (double a, int b)
int Mod (int a, int b)
long int Mod (long int a, long int b)
double NormalizeAngleInDegreeSigned (const double angle)
double NormalizeAngleSigned (const double angle)
double NormalizeAngleUnsigned (const double angle)
int Pow (int a, int b)
double Rad2Deg (double a)
double RandomNormal (double variance)
double RandomUniform ()
double RandomUniformAbs ()
double Round (double value, int precision=0)
int Sgn (double a)
int Sgn (long double a)
int Sgn (long a)
int Sgn0 (double a)
int Sgn0 (long double a)
int Sgn0 (long a)
void SinCos (const double x, double &sx, double &cx)
template<typename T >
T Sqr (T a)
double Sqrt (double a)
int * Sum (int *a, int *b, int *c, int size)

Variables

tSinCosLookupTable sin_cos_lookup_table

Detailed Description

Mathematical functions.

Author:
Bernd Gaßmann
Date:
14.04.00

Defines often used mathematical functions with are not part of the GNU math library. math.h/math166.h/rt_math.h is included.

If the macro MATH_USE_PRECISE_OPS is defined, the standard precise versions of sin() and cos() are called. Otherwise fast versions are used, which use table lookup in the range [-2pi,2pi].

Definition in file OwnMath.h.


Function Documentation

int* Add ( int *  a,
int *  b,
int  size 
) [inline]

Adds 2 integer arrays. The result is stored in a.

Definition at line 217 of file OwnMath.h.

double Ceil ( double  value,
int  precision = 0 
) [inline]

Performs a ceil for a double value with a specified precision.

Definition at line 203 of file OwnMath.h.

double Deg2Rad ( double  a) [inline]

Converts the angle a from degree to radiant and returns the result.

Definition at line 161 of file OwnMath.h.

int* Div ( int *  a,
int  b,
int  size 
) [inline]

Divides each element ao the array a with b. The resut is stored in a..

Definition at line 235 of file OwnMath.h.

int* Div ( int *  a,
int  b,
int *  c,
int  size 
) [inline]

Divides each element ao the array a with b. The resut is stored in c.

Definition at line 244 of file OwnMath.h.

double FastCos ( double  x) [inline]

Definition at line 413 of file OwnMath.h.

double FastSin ( double  x) [inline]

Definition at line 404 of file OwnMath.h.

bool FloatIsEqual ( const double  a,
const double  b,
const double  epsilon = 1e-10 
) [inline]

FloatIsEqual function compares float values by testing against epsilon neighbourhood

Parameters:
aa float or double value
ba float or double value
epsilonminimum difference, defines epsilon neighbourhood
Returns:
true if |a-b| < epsilon, else false

Definition at line 430 of file OwnMath.h.

double Floor ( double  value,
int  precision = 0 
) [inline]

Performs a floor for a double value with a specified precision.

Definition at line 210 of file OwnMath.h.

int ipow ( int  base,
int  exponent 
) [inline]

An integer pow-function.

Calculates $ b^e , b \ge 0, e \ge 0 $

Parameters:
basethe base (b)
exponentthe exponent (e)
Returns:
pow(base,exponent) or 0, if base or exponent are < 0

Definition at line 308 of file OwnMath.h.

int log2upw ( int  value) [inline]

calculates log_2, rounded upward

Parameters:
valuean integer value
Returns:
log_2(value), rounded upward

Definition at line 327 of file OwnMath.h.

int log8upw ( int  value) [inline]

calculates log_8, rounded upward

Parameters:
valuean integer value
Returns:
log_8(value), rounded upward

Definition at line 342 of file OwnMath.h.

double Mod ( double  a,
double  b 
) [inline]

Evaluates a fmod(b) and returns the result (0 <= result < b).

Definition at line 80 of file OwnMath.h.

double Mod ( double  a,
int  b 
) [inline]

Evaluates a fmod(b) and returns the result (0 <= result < b).

Definition at line 88 of file OwnMath.h.

int Mod ( int  a,
int  b 
) [inline]

Evaluates a mod(b) and returns the result (0 <= result < b).

Definition at line 95 of file OwnMath.h.

long int Mod ( long int  a,
long int  b 
) [inline]

Evaluates a mod(b) and returns the result (0 <= result < b).

Definition at line 103 of file OwnMath.h.

double NormalizeAngleInDegreeSigned ( const double  angle) [inline]

return the angle (in degree) normalized to [-180, 180)

Definition at line 182 of file OwnMath.h.

double NormalizeAngleSigned ( const double  angle) [inline]

return the angle (in rad) normalized to [-M_PI, M_PI)

Definition at line 174 of file OwnMath.h.

double NormalizeAngleUnsigned ( const double  angle) [inline]

return the angle (in rad) normalized to [0, 2*M_PI)

Definition at line 168 of file OwnMath.h.

int Pow ( int  a,
int  b 
) [inline]

returns a power b for int values

Definition at line 188 of file OwnMath.h.

double Rad2Deg ( double  a) [inline]

Converts the angle a from radiant to degree and returns the result.

Definition at line 153 of file OwnMath.h.

double RandomNormal ( double  variance) [inline]

returns a normal distributed random value with specified variance. Mean values is 0.

Definition at line 287 of file OwnMath.h.

double RandomUniform ( ) [inline]

returns uniformly distributed random value from intervall [-1,1]

Definition at line 278 of file OwnMath.h.

double RandomUniformAbs ( ) [inline]

returns uniformly distributed random value from intervall [0,1]

Definition at line 269 of file OwnMath.h.

double Round ( double  value,
int  precision = 0 
) [inline]

Rounds a double value with a specified precision.

Definition at line 196 of file OwnMath.h.

int Sgn ( double  a) [inline]

Returns the sign (1 or -1) of a. The sign of zero here is defined as 1!

Definition at line 111 of file OwnMath.h.

int Sgn ( long double  a) [inline]

Returns the sign (1 or -1) of a. The sign of zero here is defined as 1!

Definition at line 118 of file OwnMath.h.

int Sgn ( long  a) [inline]

Returns the sign (1 or -1) of a. The sign of zero here is defined as 1!

Definition at line 139 of file OwnMath.h.

int Sgn0 ( double  a) [inline]

Returns the sign (1, -1 or 0) of a. The sign of zero here is defined as 0!

Definition at line 125 of file OwnMath.h.

int Sgn0 ( long double  a) [inline]

Returns the sign (1, -1 or 0) of a. The sign of zero here is defined as 0!

Definition at line 132 of file OwnMath.h.

int Sgn0 ( long  a) [inline]

Returns the sign (1, -1 or 0) of a. The sign of zero here is defined as 0!

Definition at line 146 of file OwnMath.h.

void SinCos ( const double  x,
double &  sx,
double &  cx 
) [inline]

sincos function x angle in rad sx, cx the return values contain the sinus and the cosinus of x

Definition at line 358 of file OwnMath.h.

template<typename T >
T Sqr ( T  a) [inline]

returns the square of a value

Definition at line 254 of file OwnMath.h.

double Sqrt ( double  a) [inline]

return the square root of a value

Definition at line 260 of file OwnMath.h.

int* Sum ( int *  a,
int *  b,
int *  c,
int  size 
) [inline]

Adds 2 integer arrays. The result is stored in c.

Definition at line 226 of file OwnMath.h.


Variable Documentation

Definition at line 39 of file OwnMath.cpp.



asr_mild_base_driving
Author(s): Aumann Florian, Borella Jocelyn, Dehmani Souheil, Marek Felix, Meißner Pascal, Reckling Reno
autogenerated on Thu Jun 6 2019 22:02:58