6 return value < 0 ? - value : value;
10 return std::sqrt( value.real()*value.real() + value.imag() * value.imag() );
19 for (
int d=0; d<i; d++) {
30 return lhs - rhs > tolerance;
38 return lhs - rhs >= - tolerance;
57 return lhs - rhs <= tolerance;
65 return std::abs(rhs - lhs) <= tolerance;
69 const std::complex<double>& lhs,
70 const std::complex<double>& rhs,
73 return (
std::abs(rhs.real() - lhs.real()) <= tolerance) && (
std::abs(rhs.imag() - lhs.imag()) <= tolerance);
77 if (
greater(number, tolerance) ) {
79 }
else if (
greater(tolerance, number) ) {
86 return static_cast<int>(std::floor(value+0.5));
90 return static_cast<int>(std::floor(value+0.5));
const float const float const float struct part *restrict struct part *restrict const float a
bool greater(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool greaterEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
double abs(double value)
Returns the absolute value of a type by redirecting to std::abs.
bool smallerEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
int sign(double value, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool equals(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs, const Scalar &tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares to matrices on equality by means of a numerical accuracy.
int aPowI(int i, int a)
Computes the i-th power of a in integer arithmetic.