32 #ifndef SHARK_ALGORITHMS_DIRECTSEARCH_INDICATORS_HYPERVOLUMEINDICATOR_H 33 #define SHARK_ALGORITHMS_DIRECTSEARCH_INDICATORS_HYPERVOLUMEINDICATOR_H 58 template<
typename ParetoFrontType,
typename ParetoArchive>
59 std::size_t
leastContributor( ParetoFrontType
const& front, ParetoArchive
const& )
const{
61 if(m_reference.size() != 0)
62 return m_algorithm.
smallest(front,1,m_reference)[0].value;
64 return m_algorithm.
smallest(front,1)[0].value;
67 template<
typename ParetoFrontType,
typename ParetoArchive>
68 std::vector<std::size_t>
leastContributors( ParetoFrontType
const& front, ParetoArchive
const& archive, std::size_t K)
const{
69 std::vector<std::size_t> indices;
70 std::vector<RealVector> points(front.begin(),front.end());
71 std::vector<std::size_t> activeIndices(points.size());
72 std::iota(activeIndices.begin(),activeIndices.end(),0);
73 for(std::size_t k=0; k != K; ++k){
76 points.erase(points.begin()+index);
77 indices.push_back(activeIndices[index]);
78 activeIndices.erase(activeIndices.begin()+index);
83 template<
class random>
84 void init(std::size_t , std::size_t , random& ){}
90 m_reference = newReference;
117 template<
typename Archive>
118 void serialize( Archive & archive,
const unsigned int version ) {
119 archive & BOOST_SERIALIZATION_NVP( m_reference );
120 archive & BOOST_SERIALIZATION_NVP( m_algorithm );
124 RealVector m_reference;