opensurgsim
Classes | Namespaces | Functions
Valid-inl.h File Reference

Implementation of isValid(), isSubnormal() and setSubnormalToZero(). More...

#include <boost/math/special_functions/fpclassify.hpp>

Go to the source code of this file.

Classes

class  SurgSim::Math::internal::PredicateAlwaysTrueVisitor< T, V >
 
class  SurgSim::Math::internal::ValidVisitor< T >
 
class  SurgSim::Math::internal::NonSubnormalVisitor< T >
 

Namespaces

 SurgSim
 Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui needs glew but we need to call glewInit() from a osg callback, using this call we avoid getting warnings about redefinitions.
 

Functions

bool SurgSim::Math::isValid (float value)
 Check if a float value is valid. More...
 
bool SurgSim::Math::isValid (double value)
 Check if a double value is valid. More...
 
template<typename T >
bool SurgSim::Math::isValid (const Eigen::DenseBase< T > &value)
 Check if a matrix or a vector is valid. More...
 
template<typename T >
bool SurgSim::Math::isValid (const Eigen::QuaternionBase< T > &value)
 Check if a quaternion is valid. More...
 
template<typename T >
bool SurgSim::Math::isValid (const Eigen::AngleAxis< T > &value)
 Check if an angle/axis 3D rotation is valid. More...
 
template<typename T >
bool SurgSim::Math::isValid (const Eigen::Rotation2D< T > &value)
 Check if a 2D rotation is valid. More...
 
template<typename T , int D, int M, int O>
bool SurgSim::Math::isValid (const Eigen::Transform< T, D, M, O > &value)
 Check if a transform is valid. More...
 
bool SurgSim::Math::isSubnormal (float value)
 Check if a float value is subnormal. More...
 
bool SurgSim::Math::isSubnormal (double value)
 Check if a double value is subnormal. More...
 
template<typename T >
bool SurgSim::Math::isSubnormal (const Eigen::DenseBase< T > &value)
 Check if a matrix or a vector contains any subnormal floating-point values. More...
 
template<typename T >
bool SurgSim::Math::isSubnormal (const Eigen::QuaternionBase< T > &value)
 Check if a quaternion contains any subnormal floating-point values. More...
 
template<typename T >
bool SurgSim::Math::isSubnormal (const Eigen::AngleAxis< T > &value)
 Check if an angle/axis 3D rotation contains any subnormal floating-point values. More...
 
template<typename T >
bool SurgSim::Math::isSubnormal (const Eigen::Rotation2D< T > &value)
 Check if a 2D rotation is described by an angle that is subnormal. More...
 
template<typename T , int D, int M, int O>
bool SurgSim::Math::isSubnormal (const Eigen::Transform< T, D, M, O > &value)
 Check if a transform contains any subnormal floating-point values. More...
 
bool SurgSim::Math::setSubnormalToZero (float *value)
 If the float value is subnormal, set it to zero. More...
 
bool SurgSim::Math::setSubnormalToZero (double *value)
 If the double value is subnormal, set it to zero. More...
 
template<typename T >
bool SurgSim::Math::setSubnormalToZero (Eigen::DenseBase< T > *value)
 Set all subnormal values in a matrix or a vector to zero. More...
 
template<typename T >
bool SurgSim::Math::setSubnormalToZero (Eigen::QuaternionBase< T > *value)
 Set all subnormal values in a quaternion to zero. More...
 
template<typename T >
bool SurgSim::Math::setSubnormalToZero (Eigen::AngleAxis< T > *value)
 Set all subnormal values in an angle/axis 3D rotation to zero. More...
 
template<typename T >
bool SurgSim::Math::setSubnormalToZero (Eigen::Rotation2D< T > *value)
 If the angle of a 2D rotation is subnormal, set it to zero. More...
 
template<typename T , int D, int M, int O>
bool SurgSim::Math::setSubnormalToZero (Eigen::Transform< T, D, M, O > *value)
 Set all subnormal values in a transform to zero. More...
 

Detailed Description

Implementation of isValid(), isSubnormal() and setSubnormalToZero().

Function Documentation

§ isSubnormal() [1/7]

