You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[&](constsize_t a, constsize_t b) { return data[a].id() < data[b].id(); });
// apply the permutation on all the attribute lists
for (auto& it : this->attrlist_map) {
it.second->reorder(order);
}
std::sort(data.begin(), data.end(), [](const ObjT& a, const ObjT& b) { return a.id() < b.id(); });
hashed_objs_.clear();
sorted_size_ = data.size();
}
now sorts with the obj.id()
Is it feasible to allow a lambda arg so a user can say sort by obj attribute?
Also, std::sort is called twice in the current implementation.
If reorder is implemented for objList and
reorder does not destroy the input permutation list (right now I think it was changed to all -1 after the call)
then we can reuse the permutation list to arrange the objList and avoid calling std::sort twice.
Would such change be feasible?
The text was updated successfully, but these errors were encountered:
kygx-legend
changed the title
sort by attribute and reorder by vector<int> for objList?
Sort by attribute and reorder by vector<int> for objList?
Jan 26, 2017
If you sort by another attribute, how do you implement ObjList::find()? I think you may want to have an extra index above the existing object list instead, but I'm not sure how to maintain this index.
The sort for objList in
husky/core/objlist.hpp
Lines 77 to 95 in 7ec82aa
now sorts with the obj.id()
Is it feasible to allow a lambda arg so a user can say sort by obj attribute?
Also, std::sort is called twice in the current implementation.
If reorder is implemented for objList and
reorder does not destroy the input permutation list (right now I think it was changed to all -1 after the call)
then we can reuse the permutation list to arrange the objList and avoid calling std::sort twice.
Would such change be feasible?
The text was updated successfully, but these errors were encountered: