All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Valid.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
18 
19 #ifndef SURGSIM_MATH_VALID_H
20 #define SURGSIM_MATH_VALID_H
21 
22 #include <math.h>
23 #include <Eigen/Core>
24 #include <Eigen/Geometry>
25 
26 namespace SurgSim
27 {
28 namespace Math
29 {
30 
35 inline bool isValid(float value);
36 
41 inline bool isValid(double value);
42 
49 template <typename T>
50 inline bool isValid(const Eigen::DenseBase<T>& value);
51 
58 template <typename T>
59 inline bool isValid(const Eigen::QuaternionBase<T>& value);
60 
67 template <typename T>
68 inline bool isValid(const Eigen::AngleAxis<T>& value);
69 
76 template <typename T>
77 inline bool isValid(const Eigen::Rotation2D<T>& value);
78 
88 template <typename T, int D, int M, int O>
89 inline bool isValid(const Eigen::Transform<T, D, M, O>& value);
90 
91 
92 
99 inline bool isSubnormal(float value);
100 
107 inline bool isSubnormal(double value);
108 
116 template <typename T>
117 inline bool isSubnormal(const Eigen::DenseBase<T>& value);
118 
126 template <typename T>
127 inline bool isSubnormal(const Eigen::QuaternionBase<T>& value);
128 
136 template <typename T>
137 inline bool isSubnormal(const Eigen::AngleAxis<T>& value);
138 
146 template <typename T>
147 inline bool isSubnormal(const Eigen::Rotation2D<T>& value);
148 
159 template <typename T, int D, int M, int O>
160 inline bool isSubnormal(const Eigen::Transform<T, D, M, O>& value);
161 
162 
163 
170 inline bool setSubnormalToZero(float* value);
171 
178 inline bool setSubnormalToZero(double* value);
179 
187 template <typename T>
188 inline bool setSubnormalToZero(Eigen::DenseBase<T>* value);
189 
197 template <typename T>
198 inline bool setSubnormalToZero(Eigen::QuaternionBase<T>* value);
199 
207 template <typename T>
208 inline bool setSubnormalToZero(Eigen::AngleAxis<T>* value);
209 
217 template <typename T>
218 inline bool setSubnormalToZero(Eigen::Rotation2D<T>* value);
219 
227 template <typename T, int D, int M, int O>
228 inline bool setSubnormalToZero(Eigen::Transform<T, D, M, O>* value);
229 
230 }; // namespace Math
231 }; // namespace SurgSim
232 
233 
234 #include "SurgSim/Math/Valid-inl.h"
235 
236 
237 #endif // SURGSIM_MATH_VALID_H
bool isSubnormal(float value)
Check if a float value is subnormal.
Definition: Valid-inl.h:142
Implementation of isValid(), isSubnormal() and setSubnormalToZero().
bool setSubnormalToZero(float *value)
If the float value is subnormal, set it to zero.
Definition: Valid-inl.h:188
bool isValid(float value)
Check if a float value is valid.
Definition: Valid-inl.h:98