39 #ifndef __VMML__VALIDATOR__HPP__
40 #define __VMML__VALIDATOR__HPP__
42 #include <vmmlib/tensor3.hpp>
53 template<
size_t M,
typename T >
56 template<
size_t M,
size_t N,
typename T >
59 template<
size_t M,
size_t N,
size_t L,
typename T >
65 #define VMML_TEMPLATE_CLASSNAME validator
69 template<
size_t M,
size_t N,
size_t L,
typename T >
75 for( const_t3_iterator it = data_.begin(); valid && it != data_.end(); ++it )
77 if ( std::isnan( *it ) )
79 if ( std::isinf( *it ) )
83 #ifdef VMMLIB_THROW_EXCEPTIONS
85 VMMLIB_ERROR(
"vector contains nan or inf.", VMMLIB_HERE );
94 template<
size_t M,
size_t N,
typename T >
96 VMML_TEMPLATE_CLASSNAME::is_valid(
const matrix< M, N, T >& data_ )
98 typedef typename matrix< M, N, T>::const_iterator const_m_iterator;
101 for( const_m_iterator it = data_.begin(); valid && it != data_.end(); ++it )
103 if ( std::isnan( *it ) )
105 if ( std::isinf( *it ) )
109 #ifdef VMMLIB_THROW_EXCEPTIONS
111 VMMLIB_ERROR(
"matrix contains nan or inf.", VMMLIB_HERE );
118 template<
size_t M,
typename T >
120 VMML_TEMPLATE_CLASSNAME::is_valid(
const vector< M, T >& data_ )
122 typedef typename vector< M, T>::const_iterator const_v_iterator;
124 for( const_v_iterator it = data_.begin(); valid && it != data_.end(); ++it )
126 if ( std::isnan( *it ) )
128 if ( std::isinf( *it ) )
132 #ifdef VMMLIB_THROW_EXCEPTIONS
134 VMMLIB_ERROR(
"vector contains nan or inf.", VMMLIB_HERE );
141 #undef VMML_TEMPLATE_CLASSNAME