| 144 | }; |
| 145 | |
| 146 | template <typename T> void |
| 147 | PointSet::sort_field(T* lst) const |
| 148 | { |
| 149 | if (m_sort_table.empty()) |
| 150 | { |
| 151 | std::cerr << "WARNING: No sort table was generated for the current point set. " |
| 152 | << "First invoke the method 'z_sort' of the class 'NeighborhoodSearch.'" << std::endl; |
| 153 | return; |
| 154 | } |
| 155 | |
| 156 | std::vector<T> tmp(lst, lst + m_sort_table.size()); |
| 157 | std::transform(m_sort_table.begin(), m_sort_table.end(), |
| 158 | #ifdef _MSC_VER |
| 159 | stdext::unchecked_array_iterator<T*>(lst), |
| 160 | #else |
| 161 | lst, |
| 162 | #endif |
| 163 | [&](int i){ return tmp[i]; }); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | #endif // __POINT_SET_H__ |