45 std::vector<std::size_t>
leastContributors(ParetofrontType
const& front, ParetoArchive
const& archive, std::size_t K)
const{
48 std::vector<RealVector> points;
49 for(
auto const& point: archive)
50 points.push_back(point);
51 for(
auto const& point: front)
52 points.push_back(point);
55 RealVector ideal = points.front();
56 for(
auto& point: points){
57 noalias(ideal) = min(ideal,point);
60 for(
auto& point: points)
61 noalias(point) = point - ideal;
62 RealVector normalizer = computeNormalizer(points);
65 for(
auto& point: points)
66 noalias(point) = point/ normalizer;
70 std::vector<Pair> pairing(points.size(),
makeKeyValuePair(std::numeric_limits<double>::max(),std::pair<std::size_t, std::size_t>()));
71 for(std::size_t j = 0; j != points.size(); ++j){
73 for(std::size_t i = 0; i != m_Z.size(); ++i){
78 double dist = norm_sqr(points[j]) -
sqr(inner_prod(m_Z[i],points[j]));
84 std::vector<std::size_t> rho(m_Z.size(),0);
86 for(; k != archive.size(); ++k){
87 rho[pairing[k].value.second] ++;
90 while(k < points.size() - K){
92 std::size_t index = std::min_element(rho.begin(),rho.end()) - rho.begin();
96 for(std::size_t i = k; i != points.size(); ++i){
97 if(pairing[i].value.second == index){
104 rho[index] = points.size() +1;
114 std::vector<std::size_t> unselected;
115 for(; k != points.size(); ++k){
116 SIZE_CHECK(pairing[k].value.first >= archive.size());
117 unselected.push_back(pairing[k].value.first - archive.size());
137 void init(std::size_t numOfObjectives,
140 std::vector<Preference>
const & preferences = std::vector<Preference>()){
143 if(preferences.empty())
153 numOfObjectives, numLatticeTicks, preferences);
158 m_Z.resize(refs.size1());
159 for(std::size_t i = 0; i < refs.size1(); ++i){
160 m_Z[i] = row(refs, i);