22 #include <platform/types.hh>
57 if ( source_id >
src_2_dst_.size() || source_id == 0 ) {
59 "recieved an out-of-bounds source id (" +
to_string( source_id ) +
") "
64 "recieved an already-mapped source id (" +
to_string( source_id ) +
") "
65 "which had been previously assigned to destination id " +
to_string(
src_2_dst_[ source_id ] ) );
void set_source_size(platform::Size)
Required before the first call to set_next_correspondence may be called. The size of the source enume...
virtual ~subset_mapping()
platform::Size s2d(platform::Size source_id) const
Map from the id of an element in source enumeration to an id in the the destination enumeration...
subset_mapping & operator=(subset_mapping const &rhs)
platform::Size d2s(platform::Size destination_id) const
Map from the id of an element in the destination enumeration to an id in the source enumeration...
void reserve_destination_size(platform::Size)
If you know the size of the destination enumeration, then you can save some under-the-hood vector res...
bool source_id_is_mapped(platform::Size source_id) const
platform::Size source_size() const
The number of elements in the source enumeration.
void set_next_correspondence(platform::Size source_id)
Inform the mapping of the next source-enumeration id that should be mapped to a destination-enumerati...
static platform::Size const UNMAPPED
common derived classes for thrown exceptions
utility::vector1< platform::Size > dst_2_src_
platform::Size destination_size() const
The number of elements in the destination enumeration – this represents the number of calls that hav...
utility::vector1< platform::Size > src_2_dst_
A set of useful classes to map between two enumerations. So far, only a subset mapping is implemented...
std::string to_string(const T &t)
Some std::string helper functions.
This class handles the bookeeping to map between a set of integer ids in the "source" enumeration to ...