Collective Variables Module - Developer Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
colvarmodule::vector1d< T > Class Template Reference

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.
 
T * c_array ()
 Return a pointer to the data location.
 
std::vector< T > & data_array ()
 Return a reference to the data.
 
void reset ()
 Set all elements to zero.
 
size_t size () const
 
void resize (size_t const n)
 
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 const &a)
 
void operator/= (cvm::real const &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 const &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 const &a)
 
vector1d< T > operator* (cvm::real const &a, vector1d< T > const &v)
 
vector1d< T > operator/ (vector1d< T > const &v, cvm::real const &a)
 
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)
 

Detailed Description

template<class T>
class colvarmodule::vector1d< T >

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


The documentation for this class was generated from the following files: