31 #ifndef SHARK_ALGORITHMS_DIRECTSEARCH_HYPERVOLUMECONTRIBUTION_H 32 #define SHARK_ALGORITHMS_DIRECTSEARCH_HYPERVOLUMECONTRIBUTION_H 58 return m_approximationAlgorithm.
epsilon();
61 return m_approximationAlgorithm.
epsilon();
65 return m_approximationAlgorithm.
delta();
69 return m_approximationAlgorithm.
delta();
72 template<
typename Archive>
73 void serialize( Archive & archive,
const unsigned int version ) {
74 archive & BOOST_SERIALIZATION_NVP(m_useApproximation);
75 archive & BOOST_SERIALIZATION_NVP(m_approximationAlgorithm);
83 template<
class Set,
typename VectorType>
84 std::vector<KeyValuePair<double,std::size_t> >
smallest(Set
const& points, std::size_t k,
VectorType const& ref)
const{
86 SIZE_CHECK( points.begin()->size() == ref.size() );
87 std::size_t numObjectives = ref.size();
88 if(numObjectives == 2){
90 return algorithm.
smallest(points, k, ref);
91 }
else if(numObjectives == 3){
93 return algorithm.
smallest(points, k, ref);
94 }
else if(m_useApproximation){
95 return m_approximationAlgorithm.
smallest(points, k, ref);
98 return algorithm.
smallest(points, k, ref);
106 template<
class Set,
typename VectorType>
107 std::vector<KeyValuePair<double,std::size_t> >
largest(Set
const& points, std::size_t k,
VectorType const& ref)
const{
109 SIZE_CHECK( points.begin()->size() == ref.size() );
110 std::size_t numObjectives = ref.size();
111 if(numObjectives == 2){
113 return algorithm.
largest(points, k, ref);
114 }
else if(numObjectives == 3){
116 return algorithm.
largest(points, k, ref);
118 SHARK_RUNTIME_CHECK(!m_useApproximation,
"Largest not implemented for approximation algorithm");
120 return algorithm.
largest(points, k, ref);
132 std::vector<KeyValuePair<double,std::size_t> >
smallest(Set
const& points, std::size_t k)
const{
134 std::size_t numObjectives = points[0].size();
135 if(numObjectives == 2){
137 return algorithm.
smallest(points, k);
138 }
else if(numObjectives == 3){
140 return algorithm.
smallest(points, k);
141 }
else if(m_useApproximation){
142 return m_approximationAlgorithm.
smallest(points, k);
145 return algorithm.
smallest(points, k);
156 std::vector<KeyValuePair<double,std::size_t> >
largest(Set
const& points, std::size_t k)
const{
158 std::size_t numObjectives = points[0].size();
159 if(numObjectives == 2){
161 return algorithm.
largest(points, k);
162 }
else if(numObjectives == 3){
164 return algorithm.
largest(points, k);
166 SHARK_RUNTIME_CHECK(!m_useApproximation,
"Largest not implemented for approximation algorithm");
168 return algorithm.
largest(points, k);
173 bool m_useApproximation;