ResultType getWidths (const IObject & v){ ResultType result(v.dimension(), true); typename IObject::const_iterator b = v.begin(), e = v.end(); typename ResultType::iterator i = result.begin(); while(b!=e) { *i = width(*b); ++b; ++i; } return result; }
typename capd::TypeTraits<typename IObject::ScalarType>::Real maxWidth(const IObject& v) { typedef typename capd::TypeTraits<typename IObject::ScalarType>::Real ScalarType; ScalarType result(0.); typename IObject::const_iterator b=v.begin(), e=v.end(); while(b!=e) { result = capd::max(result, width(*b)); ++b; } return result; }
typename IObject::ScalarType maxDiam(const IObject& v) { typedef typename IObject::ScalarType ScalarType; ScalarType result(0.); typename IObject::const_iterator b=v.begin(), e=v.end(); while(b!=e) { result = capd::max(result,diam(*b)); ++b; } return ScalarType(rightBound(result)); }