Library of Assembled Shared Sources
lass::num Namespace Reference

Detailed Description

numeric types and traits.

Data Structures

class  DistributionExponential
 an exponential distribution mapper. More...
 
class  DistributionNormal
 a normal distribution mapper (aka guassian distribution) More...
 
class  DistributionUniform
 a uniform distribution mapper. More...
 
class  Filter
 Base class for all one dimensional causal filters. More...
 
class  FilteredFloat
 a float with error analysis on it's basic operations. More...
 
class  FirFilter
 Finite Impulse Response filter. More...
 
class  IirFilter
 Infinite Impulse Response filter. More...
 
class  interval
 Interval class. More...
 
class  Matrix
 a dynamic sized n-dimensional matrix with expression templates More...
 
class  Modulo
 a integer number class using modulo arithmetic More...
 
class  Polynomial
 an univariate polynomial. More...
 
class  RandomMT19937
 implemenents a mersenne twister MT19937. More...
 
class  RandomParkMiller
 Minimal Standard generator by Park and Miller. More...
 
class  RandomRadicalInverse
 Halton sequence. More...
 
class  RandomStandard
 Uses the C standard library function rand(). More...
 
class  RandomXKCD
 implemenents xkcd's fair dice roll random number generator More...
 
class  RandomXorShift128Plus
 xorshift128+ pseudorandom number generator More...
 
class  Spline
 abstract base class of splines. More...
 
class  SplineBezierPath
 connects the data nodes with cubic bezier splines. More...
 
class  SplineLinear
 connects the data nodes with linear segments. More...
 
class  TriBool
 a three-state boolean value with { true, false and lass::num::unknown } More...
 
class  Vector
 a dynamic sized n-dimensional vector with vector expression templates More...
 

Enumerations

enum  RangeType { rtClosed = 0x0 , rtRightOpen = 0x1 , rtLeftOpen = 0x2 , rtOpen = 0x3 }
 enumeration indicating how a real-number range must be closed. More...
 

Functions

template<typename T>
abs (const T &x)
 if x < 0 return -x, else return x.
 
template<typename T>
sign (const T &x)
 if x < 0 return -1, else if x > 0 return 1, else return 0.
 
template<typename T>
sqr (const T &x)
 return x * x
 
template<typename T>
inv (const T &x)
 return x ^ -1
 
template<typename T>
cubic (const T &x)
 return x * x * x
 
template<typename T>
pow (const T &x, const T &p)
 return exp(p * log(x));
 
template<typename T>
log2 (const T &x)
 return log(x) / log(2)
 
template<typename T>
log10 (const T &x)
 return log(x) / log(10)
 
template<typename T>
norm (const T &x)
 return norm of x as if x is real part of complex number: sqr(x)
 
template<typename T>
conj (const T &x)
 return conjugate as if x is a complex number: x
 
template<typename T>
const T & clamp (const T &x, const T &min, const T &max)
 if x < min return min, else if x > max return max, else return x.
 
template<typename T>
lerp (const T &a, const T &b, const T &f)
 linear interpolation between a and b
 
template<typename T>
pow2dB (const T &power)
 power to decibels: y = 10 * log10(x)
 
template<typename T>
amp2dB (const T &amplitude)
 amplitude to decibels: y = 20 * log10(x)
 
template<typename T>
dB2pow (const T &decibels)
 decibels to power: y = num::pow(10, x / 10)
 
template<typename T>
dB2amp (const T &decibels)
 decibels to amplitude: y = num::pow(10, x / 20)
 
template<typename T>
p2dB (const T &iValue)
 Converts an absolute acoustical pressure into decibels.
 
template<typename T>
W2dB (const T &iValue)
 Converts a absolute acoustical power into decibels.
 
template<typename T>
I2dB (const T &iValue)
 Converts an intensity into decibels.
 
template<typename T>
dB2p (const T &iValue)
 Converts decibels into a pressure .
 
template<typename T>
dB2W (const T &iValue)
 Converts decibels into a power.
 
template<typename T>
dB2I (const T &iValue)
 Converts decibels into an intensity.
 
template<class T, class RG>
uniform (RG &generator)
 
template<class T, class RG>
unitGauss (RG &generator)
 
template<class T, class RG>
gauss (RG &generator, typename util::CallTraits< T >::TParam mean, typename util::CallTraits< T >::TParam stddev)
 
template<typename T, typename S1, typename S2>
Vector< T, impl::MVRightProd< T, S1, S2 > > operator* (const Matrix< T, S1 > &iA, const Vector< T, S2 > &iB)
 multiply matrix with column vector
 