bool SurgSim::Math::isSubnormal ( float  value)
inline

Check if a float value is subnormal.

Subnormal values have absolute values in the range std::numeric_limits<float>::denorm_min() <= x < std::numeric_limits<float>::min(), and can result in very slow floating point calculations under some conditions.

Parameters
valuethe value to check.
Returns
true if subnormal; false if not (normal, zero, infinite or NaN).

§ isSubnormal() [2/7]

bool SurgSim::Math::isSubnormal ( double  value)
inline

Check if a double value is subnormal.

Subnormal values have absolute values in the range std::numeric_limits<double>::denorm_min() <= x < std::numeric_limits<double>::min(), and can result in very slow floating point calculations under some conditions.

Parameters
valuethe value to check.
Returns
true if subnormal; false if not (normal, zero, infinite or NaN).

§ isSubnormal() [3/7]

template<typename T >
bool SurgSim::Math::isSubnormal ( const Eigen::DenseBase< T > &  value)
inline

Check if a matrix or a vector contains any subnormal floating-point values.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe base type used to describe the matrix or vector. Can usually be deduced.
Parameters
valuethe matrix or vector value to check.
Returns
true if any value is subnormal; false if none are (i.e. each is normal, zero, infinite or NaN).

§ isSubnormal() [4/7]

template<typename T >
bool SurgSim::Math::isSubnormal ( const Eigen::QuaternionBase< T > &  value)
inline

Check if a quaternion contains any subnormal floating-point values.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe base type used to describe the quaternion. Can usually be deduced.
Parameters
valuethe quaternion value to check.
Returns
true if any value is subnormal; false if none are (i.e. each is normal, zero, infinite or NaN).

§ isSubnormal() [5/7]

template<typename T >
bool SurgSim::Math::isSubnormal ( const Eigen::AngleAxis< T > &  value)
inline

Check if an angle/axis 3D rotation contains any subnormal floating-point values.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
valuethe rotation value to check.
Returns
true if any value is subnormal; false if none are (i.e. each is normal, zero, infinite or NaN).

§ isSubnormal() [6/7]

template<typename T >
bool SurgSim::Math::isSubnormal ( const Eigen::Rotation2D< T > &  value)
inline

Check if a 2D rotation is described by an angle that is subnormal.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
valuethe 2D rotation value to check.
Returns
true if the angle is subnormal; false if not (normal, zero, infinite or NaN).

§ isSubnormal() [7/7]

template<typename T , int D, int M, int O>
bool SurgSim::Math::isSubnormal ( const Eigen::Transform< T, D, M, O > &  value)
inline

Check if a transform contains any subnormal floating-point values.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe scalar type used to describe the transform. Can usually be deduced.
Dthe dimension used to describe the transform. Can usually be deduced.
Mthe mode value used to describe the transform. Can usually be deduced.
Othe options value used to describe the transform. Can usually be deduced.
Parameters
valuethe transform value to check.
Returns
true if any value is subnormal; false if none are (i.e. each is normal, zero, infinite or NaN).

§ isValid() [1/7]

bool SurgSim::Math::isValid ( float  value)
inline

Check if a float value is valid.

Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Parameters
valuethe value to check.
Returns
true if valid, false if not.

§ isValid() [2/7]

bool SurgSim::Math::isValid ( double  value)
inline

Check if a double value is valid.

Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Parameters
valuethe value to check.
Returns
true if valid, false if not.

§ isValid() [3/7]

template<typename T >
bool SurgSim::Math::isValid ( const Eigen::DenseBase< T > &  value)
inline

Check if a matrix or a vector is valid.

These quantities are valid if all of their elements are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Template Parameters
Tthe base type used to describe the matrix or vector. Can usually be deduced.
Parameters
valuethe matrix or vector value to check.
Returns
true if valid, false if not.

§ isValid() [4/7]

template<typename T >
bool SurgSim::Math::isValid ( const Eigen::QuaternionBase< T > &  value)
inline

Check if a quaternion is valid.

Quaternions are valid if all of their components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Template Parameters
Tthe base type used to describe the quaternion. Can usually be deduced.
Parameters
valuethe quaternion value to check.
Returns
true if valid, false if not.

