53 std::vector<KeyValuePair<double,std::size_t> >
smallest(Set
const& points, std::size_t k,
VectorType const& ref)
const{
56 std::vector<KeyValuePair<double,std::size_t> > result( points.size() );
58 auto const& point = points[i];
61 std::vector<RealVector> pointset( points.begin(), points.end() );
62 pointset.erase( pointset.begin() + i );
63 restrictSet(pointset,point);
65 double baseVol = std::exp(sum(log(ref-point)));
66 result[i].key = baseVol - hv(pointset,ref);
69 std::sort(result.begin(),result.end());
70 result.erase(result.begin()+k,result.end());
81 std::vector<KeyValuePair<double,std::size_t> >
largest(Set
const& points, std::size_t k,
VectorType const& ref)
const{
84 std::vector<KeyValuePair<double,std::size_t> > result( points.size() );
86 auto const& point = points[i];
89 std::vector<RealVector> pointset( points.begin(), points.end() );
90 pointset.erase( pointset.begin() + i );
91 restrictSet(pointset,point);
93 double baseVol = std::exp(sum(log(ref-point)));
94 result[i].key = baseVol - hv(pointset,ref);
97 std::sort(result.begin(),result.end());
98 result.erase(result.begin(),result.end()-k);
99 std::reverse(result.begin(),result.end());
110 std::vector<KeyValuePair<double,std::size_t> >
smallest(Set
const& points, std::size_t k)
const{
113 std::vector<std::size_t> minIndex(points[0].size(),0);
114 RealVector minVal = points[0];
115 RealVector ref=points[0];
116 for(std::size_t i = 1; i != points.size(); ++i){
117 noalias(ref) = max(ref,points[i]);
118 for(std::size_t j = 0; j != minVal.size(); ++j){
119 if(points[i](j)< minVal[j]){
120 minVal[j] = points[i](j);
126 std::vector<KeyValuePair<double,std::size_t> > result;
128 if(std::find(minIndex.begin(),minIndex.end(),i) != minIndex.end())
131 auto const& point = points[i];
134 std::vector<RealVector> pointset( points.begin(), points.end() );
135 pointset.erase( pointset.begin() + i );
136 restrictSet(pointset,point);
138 double baseVol = std::exp(sum(log(ref-point)));
139 double volume = baseVol - hv(pointset,ref);
141 result.emplace_back(volume,i);
144 std::sort(result.begin(),result.end());
145 result.erase(result.begin()+k,result.end());
157 std::vector<KeyValuePair<double,std::size_t> >
largest(Set
const& points, std::size_t k)
const{
160 std::vector<std::size_t> minIndex(points[0].size(),0);
161 RealVector minVal = points[0];
162 RealVector ref=points[0];
163 for(std::size_t i = 1; i != points.size(); ++i){
164 noalias(ref) = max(ref,points[i]);
165 for(std::size_t j = 0; j != minVal.size(); ++j){
166 if(points[i](j)< minVal[j]){
167 minVal[j] = points[i](j);
174 std::vector<KeyValuePair<double,std::size_t> > result;
176 if(std::find(minIndex.begin(),minIndex.end(),i) != minIndex.end())
178 auto const& point = points[i];
181 std::vector<RealVector> pointset( points.begin(), points.end() );
182 pointset.erase( pointset.begin() + i );
183 restrictSet(pointset,point);
185 double baseVol = std::exp(sum(log(ref-point)));
186 double volume = baseVol - hv(pointset,ref);
188 result.emplace_back(volume,i);
191 std::sort(result.begin(),result.end());
192 result.erase(result.begin(),result.end()-k);
193 std::reverse(result.begin(),result.end());