32 #ifndef HYPERVOLUME_APPROXIMATOR_H 33 #define HYPERVOLUME_APPROXIMATOR_H 50 template<
typename Rng>
79 template<
typename Iterator,
typename Extractor,
typename VectorType>
95 boost::uint_fast64_t maxSamples=
static_cast<boost::uint_fast64_t
>( 12. * std::log( 1. / delta ) / std::log( 2. ) * noPoints/eps/eps );
99 typename VectorType::iterator itv = vol.begin();
100 for( Iterator it = begin;
104 *itv = referencePoint[ 0 ] - e( *it )[ 0 ];
105 for( std::size_t i = 1; i < e( *it ).size(); i++ )
106 *itv *= referencePoint[ i ] - e( *it )[ i ];
111 for(
size_t i = 0; i < noPoints; i++) {
122 boost::uint_fast64_t samples_sofar=0;
123 boost::uint_fast64_t round=0;
130 for( itt = begin; itt != end; ++itt, ++itv ) {
136 for( std::size_t i = 0; i < rndpoint.size(); i++ )
137 rndpoint[ i ] = e( (*itt) )[ i ] + Rng::uni() * ( referencePoint[ i ] - e( (*itt) )[ i ] );
140 if(samples_sofar>=maxSamples)
141 return maxSamples * T / noPoints / round;
142 itt = begin +
static_cast<std::size_t
>(noPoints*
Rng::uni());
159 #endif // HYPERVOLUME_APPROXIMATOR_H