|
bool | is_nan (double x) |
| Checks whether a number is a nan. More...
|
|
vector< double > | linspace (double xl, double xh, int n) |
| Uniformly spaced array (like the matlab function with the same name) More...
|
|
vector< double > | arange (double x_min, double x_max, double dx) |
| Uniformly spaced array (line numpy function with the same name) More...
|
|
template<class T > |
vector< T > | operator+ (vector< T > const &v1, vector< T > const &v2) |
| Term by term addition for vectors. More...
|
|
template<class T > |
vector< T > | operator+ (const vector< T > &v, const T &t) |
| Adds the same thing to all terms in a vector. More...
|
|
template<class T > |
vector< T > | operator+ (const T &t, const vector< T > &v) |
| Adds the same thing to all terms in a vector. More...
|
|
template<class T > |
vector< T > & | operator+= (vector< T > &v, const T &t) |
| Adds the same thing to all terms in a vector. More...
|
|
template<class T > |
vector< T > | operator- (vector< T > const &v1, vector< T > const &v2) |
| Term by term vector subtraction. More...
|
|
template<class T > |
vector< T > | operator* (double d, vector< T > const &v) |
| Multiplies all terms of a vector by a scalar. More...
|
|
template<typename T > |
T | BiLinearInterpolation (const vector< T > &x, const vector< T > &y, const std::vector< std::vector< T > > &z, T xi, T yi) |
| BiLinear Interpolation. More...
|
|
template<typename T > |
T | LinearInterpolation (const vector< T > &x, const vector< T > &y, T xi) |
| Linear Interpolation. More...
|
|
template<typename T > |
T | LinearInterpolation (typename vector< T >::const_iterator itx_begin, typename vector< T >::const_iterator itx_end, typename vector< T >::const_iterator ity_begin, T xi) |
| Linear Interpolation. More...
|
|
double | min (vector< double > const &v) |
| Returns the minimal term in a vector. More...
|
|
double | max (vector< double > const &v) |
| returns the maximal term in a vector More...
|
|
template<class T > |
void | RemoveVector (vector< T > &v, vector< int > &indeces) |
| Removes the elements in v given by indeces. More...
|
|
template<class T > |
void | RemoveVector (vector< T > &v, vector< size_t > &indeces) |
| Removes the elements in v given by indeces. More...
|
|
template<class T > |
vector< T > | VectorValues (vector< T > const &v, vector< int > const &index) |
| Returns only the values with indeces in index. More...
|
|
template<class T > |
vector< T > | VectorValues (vector< T > const &v, vector< size_t > const &index) |
| Returns only the values with indeces in index. More...
|
|
template<class T > |
T | VectorSum (vector< T > const &v) |
| Returns the sum of the vector. More...
|
|
template<class T > |
vector< T > | unique (vector< T > const &v) |
| Returns a vector containing only unique elements. More...
|
|
template<class T > |
vector< int > | unique_index (vector< T > const &v) |
| Returns a vector containing only indeces of unique elements. More...
|
|
template<class T > |
vector< T > | RemoveList (vector< T > const &v, vector< T > const &list) |
| Returns only elements from vector v which are not in vector list, assumes list is sorted. More...
|
|
template<class T > |
void | RemoveVal (vector< T > &vec, T val) |
| Removes the first occurence of val inside a vector. More...
|
|
template<class T > |
bool | InVector (vector< T > const &vec, T val) |
| checks if val is in the vector More...
|
|
template<class T > |
int | IndexInVector (vector< T > const &vec, T val) |
| Returns the index of val in the vector. More...
|
|
template<class T > |
void | ReArrangeVector (vector< T > &v, vector< int > const &indeces) |
| Rearranges the vector according to the indeces. More...
|
|
template<class T > |
void | sort_index (const vector< T > &arr, vector< int > &res) |
| Returns the indeces of a sort. More...
|
|
template<class T > |
void | sort_index (const vector< T > &arr, vector< size_t > &res) |
| Returns the indeces of a sort. More...
|
|
template<class T > |
vector< size_t > | sort_index (const vector< T > &arr) |
| Returns the indeces of a sort. More...
|
|
template<class RAIter , class Compare > |
void | sort_index (RAIter iterBegin, RAIter iterEnd, Compare comp, std::vector< size_t > &indexes) |
| Returns the indeces of a sort. More...
|
|
template<class T > |
vector< T > | join (vector< T > const &v1, vector< T > const &v2) |
| Concatenates two vectors. More...
|
|
template<class T > |
vector< T > | binary_unite (vector< T > const &v1, vector< T > const &v2, BinaryOperation< T > const &bin_op) |
| Applies a binary operation on every pair of values from two vectors. More...
|
|
template<class T > |
vector< T > | apply_to_each_term (vector< T > const &v, UnaryOperation< T > const &un_op) |
| Applies an unary operator to all terms in a std::vector. More...
|
|
template<class T > |
T | pair_member (const std::pair< T, T > &p, int index) |
| Selects a member of std::pair. More...
|
|
template<class T > |
void | set_pair_member (std::pair< T, T > &p, int index, const T &val) |
| Sets a member of std::pair. More...
|
|
template<class T , class S > |
vector< T > | list_static_cast (const vector< S > &source) |
| Performs type casting for an entire vector. More...
|
|
template<class T > |
void | insert_all_to_back (vector< T > &subject, const vector< T > &addendum) |
| Inserts all elements from one vector to the end of another. More...
|
|
template<class Iter , class T > |
Iter | binary_find (Iter begin, Iter end, T val) |
| Binary search that return iterator of found object or end if not found. More...
|
|
template<class S , class T > |
vector< T >::const_reference | safe_retrieve (vector< T > const &data, vector< S > const &keys, const S &key) |
| Checks for existence and retrieves entry from flat map. More...
|
|
template<class S , class T > |
vector< T >::reference | safe_retrieve (vector< T > &data, vector< S > const &keys, const S &key) |
| Checks for existence and retrieves entry from flat map. More...
|
|
template<class S , class T > |
const T & | safe_retrieve (const boost::container::flat_map< S, T > &m, const S &s) |
| Checks for existence and retrieves entry from flat map. More...
|
|
template<class T > |
vector< vector< T > > | CombineVectors (vector< vector< vector< T > > > const &data) |
| Reduces the dimension of the input vector. More...
|
|
template<class T > |
vector< T > | CombineVectors (vector< vector< T > > const &data) |
| Reduces the dimension of the input vector. More...
|
|
template<class S , class T > |
T & | safe_retrieve (boost::container::flat_map< S, T > &m, const S &s) |
| Non constant version of safe retrieve. More...
|
|
double | fastsqrt (double x) |
| Fast approximate sqrt. More...
|
|
Various useful functions.
- Author
- Almog Yalinewich
Definition in file utils.hpp.