template<typename T, typename S>
Matrix< T, impl::MVDiag< T, S > > diagonal (const Vector< T, S > &iB)
 Create diagonal matrix from vector.
 
template<typename T, typename S>
void solve (const Matrix< T, S > &iA, Vector< T > &iB)
 Solves set of equation A * X == B.
 
template<class C>
bool isInf (const C &iV)
 return true if iV equals minus or plus Infinity
 
std::string str (float iV)
 
std::string str (double iV)
 
template<class C>
std::string str (const std::complex< C > &iV)
 
std::string str (int iV)
 
std::string str (long iV)
 
template<typename T, typename RandomGenerator>
distributeUniform (RandomGenerator &generator, T infimum, T supremum)
 draw a random number from generator and transform it by a uniform distribution
 
template<typename T, typename RandomGenerator>
distributeExponential (RandomGenerator &generator, T rateOfChange)
 draw a random number from generator and transform it by a exponential distribution
 
template<typename T, typename RandomGenerator>
distributeNormal (RandomGenerator &generator, T mean, T standardDeviation)
 draw a random number from generator and transform it by a normal distribution
 
template<typename T, typename S1, typename S2>
bool operator== (const Matrix< T, S1 > &a, const Matrix< T, S2 > &b)
 
template<typename T, typename S1, typename S2>
bool operator!= (const Matrix< T, S1 > &a, const Matrix< T, S2 > &b)
 
template<typename T, typename S1, typename S2>
const Matrix< T, impl::MAdd< T, S1, S2 > > operator+ (const Matrix< T, S1 > &a, const Matrix< T, S2 > &b)
 componentwise addition
 
template<typename T, typename S1, typename S2>
const Matrix< T, impl::MSub< T, S1, S2 > > operator- (const Matrix< T, S1 > &a, const Matrix< T, S2 > &b)
 componentwise addition
 
template<typename T, typename S1, typename S2>
const Matrix< T, impl::MProd< T, S1, S2 > > operator* (const Matrix< T, S1 > &a, const Matrix< T, S2 > &b)
 Matrix multiplication.
 
template<typename T, typename S>
const Matrix< T, impl::MAdd< T, impl::MScalar< T >, S > > operator+ (const T &a, const Matrix< T, S > &b)
 add a to all components of b
 
template<typename T, typename S>
const Matrix< T, impl::MSub< T, impl::MScalar< T >, S > > operator- (const T &a, const Matrix< T, S > &b)
 add a to all negated components of b
 
template<typename T, typename S>
const Matrix< T, impl::MMul< T, impl::MScalar< T >, S > > operator* (const T &a, const Matrix< T, S > &b)
 multiply a with all components of b
 
template<typename T, typename S>
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > operator+ (const Matrix< T, S > &a, typename Matrix< T, S >::TParam b)
 add b to all components of a
 
template<typename T, typename S>
const Matrix< T, impl::MAdd< T, S, impl::MScalar< T > > > operator- (const Matrix< T, S > &a, typename Matrix< T, S >::TParam b)
 subtract b from all components of a
 
template<typename T, typename S>
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > operator* (const Matrix< T, S > &a, typename Matrix< T, S >::TParam b)
 multiply all components of a with b.
 
template<typename T, typename S>
const Matrix< T, impl::MMul< T, S, impl::MScalar< T > > > operator/ (const Matrix< T, S > &a, typename Matrix< T, S >::TParam b)
 divide all components of a by b.
 
template<typename T, typename S, typename S2>
void solve (const Matrix< T, S > &a, Matrix< T, S2 > &bx, bool improve)
 solve equation A * X = B
 
template<typename T, typename S1, typename S2>
Vector< T, impl::MVRightProd< T, S1, S2 > > operator* (const Matrix< T, S1 > &iA, const Vector< T, S2 > &iB)
 multiply matrix with column vector
 
template<typename T, typename S>
Matrix< T, impl::MVDiag< T, S > > diagonal (const Vector< T, S > &iB)
 Create diagonal matrix from vector.
 
template<typename T, typename S>
void solve (const Matrix< T, S > &iA, Vector< T > &iB)
 Solves set of equation A * X == B.
 
const TriBool unknown (TriBool::sUnknown)
 constant to be used as new keyword like true and false
 
