Rosetta  2018.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Functions
vector1.functions.hh File Reference

some useful functions for vector1 that I'm tired of rewriting More...

#include <utility/vector1.hh>

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 >
utility::max (vector1< T > const &input)
 Find the largest value in a vector. More...
 
template<class 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...
 

Detailed Description

some useful functions for vector1 that I'm tired of rewriting

Author
Andrew Leaver-Fay ( aleav.nosp@m.erfa.nosp@m.y@gma.nosp@m.il.c.nosp@m.om )