Namespaces | |
internal | |
Classes | |
class | BoolRandom |
class | DistributedSample |
Class describing a distributed statistical sample. More... | |
union | DoubleAndLongLong |
union | FloatAndLong |
class | FunctionParser |
Function parser, for parsing and evaluating functions. More... | |
class | FunctionParserOMP |
class | GenericAABB |
GenericAABB represents an axis-aligned bounding box. More... | |
class | IntRandom |
class | KahanAccumulator |
struct | leastUnsignedInteger |
Provides the smallest unsigned integer type that has at least minSize bits. More... | |
struct | Limits |
Numerical limits of built-in data types. More... | |
class | MathTrait |
Base template for the MathTrait class. More... | |
struct | MathTrait< T, T > |
class | Matrix2 |
Efficient, generic implementation of a 2x2 matrix. More... | |
class | Matrix3 |
Efficient, generic implementation of a 3x3 matrix. More... | |
class | MatrixMxN |
Efficient implementation of a \( M \times N \) matrix. More... | |
class | Plane |
class | Quaternion |
Efficient implementation of a quaternion. More... | |
class | RealRandom |
class | Rot3 |
Rotation class which merges quaternion and matrix representation. More... | |
class | Sample |
Class describing a statistical sample. More... | |
struct | SqrtTrait |
Base template for the SqrtTrait class. More... | |
struct | uintFromBitWidth |
struct | uintFromBitWidth< 16 > |
struct | uintFromBitWidth< 32 > |
struct | uintFromBitWidth< 64 > |
struct | uintFromBitWidth< 8 > |
class | Vector2 |
Efficient, generic implementation of a 2-dimensional vector. More... | |
struct | Vector2LexicographicalyLess |
Functor providing a lexicographical ordering for Vector2. More... | |
class | Vector3 |
Efficient, generic implementation of a 3-dimensional vector. More... | |
struct | Vector3LexicographicalyLess |
Functor providing a lexicographical ordering for Vector3. More... | |
Typedefs | |
using | AABB = GenericAABB< real_t > |
Functions | |
constexpr real_t | degToRad (real_t deg) |
Converts a degrees angle to radians. More... | |
constexpr real_t | radToDeg (real_t rad) |
Converts a radians angle to degrees. More... | |
template<unsigned int numIter> | |
double | fastInvSqrt (double y) |
Computes 1.0 / sqrt(x) with limited accuracy. More... | |
template<unsigned int numIter> | |
float | fastInvSqrt (float y) |
Float version, for documentation see above. More... | |
template<typename T > | |
bool | isnan (T x) |
Query if 'x' is NaN. More... | |
template<typename T > | |
bool | isinf (T x) |
Query if 'x' is infinite. More... | |
template<typename T > | |
bool | finite (T x) |
Query if 'x' is finite. More... | |
template<typename T , typename U > | |
bool | operator== (const GenericAABB< T > &lhs, const GenericAABB< U > &rhs) |
Compares two GenericeAABBs for equality. More... | |
template<typename T , typename U > | |
bool | operator!= (const GenericAABB< T > &lhs, const GenericAABB< U > &rhs) |
Compares two GenericeAABBs for inequality. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const GenericAABB< T > &aabb) |
Writes a GenericAABB to a std::ostream. More... | |
template<typename T > | |
std::istream & | operator>> (std::istream &is, GenericAABB< T > &aabb) |
Reads an GenericAABB from a std::istream. More... | |
template<typename T , typename G , typename VT > | |
mpi::GenericSendBuffer< T, G > & | operator<< (mpi::GenericSendBuffer< T, G > &buf, const GenericAABB< VT > &aabb) |
Serializes an GenericAABB into a mpi::GenericSendBuffer. More... | |
std::vector< uint_t > | getFactors (const uint_t number, const uint_t numberOfFactors) |
Computes and returns an integer factorization of any arbitrary integer. More... | |
std::vector< uint_t > | getFactors (const uint_t number, const uint_t numberOfFactors, const std::vector< real_t > &weight) |
Vector3< uint_t > | getFactors3D (const uint_t number) |
Vector3< uint_t > | getFactors3D (const uint_t number, const Vector3< real_t > &weights) |
template<typename Iterator > | |
std::iterator_traits< Iterator >::value_type | kahanSummation (const Iterator &begin, const Iterator &end) |
template<typename Type > | |
const Matrix3< Type > | operator- (const Matrix3< Type > &rhs) |
Negation operator for the negation of one matrix. More... | |
std::ostream & | operator<< (std::ostream &os, const Plane &plane) |
std::istream & | operator>> (std::istream &is, Plane &plane) |
bool | isPrime (const uint_t n) |
Query if n is prime. More... | |
std::vector< uint_t > | getPrimes (const uint_t n) |
Determine prime numbers up to an upper bound. More... | |
std::vector< uint_t > | getPrimeFactors (const uint_t n) |
Gets all prime factors of a number. More... | |
std::set< uint_t > | getDevisors (const uint_t n) |
Gets all devisors of a number n. More... | |
void | seedRandomGenerator (const std::mt19937::result_type &seed) |
template<typename INT > | |
INT | intRandom (const INT min, const INT max, std::mt19937 &generator) |
Returns a random integral number of type INT in the range [min,max] (max included!) More... | |
template<> | |
char | intRandom< char > (const char min, const char max, std::mt19937 &generator) |
template<> | |
unsigned char | intRandom< unsigned char > (const unsigned char min, const unsigned char max, std::mt19937 &generator) |
template<> | |
signed char | intRandom< signed char > (const signed char min, const signed char max, std::mt19937 &generator) |
template<typename INT > | |
INT | intRandom (const INT min) |
template<typename INT > | |
INT | intRandom (const INT min, const INT max) |
template<typename INT > | |
INT | intRandom () |
template<typename REAL_TYPE = real_t> | |
REAL_TYPE | realRandom (const REAL_TYPE min=REAL_TYPE(0), const REAL_TYPE max=REAL_TYPE(1), std::mt19937 &generator=internal::getGenerator()) |
Returns a random floating point number of type REAL in the range [min,max) (max excluded!) More... | |
bool | boolRandom () |
template<typename Type > | |
std::ostream & | operator<< (std::ostream &os, const Rot3< Type > &r) |
template<typename Type > | |
void | rotateAroundPoint (Vector3< Type > &pos, Rot3< Type > &rot, const Vector3< Type > &rotateAround, const Rot3< Type > &dRot) |
std::ostream & | operator<< (std::ostream &os, const Sample &statReal) |
Stream output operator for class Sample. More... | |
template<typename T , typename G > | |
mpi::GenericSendBuffer< T, G > & | operator<< (mpi::GenericSendBuffer< T, G > &buf, const Sample &statReal) |
template<typename T > | |
mpi::GenericRecvBuffer< T > & | operator>> (mpi::GenericRecvBuffer< T > &buf, Sample &statReal) |
template<typename Type > | |
void | clear (Type &clearable) |
Clearing the given value/object to the default state. More... | |
float | inv (float a) |
Inverting the given single precision value. More... | |
double | inv (double a) |
Inverting the given double precision value. More... | |
long double | inv (long double a) |
Inverting the given long double value. More... | |
template<typename Type > | |
bool | isDefault (const Type &v) |
Returns whether the given value/object is in default state. More... | |
template<typename Type > | |
void | reset (Type &resettable) |
Resetting the given value/object to the default value. More... | |
template<typename T > | |
const T | sq (const T &a) |
Squaring the given value/object. More... | |
template<> | |
uint_t | uintMSBPosition< uint64_t > (uint64_t value) |
template<typename UINT > | |
bool | uintIsEven (const UINT value) |
Returns true only if 'value' is an even number. More... | |
template<typename UINT > | |
bool | uintIsPowerOfTwo (const UINT value) |
Returns true only if 'value' (must be an unsigned integer) is a power of 2 (http://graphics.stanford.edu/~seander/bithacks.html) More... | |
template<typename UINT > | |
UINT | uintPow2 (const UINT exp) |
Returns the result of 2^exp. More... | |
template<typename UINT > | |
UINT | uintPow4 (UINT exp) |
Returns the result of 4^exp. More... | |
template<typename UINT > | |
UINT | uintPow8 (UINT exp) |
Returns the result of 8^exp. More... | |
template<typename UINT > | |
UINT | uintPow16 (UINT exp) |
Returns the result of 16^exp. More... | |
template<typename UINT > | |
uint_t | uintMSBPosition (UINT value) |
Calculation of the position of the most significant bit of a variable of type UINT. More... | |
template<> | |
uint_t | uintMSBPosition< uint32_t > (uint32_t value) |
template<> | |
uint_t | uintMSBPosition< uint16_t > (uint16_t value) |
template<> | |
uint_t | uintMSBPosition< uint8_t > (uint8_t value) |
constexpr uint_t | leastUnsignedIntegerBitWidth (uint_t width) |
template<typename Type > | |
Vector3< Type > | cross (const Vector3< Type > &lhs, const Vector3< Type > &rhs) |
Cross product (outer product) of two vectors ( \( \vec{a}=\vec{b}\times\vec{c} \)). More... | |
template<typename Type , typename Other > | |
Vector3< typename MathTrait< Type, Other >::High > | operator/ (Other lhs, const Vector3< Type > &rhs) |
Variables | |
constexpr real_t | e = real_t(2.7182818284590452354) |
constexpr real_t | log2_e = real_t(1.4426950408889634074) |
constexpr real_t | log10_e = real_t(0.43429448190325182765) |
constexpr real_t | ln_two = real_t(0.69314718055994530942) |
constexpr real_t | ln_ten = real_t(2.30258509299404568402) |
constexpr real_t | pi = real_t(3.14159265358979323846) |
constexpr real_t | half_pi = real_t(1.57079632679489661923) |
constexpr real_t | fourth_pi = real_t(0.78539816339744830962) |
constexpr real_t | one_div_pi = real_t(0.31830988618379067154) |
constexpr real_t | two_div_pi = real_t(0.63661977236758134308) |
constexpr real_t | two_div_root_pi = real_t(1.12837916709551257390) |
constexpr real_t | root_two = real_t(1.41421356237309504880) |
constexpr real_t | one_div_root_two = real_t(0.70710678118654752440) |
constexpr real_t | root_three = real_t(1.73205080757) |
constexpr real_t | one_div_root_three = real_t(0.57735026919) |
static const uint8_t | msbLookupTable [256] |
using walberla::math::AABB = typedef GenericAABB<real_t> |
|
inline |
Returns a matrix containing the absolute values of each single element of m.
m | The integral input matrix. |
The abs function calculates the absolute value of each element of the input matrix m. This function can only be applied to matrices of integral data type. For floating point matrices, the pe::fabs( const Matrix2& ) function can be used.
|
inline |
Returns a matrix containing the absolute values of each single element of m.
m | The integral input matrix. |
The abs function calculates the absolute value of each element of the input matrix m. This function can only be applied to matrices of integral data type. For floating point matrices, the pe::fabs( const Matrix3& ) function can be used.
|
inline |
Returns a vector containing the absolute values of each single element of v.
v | The integral input vector. |
The abs function calculates the absolute value of each element of the input vector v. This function can only be applied to vectors of integral data type. For floating point vectors, the pe::fabs( const Vector2& ) function can be used.
|
inline |
Returns a vector containing the absolute values of each single element of v.
v | The integral input vector. |
The abs function calculates the absolute value of each element of the input vector v. This function can only be applied to vectors of integral data type. For floating point vectors, the pe::fabs( const Vector3& ) function can be used.
|
inline |
Absolute value function.
a | The value. |
|
inline |
Absolute value function.
a | The value. |
|
inline |
Absolute value function.
a | The value. |
|
inline |
< Randomly returns 'true' or 'false'
|
inline |
Clearing the given dense matrix.
m | The dense matrix to be cleared. |
|
inline |
Clearing the given quaternion.
q | The quaternion to be cleared. |
Clearing a quaternion is equivalent to resetting it via the reset() function.
|
inline |
Clearing the given value/object to the default state.
clearable | The value/object to be cleared. |
The clear shim represents an abstract interface for clearing a value/object of any given data type to its default state. Values of built-in data type are reset to zero.
|
inline |
Cross product (outer product) of two vectors ( \( \vec{a}=\vec{b}\times\vec{c} \)).
lhs | The left-hand-side vector for the cross product. |
rhs | The right-hand-side vector for the cross product. |
Converts a degrees angle to radians.
real_t walberla::math::dot | ( | const Vector3< T > & | v1, |
const Vector3< T > & | v2 | ||
) |
Dot product of two vectors.
|
inline |
Dyadic product of two vectors ( \( M = u \otimes v \)).
vec1 | The first vector argument. |
vec2 | The second vector argument. |
|
inline |
Generic equality check.
a | First value. |
b | Second value. |
Generic equal function for the comparison of two numeric values. Depending on the types of the two arguments, a special comparison for floating point values is selected that takes the limited machine accuracy into account.
|
inline |
Returns a matrix containing the absolute values of each single element of m.
m | The floating point input matrix. |
The fabs function calculates the absolute value of each element of the input matrix m. This function can only be applied to floating point matrices. For matrices of integral data type, the pe::abs( const Matrix2& ) function can be used.
|
inline |
Returns a matrix containing the absolute values of each single element of m.
m | The floating point input matrix. |
The fabs function calculates the absolute value of each element of the input matrix m. This function can only be applied to floating point matrices. For matrices of integral data type, the pe::abs( const Matrix3& ) function can be used.
|
inline |
Returns a vector containing the absolute values of each single element of v.
v | The floating point input vector. |
The fabs function calculates the absolute value of each element of the input vector v. This function can only be applied to floating point vectors. For vectors of integral data type, the pe::abs( const Vector2& ) function can be used.
|
inline |
Returns a vector containing the absolute values of each single element of v.
v | The floating point input vector. |
The fabs function calculates the absolute value of each element of the input vector v. This function can only be applied to floating point vectors. For vectors of integral data type, the pe::abs( const Vector3& ) function can be used.
|
inline |
Computes 1.0 / sqrt(x) with limited accuracy.
The bigger y is ( relative to 1 ) the better the approximation
numIter | number of iterations higher numbers make the function slower but result more accurate |
|
inline |
Float version, for documentation see above.
|
inline |
Checks if the given vector has only finite elements.
v | The vector to be checked for only having finite elements. |
bool walberla::math::finite | ( | T | x | ) |
Query if 'x' is finite.
x | Value to be checked. |
Gets all devisors of a number n.
Computes all unique products of n's prime factors.
n | The number the devisors are computed for. |
std::vector< uint_t > walberla::math::getFactors | ( | const uint_t | number, |
const uint_t | numberOfFactors | ||
) |
Computes and returns an integer factorization of any arbitrary integer.
Goal: returned factors should roughly be of equal size Typical use case: uniform process distribution
number | integer to factorize |
numberOfFactors | number of factors to create (= size of returned vector) |
std::vector< uint_t > walberla::math::getFactors | ( | const uint_t | number, |
const uint_t | numberOfFactors, | ||
const std::vector< real_t > & | weight | ||
) |
Vector3< uint_t > walberla::math::getFactors3D | ( | const uint_t | number, |
const Vector3< real_t > & | weights | ||
) |
Gets all prime factors of a number.
Uses trial division algorithm. See http://en.wikipedia.org/w/index.php?title=Trial_division&oldid=518625973.
n | The number to be factorized. |
Determine prime numbers up to an upper bound.
Uses the 'Sieve of Eratosthenes' algorithm. See http://en.wikipedia.org/w/index.php?title=Sieve_of_Eratosthenes&oldid=527676398.
n | The maximum prime number. |
std::size_t walberla::math::hash_value | ( | const Vector2< T > & | v | ) |
std::size_t walberla::math::hash_value | ( | const Vector3< T > & | v | ) |
INT walberla::math::intRandom | ( | ) |
INT walberla::math::intRandom | ( | const INT | min | ) |
INT walberla::math::intRandom | ( | const INT | min, |
const INT | max | ||
) |
INT walberla::math::intRandom | ( | const INT | min, |
const INT | max, | ||
std::mt19937 & | generator | ||
) |
Returns a random integral number of type INT in the range [min,max] (max included!)
|
inline |
|
inline |
|
inline |
|
inline |
Inverting the given dense matrix.
m | The dense matrix to be inverted. |
This function returns the inverse of the given dense matrix. It has the same effect as calling the getInverse() member function of the matrix.
|
inline |
Inverting the given quaternion.
q | The quaternion to be inverted. |
This function returns the inverse of the given quaternion. It has the same effect as calling the getInverse() member function of the quaternion.
|
inline |
Inverting the given double precision value.
a | The double precision value to be inverted. |
The invert shim represents an abstract interface for inverting a value/object of any given data type. For double precision floating point values this results in \( \frac{1}{a} \).
|
inline |
Inverting the given single precision value.
a | The single precision value to be inverted. |
The invert shim represents an abstract interface for inverting a value/object of any given data type. For single precision floating point values this results in \( \frac{1}{a} \).
|
inline |
Inverting the given long double value.
a | The long double value to be inverted. |
The invert shim represents an abstract interface for inverting a value/object of any given data type. For long double floating point values this results in \( \frac{1}{a} \).
|
inline |
Returns whether the given dense matrix is in default state.
m | The dense matrix to be tested for its default state. |
|
inline |
Returns whether the given quaternion is in default state.
q | The quaternion to be tested for its default state. |
The function returns true in case the real part of the quaternion is 1 and the imaginary parts are 0, otherwise it returns false.
\f[\left(\begin{array}{*{4}{c}} 1 & 0 & 0 & 0 \\ \end{array}\right)\f]
|
inline |
Returns whether the given value/object is in default state.
v | The value/object to be tested for its default state. |
The isDefault shim represents an abstract interface for testing a value/object whether it is in its default state or not. In case the value/object is in its default state, the function returns true, otherwise it returns false. For built-in data types, the function returns true in case the current value is zero.
|
inline |
Checks the given matrix for infinite elements.
m | The matrix to be checked for infinite elements. |
|
inline |
Checks the given vector for infinite elements.
v | The vector to be checked for infinite elements. |
|
inline |
Query if 'x' is infinite.
x | Value to be checked. |
|
inline |
Checks the given matrix for not-a-number elements.
m | The matrix to be checked for not-a-number elements. |
|
inline |
Checks the given matrix for not-a-number elements.
m | The matrix to be checked for not-a-number elements. |
|
inline |
Checks the given matrix for not-a-number elements.
m | The matrix to be checked for not-a-number elements. |
|
inline |
Checks the given quaternion for not-a-number elements.
q | The quaternion to be checked for not-a-number elements. |
|
inline |
Checks the given vector for not-a-number elements.
v | The vector to be checked for not-a-number elements. |
|
inline |
Checks the given vector for not-a-number elements.
v | The vector to be checked for not-a-number elements. |
|
inline |
Query if 'x' is NaN.
x | Value to be checked. |
bool walberla::math::isPrime | ( | const uint_t | n | ) |
Query if n is prime.
n | The number to be checked. |
std::iterator_traits< Iterator >::value_type walberla::math::kahanSummation | ( | const Iterator & | begin, |
const Iterator & | end | ||
) |
Length of the vector.
|
inline |
Maximum function for two arguments.
a | First value. |
b | Second value. |
This function returns the maximum of the two given data values. The return type of the function is determined by the data types of the given arguments (for further detail see the MathTrait class description).
|
inline |
Maximum function for three arguments.
a | First value. |
b | Second value. |
c | Third value. |
This function returns the maximum of the three given data values. The return type of the function is determined by the data types of the given arguments (for further detail see the MathTrait class description).
|
inline |
Minimum function for two arguments.
a | First value. |
b | Second value. |
This function returns the minimum of the two given data values. The return type of the function is determined by the data types of the given arguments (for further detail see the MathTrait class description).
|
inline |
Minimum function for three arguments.
a | First value. |
b | Second value. |
c | Third value |
This function returns the minimum of the three given data values. The return type of the function is determined by the data types of the given arguments (for further detail see the MathTrait class description).
Normalization of the vector ( \(|\vec{a}|=1\)).
Normalization of the vector to a length of 1. If you want to normalize a vector of integral T use member function getNormalized() instead
Normalization of the vector ( \(|\vec{a}|=1\)).
Normalization of the vector to a length of 1. If you want to normalize a vector of integral T use member function getNormalized() instead
|
inline |
|
inline |
Inequality operator for the comparison of a char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Compares two GenericeAABBs for inequality.
see isEqual
ATTENTION: Does not check for non-identity! If you need to check for non-identity, use member function isIdentical of class GenericAABB
lhs | An arbitrary GenericAABB |
rhs | An arbitrary GenericAABB |
|
inline |
Inequality operator for the comparison of two quaternions.
lhs | The left-hand side quaternion for the comparison. |
rhs | The right-hand side quaternion for the comparison. |
|
inline |
Inequality operator for the comparison of a double scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a double scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a float scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a float scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an int scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an int scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a long double scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a long double scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a long scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a long scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a short scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a short scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a signed char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a signed char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an unsigned char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an unsigned char scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
|
inline |
|
inline |
Inequality operator for the comparison of an unsigned long scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an unsigned long scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an unsigned short scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of an unsigned short scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a wchar_t scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Inequality operator for the comparison of a wchar_t scalar value and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If one value of the vector is inequal to the scalar value, the inequality test returns true, otherwise false.
|
inline |
Multiplication operator for the multiplication of two quaternions ( \( \hat{q}=\hat{p}*\hat{r} \)).
lhs | The left-hand side quaternion for the multiplication. |
rhs | The right-hand side quaternion for the multiplication. |
|
inline |
Multiplication operator for the multiplication of a scalar value and a matrix.
( \( A=s*B \)).
scalar | The left-hand-side scalar value for the multiplication. |
matrix | The right-hand-side matrix for the multiplication. |
|
inline |
Multiplication operator for the multiplication of a scalar value and a matrix.
( \( A=s*B \)).
scalar | The left-hand-side scalar value for the multiplication. |
matrix | The right-hand-side matrix for the multiplication. |
|
inline |
Multiplication operator for the multiplication of a scalar value and a vector.
( \( \vec{a}=s*\vec{b} \)).
scalar | The left-hand-side scalar value for the multiplication. |
vec | The right-hand-side vector for the multiplication. |
|
inline |
Multiplication operator for the multiplication of a scalar value and a vector.
( \( \vec{a}=s*\vec{b} \)).
scalar | The left-hand-side scalar value for the multiplication. |
vec | The right-hand-side vector for the multiplication. |
|
inline |
Negation operator for the negation of one matrix.
rhs | The right-hand-side matrix of the operator. |
|
inline |
|
inline |
Serializes an GenericAABB into a mpi::GenericSendBuffer.
buf | The mpi::GenericSendBuffer written to |
aabb | The GenericAABB the be serialized |
mpi::GenericSendBuffer<T,G>& walberla::math::operator<< | ( | mpi::GenericSendBuffer< T, G > & | buf, |
const Matrix2< MT > & | m | ||
) |
mpi::GenericSendBuffer<T,G>& walberla::math::operator<< | ( | mpi::GenericSendBuffer< T, G > & | buf, |
const Sample & | statReal | ||
) |
|
inline |
Writes a GenericAABB to a std::ostream.
The format is [ <0,0,0>, <1,1,1> ]
os | The std::ostream written to |
aabb | The GenericAABB written |
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Matrix2< Type > & | m | ||
) |
Global output operator for 2x2 matrices.
os | Reference to the output stream. |
m | Reference to a constant matrix object. |
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Matrix3< Type > & | m | ||
) |
Global output operator for 3x3 matrices.
os | Reference to the output stream. |
m | Reference to a constant matrix object. |
std::ostream& walberla::math::operator<< | ( | std::ostream & | os, |
const Plane & | plane | ||
) |
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Quaternion< Type > & | q | ||
) |
Global output operator for quaternions.
os | Reference to the output stream. |
q | Reference to a constant quaternion object. |
|
inline |
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Sample & | statReal | ||
) |
Stream output operator for class Sample.
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Vector2< Type > & | v | ||
) |
Global output operator for 2-dimensional vectors.
os | Reference to the output stream. |
v | Reference to a constant vector object. |
std::ostream & walberla::math::operator<< | ( | std::ostream & | os, |
const Vector3< Type > & | v | ||
) |
Global output operator for 3-dimensional vectors.
os | Reference to the output stream. |
v | Reference to a constant vector object. |
|
inline |
Equality operator for the comparison of a char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Compares two GenericeAABBs for equality.
see isEqual
ATTENTION: Does not check for identity! If you need to check for identity, use member function isIdentical of class GenericAABB
lhs | An arbitrary GenericAABB |
rhs | An arbitrary GenericAABB |
|
inline |
Equality operator for the comparison of two quaternions.
lhs | The left-hand side quaternion for the comparison. |
rhs | The right-hand side quaternion for the comparison. |
|
inline |
Equality operator for the comparison of a double scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a double scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a float scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a float scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an int scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an int scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a long double scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a long double scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a long scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a long scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a short scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a short scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a signed char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a signed char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an unsigned char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an unsigned char scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
|
inline |
|
inline |
Equality operator for the comparison of an unsigned long scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an unsigned long scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an unsigned short scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of an unsigned short scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a wchar_t scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
|
inline |
Equality operator for the comparison of a wchar_t scalar and a vector.
scalar | The left-hand-side scalar value for the comparison. |
vec | The right-hand-side vector for the comparison. |
If all values of the vector are equal to the scalar value, the equality test returns true, otherwise false.
mpi::GenericRecvBuffer<T>& walberla::math::operator>> | ( | mpi::GenericRecvBuffer< T > & | buf, |
Matrix2< MT > & | m | ||
) |
mpi::GenericRecvBuffer<T>& walberla::math::operator>> | ( | mpi::GenericRecvBuffer< T > & | buf, |
Sample & | statReal | ||
) |
|
inline |
Reads an GenericAABB from a std::istream.
The format is [ <0,0,0>, <1,1,1> ]
is | The std::istream read from |
aabb | The GenericAABB the read values are to be stored in |
std::istream& walberla::math::operator>> | ( | std::istream & | is, |
Plane & | plane | ||
) |
std::istream & walberla::math::operator>> | ( | std::istream & | is, |
Quaternion< Type > & | q | ||
) |
Global input operator for quaternions.
is | Reference to the input stream. |
q | Reference to a quaternion object. |
|
inline |
Specialization for input operator for 2-dimensional vectors of bool.
The operator can parse e.g. <1, 0, 1> and <true, false, true> from the istream
is | Reference to the input stream. |
v | Reference to a bool vector object. |
std::istream & walberla::math::operator>> | ( | std::istream & | is, |
Vector2< Type > & | v | ||
) |
Global input operator for 2-dimensional vectors.
is | Reference to the input stream. |
v | Reference to a vector object. |
|
inline |
Specialization for input operator for 3-dimensional vectors of bool.
The operator can parse e.g. <1, 0, 1> and <true, false, true> from the istream
is | Reference to the input stream. |
v | Reference to a bool vector object. |
std::istream & walberla::math::operator>> | ( | std::istream & | is, |
Vector3< Type > & | v | ||
) |
Global input operator for 3-dimensional vectors.
is | Reference to the input stream. |
v | Reference to a vector object. |
Converts a radians angle to degrees.
REAL_TYPE walberla::math::realRandom | ( | const REAL_TYPE | min = REAL_TYPE(0) , |
const REAL_TYPE | max = REAL_TYPE(1) , |
||
std::mt19937 & | generator = internal::getGenerator() |
||
) |
Returns a random floating point number of type REAL in the range [min,max) (max excluded!)
|
inline |
Resetting the given dense matrix.
m | The dense matrix to be resetted. |
|
inline |
Resetting the given quaternion.
q | The quaternion to be resetted. |
|
inline |
Resetting the given value/object to the default value.
resettable | The value/object to be resetted. |
The reset shim represents an abstract interface for the resetting of a value/object of any given data type to its default value. Values of built-in data type are reset to zero.
|
inline |
Rounding function.
a | Floating point value. |
void walberla::math::seedRandomGenerator | ( | const std::mt19937::result_type & | seed | ) |
|
inline |
Sign function.
a | The signed value. |
The sign function only works for signed built-in data types. The attempt to use unsigned data types or user-defined class types will result in a compile time error.
http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c
|
inline |
Cross product (outer product) between a matrix and a vector ( \( R = M \cdot r^{\times} \)).
mat | The left-hand side matrix for the skew-symmetric cross product. |
vec | The right-hand side vector for the skew-symmetric cross product. |
This operator multiplies the matrix with the skew-symmetric matrix resulting from the vector, which corresponds to a cross product between the columns vectors of the matrix and the right-hand side vector:
\f[ M \cdot r^{\times} = \left(\begin{array}{*{3}{c}} m_{00} & m_{01} & m_{02} \\ m_{10} & m_{11} & m_{12} \\ m_{20} & m_{21} & m_{22} \\ \end{array}\right) \cdot \left(\begin{array}{*{1}{c}} r_0 \\ r_1 \\ r_2 \\ \end{array}\right)^{\times} = \left(\begin{array}{*{3}{c}} m_{00} & m_{01} & m_{02} \\ m_{10} & m_{11} & m_{12} \\ m_{20} & m_{21} & m_{22} \\ \end{array}\right) \cdot \left(\begin{array}{*{3}{c}} 0 & -r_2 & r_1 \\ r_2 & 0 & -r_0 \\ -r_1 & r_0 & 0 \\ \end{array}\right) \f]
The operator returns a matrix of the higher-order data type of the two involved data types T1 and T2. In case T1 and T2 match, the operator works for any data type as long as the data type has a multiplication and subtraction operator. In case T1 and T2 differ, the operator only works for data types supported by the MathTrait class template.
|
inline |
Cross product (outer product) between a vector and a matrix ( \( R = r^{\times} \cdot M \)).
vec | The left-hand side vector for the skew-symmetric product. |
mat | The right-hand side matrix for the skew-symmetric product. |
This operator multiplies the skew-symmetric matrix resulting from the vector with the right-hand side matrix, which corresponds to a cross product between the vector and the columns vectors of the matrix:
\f[ r^{\times} \cdot M = \left(\begin{array}{*{1}{c}} r_0 \\ r_1 \\ r_2 \\ \end{array}\right)^{\times} \cdot \left(\begin{array}{*{3}{c}} m_{00} & m_{01} & m_{02} \\ m_{10} & m_{11} & m_{12} \\ m_{20} & m_{21} & m_{22} \\ \end{array}\right) = \left(\begin{array}{*{3}{c}} 0 & -r_2 & r_1 \\ r_2 & 0 & -r_0 \\ -r_1 & r_0 & 0 \\ \end{array}\right) \cdot \left(\begin{array}{*{3}{c}} m_{00} & m_{01} & m_{02} \\ m_{10} & m_{11} & m_{12} \\ m_{20} & m_{21} & m_{22} \\ \end{array}\right) \f]
The operator returns a matrix of the higher-order data type of the two involved data types T1 and T2. In case T1 and T2 match, the operator works for any data type as long as the data type has a multiplication and subtraction operator. In case T1 and T2 differ, the operator only works for data types supported by the MathTrait class template.
|
inline |
Squaring the given quaternion.
q | The quaternion to be squared. |
This function squares the given quaternion q. This function has the same effect as multiplying the quaternion with itself ( \( q * q \)).
|
inline |
Squaring the given value/object.
a | The value/object to be squared. |
The square shim represents an abstract interface for squaring a value/object of any given data type. For values of built-in data type this results in a plain multiplication.
|
inline |
Square function.
a | Value to be squared. |
Length of the vector squared.
|
inline |
Swapping the contents of two matrices.
a | The first matrix to be swapped. |
b | The second matrix to be swapped. |
no-throw | guarantee. |
|
inline |
Swapping the contents of two quaternions.
a | The first quaternion to be swapped. |
b | The second quaternion to be swapped. |
no-throw | guarantee. |
Matrix2< typename MathTrait<T0,T1>::High > walberla::math::tensorProduct | ( | Vector2< T0 > | v0, |
Vector2< T1 > | v1 | ||
) |
Matrix3< typename MathTrait<T0,T1>::High > walberla::math::tensorProduct | ( | Vector3< T0 > | v0, |
Vector3< T1 > | v1 | ||
) |
|
inline |
Equivalent to R*A*R.getTranspose().
|
inline |
Returns true only if 'value' is an even number.
|
inline |
Returns true only if 'value' (must be an unsigned integer) is a power of 2 (http://graphics.stanford.edu/~seander/bithacks.html)
uint_t walberla::math::uintMSBPosition | ( | UINT | value | ) |
Calculation of the position of the most significant bit of a variable of type UINT.
Examples: "[...] 1001" -> 4, "[...] 0011" -> 2, "[...] 0110" -> 3, "[...] 0001" -> 1, "[...] 0000" -> 0, etc.
|
inline |
|
inline |
uint_t walberla::math::uintMSBPosition< uint64_t > | ( | uint64_t | value | ) |
|
inline |
|
inline |
Returns the result of 16^exp.
|
inline |
Returns the result of 2^exp.
|
inline |
Returns the result of 4^exp.
|
inline |
Returns the result of 8^exp.
|
static |