Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

colvarmodule::matrix2d Class Template Reference

\brief Arbitrary size array (two dimensions) suitable for linear algebra operations (i.e. for floating point numbers it can be used with library functions). More...

#include <colvartypes.h>

List of all members.

Public Methods

void resize (size_t const ol, size_t const il)
 Allocation routine, used by all constructors. More...

void clear ()
 Deallocation routine. More...

void reset ()
 Set all elements to zero. More...

size_t size () const
 matrix2d ()
 Default constructor. More...

 matrix2d (size_t const ol, size_t const il)
 matrix2d (matrix2d< T > const &m)
 Copy constructor. More...

 ~matrix2d ()
 Destructor. More...

std::vector< T > & data_array ()
 Return a reference to the data. More...

rowoperator[] (size_t const i)
row const & operator[] (size_t const i) const
matrix2d< T > & operator= (matrix2d< T > const &m)
 Assignment. More...

T ** c_array ()
 Return the 2-d C array. More...

void operator+= (matrix2d< T > const &m)
void operator-= (matrix2d< T > const &m)
void operator *= (cvm::real a)
void operator/= (cvm::real a)
std::string to_simple_string () const
int from_simple_string (std::string const &s)

Static Public Methods

void check_sizes (matrix2d< T > const &m1, matrix2d< T > const &m2)

Public Attributes

size_t outer_length
size_t inner_length

Protected Attributes

std::vector< T > data
std::vector< rowrows
std::vector< T * > pointers

Friends

class row
matrix2d< T > operator+ (matrix2d< T > const &m1, matrix2d< T > const &m2)
matrix2d< T > operator- (matrix2d< T > const &m1, matrix2d< T > const &m2)
matrix2d< T > operator * (matrix2d< T > const &m, cvm::real a)
matrix2d< T > operator * (cvm::real a, matrix2d< T > const &m)
matrix2d< T > operator/ (matrix2d< T > const &m, cvm::real a)
vector1d< T > operator * (vector1d< T > const &v, matrix2d< T > const &m)
 vector-matrix multiplication. More...

std::ostream & operator<< (std::ostream &os, matrix2d< T > const &m)
 Formatted output. More...


Detailed Description

template<class T>
class colvarmodule::matrix2d< T >

\brief Arbitrary size array (two dimensions) suitable for linear algebra operations (i.e. for floating point numbers it can be used with library functions).

Definition at line 357 of file colvartypes.h.


Constructor & Destructor Documentation

template<class T>
colvarmodule::matrix2d< T >::matrix2d   [inline]
 

Default constructor.

Definition at line 462 of file colvartypes.h.

template<class T>
colvarmodule::matrix2d< T >::matrix2d size_t const    ol,
size_t const    il
[inline]
 

Definition at line 468 of file colvartypes.h.

References colvarmodule::reset.

template<class T>
colvarmodule::matrix2d< T >::matrix2d matrix2d< T > const &    m [inline]
 

Copy constructor.

Definition at line 476 of file colvartypes.h.

References data.

template<class T>
colvarmodule::matrix2d< T >::~matrix2d   [inline]
 

Destructor.

Definition at line 486 of file colvartypes.h.


Member Function Documentation

template<class T>
T** colvarmodule::matrix2d< T >::c_array   [inline]
 

Return the 2-d C array.

Definition at line 519 of file colvartypes.h.

References NULL.

template<class T>
void colvarmodule::matrix2d< T >::check_sizes matrix2d< T > const &    m1,
matrix2d< T > const &    m2
[inline, static]
 

Definition at line 527 of file colvartypes.h.

References colvarmodule::error.

template<class T>
void colvarmodule::matrix2d< T >::clear   [inline]
 

Deallocation routine.

Definition at line 445 of file colvartypes.h.

References data.

template<class T>
std::vector<T>& colvarmodule::matrix2d< T >::data_array   [inline]
 

Return a reference to the data.

Definition at line 491 of file colvartypes.h.

References data.

template<class T>
int colvarmodule::matrix2d< T >::from_simple_string std::string const &    s [inline]
 

