OpenMS
2.4.0
|
Collection of utility functions for management of vectors. More...
#include <OpenMS/DATASTRUCTURES/ListUtils.h>
Classes | |
struct | DoubleTolerancePredicate_ |
Predicate to check double equality with a given tolerance. More... | |
Public Member Functions | |
template<> | |
std::vector< String > | create (const std::vector< String > &s) |
create specialization for String since we do not need to cast here More... | |
Static Public Member Functions | |
template<typename T > | |
static std::vector< T > | create (const String &str, const char splitter=',') |
Returns a list that is created by splitting the given comma-separated string. More... | |
template<typename T > | |
static std::vector< T > | create (const std::vector< String > &s) |
Converts a vector of strings to a vector of the target type T. More... | |
template<typename T , typename E > | |
static bool | contains (const std::vector< T > &container, const E &elem) |
Checks whether the element elem is contained in the given container. More... | |
static bool | contains (const std::vector< double > &container, const double &elem, double tolerance=0.00001) |
Checks whether the element elem is contained in the given container of floating point numbers. More... | |
template<typename T > | |
static String | concatenate (const std::vector< T > &container, const String &glue="") |
Concatenates all elements of the container and puts the glue string between elements. More... | |
template<typename T > | |
static String | concatenate (const T &container, const String &glue="") |
Concatenates all elements of the container and puts the glue string between elements. More... | |
template<typename T , typename E > | |
static Int | getIndex (const std::vector< T > &container, const E &elem) |
Get the index of the first occurrence of an element in the vector (or -1 if not found) More... | |
Collection of utility functions for management of vectors.
|
inlinestatic |
Concatenates all elements of the container
and puts the glue
string between elements.
container | The container to concatenate; |
glue | The string to add in between elements. |
Referenced by RNPxlSearch::postProcessHits_().
Concatenates all elements of the container
and puts the glue
string between elements.
container | The container <T> to concatenate; must have begin() and end() iterator. |
glue | The string to add in between elements. |
|
inlinestatic |
Checks whether the element elem
is contained in the given container.
container | The container to check. |
elem | The element to check whether it is in the container or not. |
elem
is contained in container
, false otherwise. References seqan::find().
Referenced by HasActivationMethod< SpectrumType >::operator()().
|
inlinestatic |
Checks whether the element elem
is contained in the given container of floating point numbers.
container | The container of doubles to check. |
elem | The element to check whether it is in the container or not. |
tolerance | The allowed tolerance for the double. |
elem
is contained in container
, false otherwise.
|
inlinestatic |
Returns a list that is created by splitting the given comma-separated string.
str | The string that should be split and converted to a list. |
References String::split().
|
inlinestatic |
Converts a vector of strings to a vector of the target type T.
s | The vector of strings that should be converted. |
References OpenMS::Constants::c.
create specialization for String since we do not need to cast here
|
inlinestatic |
Get the index of the first occurrence of an element in the vector (or -1 if not found)
References seqan::find().