39 static T
sum(
const std::vector<T>& v) {
41 for (
typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); i++) {
48 if (msum == 0 || v.size() == 0) {
54 set(v, (T) 1.0 * msum / (T) v.size());
60 static void div(std::vector<T>& v, T by) {
61 for (
typename std::vector<T>::iterator i = v.begin(); i != v.end(); i++) {
67 typename std::vector<T>::iterator i = v.begin();
68 while (i != v.end()) {
69 for (
typename std::vector<T>::iterator j = i + 1; j != v.end();) {
81 static void set(std::vector<T>& v, T to) {
82 for (
typename std::vector<T>::iterator i = v.begin(); i != v.end(); i++) {
88 T m = -std::numeric_limits<T>::max();
89 for (
typename std::vector<T>::const_iterator j = v.begin() ; j != v.end(); j++) {
98 T m = std::numeric_limits<T>::max();
99 for (
typename std::vector<T>::const_iterator j = v.begin(); j != v.end(); j++) {
108 for (
typename std::vector<T>::iterator j = v.begin(); j != v.end();) {
118 for (
typename std::vector<T>::iterator j = v.begin(); j != v.end();) {
127 static void add2All(std::vector<T>& v, T what) {
128 for (
typename std::vector<T>::iterator j = v.begin(); j != v.end(); j++) {
134 static bool subSetExists(
const std::vector<T>& v1,
const std::vector<T>& v2) {
135 for (
typename std::vector<T>::const_iterator i = v1.begin(); i != v1.end(); i++) {
137 if (find(v2.begin(), v2.end(), val1) != v2.end()) {
149std::ostream&
operator<<(std::ostream& os,
const std::vector<T>& v) {
150 for (
typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); i++) {
151 if (i != v.begin()) {
std::ostream & operator<<(std::ostream &os, const std::vector< T > &v)
static void div(std::vector< T > &v, T by)
static T maxValue(const std::vector< T > &v)
static void remove_larger_than(std::vector< T > &v, T swell)
static bool subSetExists(const std::vector< T > &v1, const std::vector< T > &v2)
Returns the information whether at least one element is within both vectors.
static void set(std::vector< T > &v, T to)
static void normaliseSum(std::vector< T > &v, T msum=1.0)
static void remove_smaller_than(std::vector< T > &v, T swell)
static void removeDouble(std::vector< T > &v)
static T minValue(const std::vector< T > &v)
static T sum(const std::vector< T > &v)
static void add2All(std::vector< T > &v, T what)