Definition at line 686 of file colvartypes.h.

References COLVARS_ERROR, and data.

template<class T>
void colvarmodule::matrix2d< T >::operator *= cvm::real    a [inline]
 

Definition at line 558 of file colvartypes.h.

References data.

template<class T>
void colvarmodule::matrix2d< T >::operator+= matrix2d< T > const &    m [inline]
 

Definition at line 540 of file colvartypes.h.

References data.

template<class T>
void colvarmodule::matrix2d< T >::operator-= matrix2d< T > const &    m [inline]
 

Definition at line 549 of file colvartypes.h.

References data.

template<class T>
void colvarmodule::matrix2d< T >::operator/= cvm::real    a [inline]
 

Definition at line 566 of file colvartypes.h.

References data.

template<class T>
matrix2d<T>& colvarmodule::matrix2d< T >::operator= matrix2d< T > const &    m [inline]
 

Assignment.

Definition at line 506 of file colvartypes.h.

References data.

template<class T>
row const& colvarmodule::matrix2d< T >::operator[] size_t const    i const [inline]
 

Definition at line 500 of file colvartypes.h.

template<class T>
row& colvarmodule::matrix2d< T >::operator[] size_t const    i [inline]
 

Definition at line 496 of file colvartypes.h.

template<class T>
void colvarmodule::matrix2d< T >::reset   [inline]
 

Set all elements to zero.

Definition at line 451 of file colvartypes.h.

References data.

template<class T>
void colvarmodule::matrix2d< T >::resize size_t const    ol,
size_t const    il
[inline]
 

Allocation routine, used by all constructors.

Definition at line 402 of file colvartypes.h.

References data.

template<class T>
size_t colvarmodule::matrix2d< T >::size   const [inline]
 

Definition at line 456 of file colvartypes.h.

References data.

template<class T>
std::string colvarmodule::matrix2d< T >::to_simple_string   const [inline]
 

Definition at line 672 of file colvartypes.h.

References data, colvarmodule::size, and string.


Friends And Related Function Documentation

template<class T>
vector1d<T> operator * vector1d< T > const &    v,
matrix2d< T > const &    m
[friend]
 

vector-matrix multiplication.

Definition at line 624 of file colvartypes.h.

template<class T>
matrix2d<T> operator * cvm::real    a,
matrix2d< T > const &    m
[friend]
 

Definition at line 608 of file colvartypes.h.

template<class T>
matrix2d<T> operator * matrix2d< T > const &    m,
cvm::real    a
[friend]
 

Definition at line 598 of file colvartypes.h.

template<class T>
matrix2d<T> operator+ matrix2d< T > const &    m1,
matrix2d< T > const &    m2
[friend]
 

Definition at line 574 of file colvartypes.h.

template<class T>
matrix2d<T> operator- matrix2d< T > const &    m1,
matrix2d< T > const &    m2
[friend]
 

Definition at line 586 of file colvartypes.h.

template<class T>
matrix2d<T> operator/ matrix2d< T > const &    m,
cvm::real    a
[friend]
 

Definition at line 613 of file colvartypes.h.

template<class T>
std::ostream& operator<< std::ostream &    os,
matrix2d< T > const &    m
[friend]
 

Formatted output.

Definition at line 646 of file colvartypes.h.

template<class T>
friend class row [friend]
 

Definition at line 361 of file colvartypes.h.


Member Data Documentation

template<class T>
std::vector<T> colvarmodule::matrix2d::data [protected]
 

Definition at line 395 of file colvartypes.h.

template<class T>
size_t colvarmodule::matrix2d::inner_length
 

Definition at line 363 of file colvartypes.h.

template<class T>
size_t colvarmodule::matrix2d::outer_length
 

Definition at line 362 of file colvartypes.h.

template<class T>
std::vector<T *> colvarmodule::matrix2d::pointers [protected]
 

Definition at line 397 of file colvartypes.h.

template<class T>
std::vector<row> colvarmodule::matrix2d::rows [protected]
 

Definition at line 396 of file colvartypes.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 02:45:29 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002