#include "BCP_vector.hpp"
Include dependency graph for BCP_vector_sanity.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | BCP_vec_sanity_check (BCP_vec< int >::const_iterator firstpos, BCP_vec< int >::const_iterator lastpos, const int maxsize) |
A helper function to test whether a set positions is sane for a vector. |
void BCP_vec_sanity_check | ( | BCP_vec< int >::const_iterator | firstpos, | |
BCP_vec< int >::const_iterator | lastpos, | |||
const int | maxsize | |||
) |
A helper function to test whether a set positions is sane for a vector.
The set of positions consists of the entries in [firstpos,lastpos)
. The length of the vector is maxsize
.
The set of positions is defined to be sane if and only if the entries are in increasing order, there are no duplicate entries, no negative entries and the largest entry is smaller than maxsize
.
If the sanity check fails the function throws a [BCP_fatal_error
]{BCP_fatal_error.html} exception.
Referenced by BCP_vec< T >::erase_by_index(), BCP_vec< T >::keep_by_index(), BCP_vec< int >::update(), BCP_vec< double >::update(), BCP_vec< char >::update(), and BCP_vec< T >::update().