Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Namespaces | Classes | Functions
Saf::Math Namespace Reference

Mathematical functions and structures. More...

Namespaces

namespace  Algebra
 Implementations of various objects from algebra.
namespace  Calculus
 Calculus related functions and classes.
namespace  Constant
 Mathematical constants.
namespace  Range
 Mathematical algorithms and functions that execute on a range of elements.

Classes

class  ConvergenceException
 Numerical algorithm convergence failure exception. More...

Functions

template<class T >
Abs (T x)
 Calculate absolute value of a number.
template<class T >
IntegerDivCeil (T dividend, T divisor)
 Integer division rounded up.
template<class T >
Restrict (T x, T low, T high)
 Restrict the value of a number.
template<class T >
Round (T v)
 Round number.
template<class T >
Int8 Sgn (T val)
 Sign function.

Detailed Description

Mathematical functions and structures.


Function Documentation

template<class T >
T Saf::Math::Abs ( x) [inline]

Calculate absolute value of a number.

template<class T >
T Saf::Math::IntegerDivCeil ( dividend,
divisor 
) [inline]

Integer division rounded up.

template<class T >
T Saf::Math::Restrict ( x,
low,
high 
) [inline]

Restrict the value of a number.

Parameters:
[in]xNumber.
[in]lowLeft interval boundary.
[in]highRight interval boundary.
Returns:
A number from the interval [low, high] closest to x.
template<class T >
T Saf::Math::Round ( v) [inline]

Round number.

Remarks:
This method does nothing for integer numbers.
template<class T >
Int8 Saf::Math::Sgn ( val) [inline]

Sign function.

Returns:
1 for positive numbers, -1 for negative and 0 for zero.