34 #include "../WAssert.h"
35 #include "../WStringUtils.h"
42 template<
typename S >
friend class WValue;
46 template<
typename U >
friend std::ostream& operator<<( std::ostream& os, const WValue< U > &rhs );
47 template<
typename U >
friend std::istream& operator>>( std::istream& in,
WValue< U >& rhs );
55 explicit WValue(
size_t nbComponents )
86 explicit WValue(
const Eigen::VectorXd& newValues )
96 explicit WValue(
const Eigen::VectorXf& newValues )
106 explicit WValue(
const Eigen::VectorXi& newValues )
129 WAssert( i <
m_components.size(),
"Index out of bounds." );
141 WAssert( i <
m_components.size(),
"Index out of bounds." );
263 result -= subtrahend;
319 double currentNorm =
norm();
322 WAssert( currentNorm > 0.0,
"Norm is non-positive!" );
344 WAssert( !
m_components.empty(),
"WValue has no entries." );
350 return ( sum / static_cast< T >(
m_components.size() ) );
359 WAssert( !
m_components.empty(),
"WValue has no entries. " );
361 std::sort( components.begin(), components.end() );
362 return components[ components.size() / 2 ];
381 template<
typename EigenDataType >
443 template<
typename U >
inline std::ostream& operator<<( std::ostream& os, const WValue< U > &rhs )
456 template<
typename U >
inline std::istream& operator>>( std::istream& in,
WValue< U >& rhs )