![]() |
Rosetta
2019.12
|
some useful functions for vector1 that I'm tired of rewriting More...
Namespaces | |
utility | |
unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0. | |
Functions | |
template<class T > | |
void | utility::nmers_worker (utility::vector1< T > const &vec, utility::vector1< T > &combination, utility::vector1< utility::vector1< T > > &power_sets, int const offset, int const kk, int const kk_orig) |
Function invoked by nmers_of (and itself) to generate the power sets of a vector of size kk_orig. More... | |
template<class T > | |
utility::vector1 < utility::vector1< T > > | utility::nmers_of (utility::vector1< T > const &vec, int const kk) |
Returns all vector of kk-mer vectors made from combinations of the elements of vec. Returns a vector containing only the empty vector if 0-mers are requested (rather than a zero length vector). More... | |
template<class T > | |
T | utility::max (vector1< T > const &input) |
Find the largest value in a vector. More... | |
template<class T > | |
T | utility::min (vector1< T > const &input) |
Find the smallest value in a vector. More... | |
template<class T > | |
vector1< T >::Size | utility::arg_max (vector1< T > const &input) |
find the index of the largest value in a vector More... | |
template<class T > | |
vector1< T >::Size | utility::arg_min (vector1< T > const &input) |
find the index of the smallest value in a vector More... | |
template<class T > | |
void | utility::insert_middle (vector1< T > &vect, typename vector1< T >::Size const position, T const new_value, bool expand) |
template<class T > | |
void | utility::arg_greatest_several (vector1< T > const &input, vector1< typename vector1< T >::Size > &arg_list) |
Finds indices of the n largest items in input vector, where n is size of the arg_list vector. The indices are reported in decreasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2) More... | |
template<class T > | |
void | utility::arg_least_several (vector1< T > const &input, vector1< typename vector1< T >::Size > &arg_list) |
Finds indices of the n smallest items in input vector, where n is size of the arg_list vector. The indices are reported in increasing sorted order by the value of the corresponding position in the input vector. If m is the size of the input vector, then this function is O( m n**2) More... | |
template<typename T > | |
platform::Size | utility::binary_search_ranges (utility::vector1< T > const &range_array, T query) |
Find the index into the input range array such that range_array[ index ] <= query < range_array[ index + 1 ] or if index+1 would be off the end of the array, then simply the last index in the array (for which range_array[ index ] <= query holds). Each entry in range_array represents the lower boundry (inclusive) for a range, so that range i is defined by ( range_array[ i ], range_array[i+1] - 1 ) except for the last range, which is from range_array[ range_array.size() ] to infinity. T must be a discrete type. range_array must be sorted. range_array[ 1 ] must be as small as the smallest possible query. More... | |
template<platform::SSize L, typename T > | |
bool | utility::is_finite (utility::vectorL< L, T > const &vect) |
Are any of the values contained in the vector non-finite (NaN, inf) More... | |
some useful functions for vector1 that I'm tired of rewriting