Clipper
Classes | Static Public Member Functions | List of all members
clipper::Map_index_sort Class Reference

Generic map sorting class. More...

#include <map_utils.h>

Static Public Member Functions

template<class M >
static void sort_increasing (const M &map, std::vector< int > &index)
 Sort a list into increasing order. More...
 
template<class M >
static void sort_decreasing (const M &map, std::vector< int > &index)
 Sort a list into decreasing order. More...
 

Detailed Description

Generic map sorting class.

This class is used to sort a vector of integer indices into a map. This includes sorting the whole map to get highest or lowest density first, or sorting some subset, e.g. a list of peak indices. Integer indices are used because they are the most compact way of referencing a unique map location. e.g.

std::vector<int> index;
for ( ix = xmap.first(); !ix.last(); ix.next() )
index.push_back( ix.index() );

Member Function Documentation

◆ sort_increasing()

template<class M >
template void clipper::Map_index_sort::sort_increasing< Xmap< unsigned int > > ( const M &  map,
std::vector< int > &  index 
)
static

Sort a list into increasing order.

The index is sorted in place \params map The map to be sorted. \params index The list of indices to sort.

◆ sort_decreasing()

template<class M >
template void clipper::Map_index_sort::sort_decreasing< Xmap< unsigned int > > ( const M &  map,
std::vector< int > &  index 
)
static

Sort a list into decreasing order.

The index is sorted in place \params map The map to be sorted. \params index The list of indices to sort.


The documentation for this class was generated from the following files:
clipper::Map_index_sort::sort_decreasing
static void sort_decreasing(const M &map, std::vector< int > &index)
Sort a list into decreasing order.
Definition: map_utils.cpp:66
clipper::Xmap_base::Map_reference_index
Map reference with index-like behaviour.
Definition: xmap.h:191
clipper::Xmap_base::Map_reference_index::next
Map_reference_index & next()
Simple increment.
Definition: xmap.h:210