template<typename T, typename S1, typename S2>
const T dot (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 dot product.
 
template<typename T, typename S1, typename S2>
const Vector< T, impl::VAdd< T, S1, S2 > > operator+ (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise addition
 
template<typename T, typename S1, typename S2>
const Vector< T, impl::VSub< T, S1, S2 > > operator- (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise subtraction
 
template<typename T, typename S1, typename S2>
const Vector< T, impl::VMul< T, S1, S2 > > operator* (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise multiplication
 
template<typename T, typename S1, typename S2>
const Vector< T, impl::VDiv< T, S1, S2 > > operator/ (const Vector< T, S1 > &iA, const Vector< T, S2 > &iB)
 componentwise division
 
template<typename T, typename S>
const Vector< T, impl::VAdd< T, impl::VScalar< T >, S > > operator+ (const T &iA, const Vector< T, S > &iB)
 add iA to all components of iB
 
template<typename T, typename S>
const Vector< T, impl::VSub< T, impl::VScalar< T >, S > > operator- (const T &iA, const Vector< T, S > &iB)
 add iA to all negated components of iB
 
template<typename T, typename S>
const Vector< T, impl::VMul< T, impl::VScalar< T >, S > > operator* (const T &iA, const Vector< T, S > &iB)
 multiply iA with all components of iB
 
template<typename T, typename S>
const Vector< T, impl::VDiv< T, impl::VScalar< T >, S > > operator/ (const T &iA, const Vector< T, S > &iB)
 multiply iA with all reciprocal components of iB
 
template<typename T, typename S>
const Vector< T, impl::VAdd< T, S, impl::VScalar< T > > > operator+ (const Vector< T, S > &iA, const T &iB)
 add iB to all components of iA
 
template<typename T, typename S>
const Vector< T, impl::VSub< T, S, impl::VScalar< T > > > operator- (const Vector< T, S > &iA, const T &iB)
 subtract iB from all components of iA
 
template<typename T, typename S>
const Vector< T, impl::VMul< T, S, impl::VScalar< T > > > operator* (const Vector< T, S > &iA, const T &iB)
 multiply all components of iA with iB.
 
template<typename T, typename S>
const Vector< T, impl::VDiv< T, S, impl::VScalar< T > > > operator/ (const Vector< T, S > &iA, const T &iB)
 multiply all components of iA with iB.
 

Variables

template<typename S, typename D, typename T>
const SplineLinear< S, D, T >::TData SplineLinear< S, D, T >::derivative2 (TScalar) const
 Get the second derivative of data value that corresponds with constrol value iX.
 

Function Documentation

◆ diagonal() [1/2]

template<typename T, typename S>
Matrix< T, impl::MVDiag< T, S > > diagonal ( const Vector< T, S > & iB)
related

Create diagonal matrix from vector.

See also
lass::num::Matrix::isDiagonal

Definition at line 89 of file matrix_vector.inl.

◆ solve() [1/3]

template<typename T, typename S>
void solve ( const Matrix< T, S > & iA,
Vector< T > & iB )
related

Solves set of equation A * X == B.

See also
lass::num::Matrix::solve

Definition at line 103 of file matrix_vector.inl.

◆ str() [1/5]

std::string lass::num::str ( float iV)
inline
Deprecated
use util::stringCast

Definition at line 47 of file stringify.h.

◆ str() [2/5]

std::string lass::num::str ( double iV)
inline
Deprecated
use util::stringCast

Definition at line 55 of file stringify.h.

◆ str() [3/5]

template<class C>
std::string lass::num::str ( const std::complex< C > & iV)
inline
Deprecated
use util::stringCast

Definition at line 77 of file stringify.h.

◆ str() [4/5]

std::string lass::num::str ( int iV)
inline
Deprecated
use util::stringCast

Definition at line 62 of file stringify.h.

◆ str() [5/5]

std::string lass::num::str ( long iV)
inline
Deprecated
use util::stringCast

Definition at line 69 of file stringify.h.

Variable Documentation

◆ SplineLinear< S, D, T >::derivative2

template<typename S, typename D, typename T>
const SplineLinear< S, D, T >::TData lass::num::SplineLinear< S, D, T >::derivative2(TScalar) const ( TScalar ) const

Get the second derivative of data value that corresponds with constrol value iX.

For a linear spline, the second derivative is always zero, except on the nodes where it does not exist. This function however will always return zero, even on the nodes.

Precondition
this->isEmpty() == false
complexity:
O(D * log(N)) with
  • D = a figure that indicates the complexity of operations on data values. Is most probably linear with the dimension of the data value
  • N = number of nodes

Definition at line 203 of file spline_linear.inl.