§ isValid() [5/7]

template<typename T >
bool SurgSim::Math::isValid ( const Eigen::AngleAxis< T > &  value)
inline

Check if an angle/axis 3D rotation is valid.

Angle/axis rotations are valid if the angle and the axis components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
valuethe rotation value to check.
Returns
true if valid, false if not.

§ isValid() [6/7]

template<typename T >
bool SurgSim::Math::isValid ( const Eigen::Rotation2D< T > &  value)
inline

Check if a 2D rotation is valid.

2D rotations are valid if the rotation angle is valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
valuethe rotation value to check.
Returns
true if valid, false if not.

§ isValid() [7/7]

template<typename T , int D, int M, int O>
bool SurgSim::Math::isValid ( const Eigen::Transform< T, D, M, O > &  value)
inline

Check if a transform is valid.

Transforms are valid if all of their components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.

Template Parameters
Tthe scalar type used to describe the transform. Can usually be deduced.
Dthe dimension used to describe the transform. Can usually be deduced.
Mthe mode value used to describe the transform. Can usually be deduced.
Othe options value used to describe the transform. Can usually be deduced.
Parameters
valuethe transform value to check.
Returns
true if valid, false if not.

§ setSubnormalToZero() [1/7]

bool SurgSim::Math::setSubnormalToZero ( float *  value)
inline

If the float value is subnormal, set it to zero.

Subnormal values have absolute values in the range std::numeric_limits<float>::denorm_min() <= x < std::numeric_limits<float>::min(), and can result in very slow floating point calculations under some conditions.

Parameters
[in,out]valuethe value to check and possibly modify.
Returns
true if the value was modified.

§ setSubnormalToZero() [2/7]

bool SurgSim::Math::setSubnormalToZero ( double *  value)
inline

If the double value is subnormal, set it to zero.

Subnormal values have absolute values in the range std::numeric_limits<double>::denorm_min() <= x < std::numeric_limits<double>::min(), and can result in very slow floating point calculations under some conditions.

Parameters
[in,out]valuethe value to check and possibly modify.
Returns
true if the value was modified.

§ setSubnormalToZero() [3/7]

template<typename T >
bool SurgSim::Math::setSubnormalToZero ( Eigen::DenseBase< T > *  value)
inline

Set all subnormal values in a matrix or a vector to zero.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe base type used to describe the matrix or vector. Can usually be deduced.
Parameters
[in,out]valuethe matrix or vector value to check and possibly modify.
Returns
true if any value was modified.

§ setSubnormalToZero() [4/7]

template<typename T >
bool SurgSim::Math::setSubnormalToZero ( Eigen::QuaternionBase< T > *  value)
inline

Set all subnormal values in a quaternion to zero.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe base type used to describe the quaternion. Can usually be deduced.
Parameters
[in,out]valuethe quaternion value to check and possibly modify.
Returns
true if any value was modified.

§ setSubnormalToZero() [5/7]

template<typename T >
bool SurgSim::Math::setSubnormalToZero ( Eigen::AngleAxis< T > *  value)
inline

Set all subnormal values in an angle/axis 3D rotation to zero.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
[in,out]valuethe rotation value to check and possibly modify.
Returns
true if any value was modified.

§ setSubnormalToZero() [6/7]

template<typename T >
bool SurgSim::Math::setSubnormalToZero ( Eigen::Rotation2D< T > *  value)
inline

If the angle of a 2D rotation is subnormal, set it to zero.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe scalar type used to describe the rotation. Can usually be deduced.
Parameters
[in,out]valuethe rotation value to check and possibly modify.
Returns
true if the value was modified.

§ setSubnormalToZero() [7/7]

template<typename T , int D, int M, int O>
bool SurgSim::Math::setSubnormalToZero ( Eigen::Transform< T, D, M, O > *  value)
inline

Set all subnormal values in a transform to zero.

Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min(), and can result in very slow floating point calculations under some conditions.

Template Parameters
Tthe base type used to describe the transform. Can usually be deduced.
Parameters
[in,out]valuethe transform value to check and possibly modify.
Returns
true if any value was modified.