Collective Variables Module - Developer Documentation
|
Arbitrary size array (one dimensions) suitable for linear algebra operations (i.e. for floating point numbers it can be used with library functions) More...
#include <colvartypes.h>
Public Member Functions | |
vector1d (size_t const n=0) | |
Default constructor. | |
vector1d (size_t const n, T const *t) | |
Constructor from C array. | |
vector1d (const vector1d &)=default | |
Explicit Copy constructor. | |
vector1d & | operator= (const vector1d &)=default |
Explicit Copy assignement. | |
T * | c_array () |
Return a pointer to the data location. | |
std::vector< T > & | data_array () |
Return a reference to the data. | |
std::vector< T > const & | data_array () const |
Return a reference to the data. | |
void | reset () |
Set all elements to zero. | |
size_t | size () const |
void | resize (size_t const n) |
void | clear () |
T & | operator[] (size_t const i) |
T const & | operator[] (size_t const i) const |
void | operator+= (vector1d< T > const &v) |
void | operator-= (vector1d< T > const &v) |
void | operator*= (cvm::real a) |
void | operator/= (cvm::real a) |
cvm::real | norm2 () const |
Squared norm. | |
cvm::real | norm () const |
cvm::real | sum () const |
vector1d< T > const | slice (size_t const i1, size_t const i2) const |
Slicing. | |
void | sliceassign (size_t const i1, size_t const i2, vector1d< T > const &v) |
Assign a vector to a slice of this vector. | |
size_t | output_width (size_t real_width) const |
Formatted output. | |
std::string | to_simple_string () const |
int | from_simple_string (std::string const &s) |
Static Public Member Functions | |
static void | check_sizes (vector1d< T > const &v1, vector1d< T > const &v2) |
Protected Attributes | |
std::vector< T > | data |
Friends | |
vector1d< T > | operator+ (vector1d< T > const &v1, vector1d< T > const &v2) |
vector1d< T > | operator- (vector1d< T > const &v1, vector1d< T > const &v2) |
vector1d< T > | operator* (vector1d< T > const &v, cvm::real a) |
vector1d< T > | operator* (cvm::real a, vector1d< T > const &v) |
vector1d< T > | operator/ (vector1d< T > const &v, cvm::real a) |
T | operator* (vector1d< T > const &v1, vector1d< T > const &v2) |
Inner product. | |
std::istream & | operator>> (std::istream &is, cvm::vector1d< T > &v) |
std::ostream & | operator<< (std::ostream &os, cvm::vector1d< T > const &v) |
Arbitrary size array (one dimensions) suitable for linear algebra operations (i.e. for floating point numbers it can be used with library functions)
Linear algebra functions and data types used in the collective variables implemented so far