11#ifndef COLVARMODULE_UTILS_H
12#define COLVARMODULE_UTILS_H
32template <
typename T,
int flag,
bool get_index>
33cvm::real compute_norm2_stats(std::vector<T>
const &v,
34 int *minmax_index = NULL)
42 typename std::vector<T>::const_iterator xi = v.begin();
45 if (get_index) *minmax_index = -1;
47 for ( ; xi != v.end(); xi++, i++) {
48 cvm::real const norm2 = get_force_norm2<T>(*xi);
55 if (get_index) *minmax_index = i;
61 if (get_index) *minmax_index = i;
66 size_t const n = v.size();
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
static real sqrt(real const &x)
Reimplemented to work around MS compiler issues.
Definition: colvarmodule.h:133
Collective variables main module.