11#ifndef QUGAR_LIBRARY_TOLERANCE_HPP
13#define QUGAR_LIBRARY_TOLERANCE_HPP
188 void unique(std::vector<real> &values)
const;
200 template<
int dim,
typename T>
203 for (
int dir = 0; dir < dim; ++dir) {
204 if (!this->
equal(pt_0(dir), pt_1(dir))) {
Class for tolerance related computations.
Definition tolerance.hpp:33
Tolerance()
Default constructor. It initalizes the class instance with a near epsilon tolerance.
bool greater_than(const real lhs, const real rhs) const
Compares if a value is greater than other up to tolerance.
bool is_negative(const real val) const
Check if val is negative.
void unique(std::vector< real > &values) const
Makes the given values unique up to tolerance. values will be also sorted.
real tolerance_
Tolerance value.
Definition tolerance.hpp:214
Tolerance(const real tol_0, const real tol_1)
Constructor. Creates a new class instance using the largest of the two given tolerances.
bool coincident(const Point< dim, T > &pt_0, const Point< dim, T > &pt_1) const
Checks if two points are coincident.
Definition tolerance.hpp:201
bool is_positive(const real val) const
Check if val is positive.
bool smaller_than(const real lhs, const real rhs) const
Compares if a value is smaller than other up to tolerance.
bool equal(const real lhs, const real rhs) const
Compares if two values are equal up to tolerance.
bool smaller_than_rel(const real lhs, const real rhs) const
Compares if a value is smaller than other up to tolerance relative to the larger of the two argumetns...
Tolerance(const Tolerance &tol_0, const Tolerance &tol_1)
Constructor. Creates a new class instance using the largest of the two given tolerances.
bool equal_rel(const real lhs, const real rhs) const
Compares if two values are equal up to tolerance relative to the larger of the two arguments.
bool greater_equal_than(const real lhs, const real rhs) const
Compares if a value is greater or equal than other up to tolerance.
void update(const Tolerance &tol)
Resets the tolerance value as the maximum between the current tolerance_ and tol.
bool equal_rel(const real lhs, const real rhs, const Tolerance &rel_tolerance) const
Compares if two values are equal up to the different absolute and relative tolerances.
bool smaller_equal_than(const real lhs, const real rhs) const
Compares if a value is smaller or equal than other up to tolerance.
void update(const real tol)
Resets the tolerance value as the maximum between the current tolerance_ and tol.
bool greater_than_rel(const real lhs, const real rhs) const
Compares if a value is greater than other up to tolerance relative to the larger of the two argumetns...
real value() const
Returns the real tolerance value.
Tolerance(const real value)
Constructor.
bool is_zero(const real val) const
Check if val is zero up to tolerance.
QUGaR's main namespace.
Definition affine_transf.hpp:28
double real
Definition types.hpp:18
Vector< T, dim > Point
Class representing a dim-dimensional Point.
Definition point.hpp:34
Definition and implementation of Point class.