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

colvar_grid_count Class Reference

\brief Colvar_grid derived class to hold counters in discrete n-dim colvar space. More...

#include <colvargrid.h>

Inheritance diagram for colvar_grid_count:

colvar_grid< size_t > colvarparse colvarparams List of all members.

Public Methods

 colvar_grid_count ()
 Default constructor. More...

virtual ~colvar_grid_count ()
 Destructor. More...

 colvar_grid_count (std::vector< int > const &nx_i, size_t const &def_count=0)
 Constructor. More...

 colvar_grid_count (std::vector< colvar * > &colvars, size_t const &def_count=0, bool add_extra_bin=false)
 Constructor from a vector of colvars. More...

void incr_count (std::vector< int > const &ix)
 Increment the counter at given position. More...

size_t const & new_count (std::vector< int > const &ix, size_t const &imult=0)
 \brief Get the binned count indexed by ix from the newly read data. More...

std::istream & read_multicol (std::istream &is, bool add=false)
 Read a grid written by write_multicol(), incrementin if data is true. More...

int read_multicol (std::string const &filename, std::string description="grid file", bool add=false)
 Read a grid written by write_multicol(), incrementin if data is true. More...

std::ostream & write_multicol (std::ostream &os) const
 Write grid in a format which is both human-readable and gnuplot-friendly. More...

int write_multicol (std::string const &filename, std::string description="grid file") const
 Write grid in a format which is both human-readable and gnuplot-friendly. More...

std::ostream & write_opendx (std::ostream &os) const
 Write the grid data without labels, as they are represented in memory. More...

int write_opendx (std::string const &filename, std::string description="grid file") const
 Write the grid data without labels, as they are represented in memory. More...

virtual void value_input (std::vector< int > const &ix, size_t const &t, size_t const &imult=0, bool add=false)
 Enter or add a value, but also handle parent grid. More...

cvm::real log_gradient_finite_diff (const std::vector< int > &ix0, int n=0)
 \brief Return the log-gradient from finite differences on the *same* grid for dimension n. More...

cvm::real gradient_finite_diff (const std::vector< int > &ix0, int n=0)
 \brief Return the gradient of discrete count from finite differences on the *same* grid for dimension n. More...


Detailed Description

\brief Colvar_grid derived class to hold counters in discrete n-dim colvar space.

Definition at line 1058 of file colvargrid.h.


Constructor & Destructor Documentation

colvar_grid_count::colvar_grid_count  
 

Default constructor.

Definition at line 23 of file colvargrid.C.

References colvar_grid< size_t >::mult.

virtual colvar_grid_count::~colvar_grid_count   [inline, virtual]
 

Destructor.

Definition at line 1066 of file colvargrid.h.

colvar_grid_count::colvar_grid_count std::vector< int > const &    nx_i,
size_t const &    def_count = 0
 

Constructor.

Definition at line 29 of file colvargrid.C.

colvar_grid_count::colvar_grid_count std::vector< colvar * > &    colvars,
size_t const &    def_count = 0,
bool    add_extra_bin = false
 

Constructor from a vector of colvars.

Definition at line 34 of file colvargrid.C.


Member Function Documentation

cvm::real colvar_grid_count::gradient_finite_diff const std::vector< int > &    ix0,
int    n = 0
[inline]
 

\brief Return the gradient of discrete count from finite differences on the *same* grid for dimension n.

Definition at line 1183 of file colvargrid.h.

References n, colvar_grid< size_t >::nx, colvar_grid< size_t >::periodic, colvar_grid< size_t >::value, colvar_grid< size_t >::widths, and colvar_grid< size_t >::wrap.

void colvar_grid_count::incr_count std::vector< int > const &    ix [inline]
 

Increment the counter at given position.

Definition at line 1079 of file colvargrid.h.

References colvar_grid< size_t >::address, and colvar_grid< size_t >::data.

Referenced by colvar_grid_gradient::acc_force, colvar_grid_gradient::acc_value, and colvar_grid_scalar::acc_value.

cvm::real colvar_grid_count::log_gradient_finite_diff const std::vector< int > &    ix0,
int    n = 0
[inline]
 

\brief Return the log-gradient from finite differences on the *same* grid for dimension n.

Definition at line 1134 of file colvargrid.h.

References colvarmodule::logn, n, colvar_grid< size_t >::nx, colvar_grid< size_t >::periodic, colvar_grid< size_t >::value, colvar_grid< size_t >::widths, and colvar_grid< size_t >::wrap.

size_t const& colvar_grid_count::new_count std::vector< int > const &    ix,
size_t const &    imult = 0
[inline]
 

\brief Get the binned count indexed by ix from the newly read data.

Definition at line 1085 of file colvargrid.h.

References colvar_grid< size_t >::address, and colvar_grid< size_t >::new_data.

Referenced by colvar_grid_gradient::value_input, and colvar_grid_scalar::value_input.

int colvar_grid_count::read_multicol std::string const &    filename,
std::string    description = "grid file",
bool    add = false
 

Read a grid written by write_multicol(), incrementin if data is true.

Reimplemented from colvar_grid< size_t >.

Definition at line 45 of file colvargrid.C.

References colvar_grid::read_multicol.

std::istream & colvar_grid_count::read_multicol std::istream &    is,
bool    add = false
 

Read a grid written by write_multicol(), incrementin if data is true.

Reimplemented from colvar_grid< size_t >.

Definition at line 40 of file colvargrid.C.

References colvar_grid::read_multicol.

virtual void colvar_grid_count::value_input std::vector< int > const &    ix,
size_t const &    t,
size_t const &    imult = 0,
bool    add = false
[inline, virtual]
 

Enter or add a value, but also handle parent grid.

Reimplemented from colvar_grid< size_t >.

Definition at line 1114 of file colvargrid.h.

References colvar_grid< size_t >::address, colvar_grid< size_t >::data, colvar_grid< size_t >::has_data, colvar_grid< size_t >::has_parent_data, and colvar_grid< size_t >::new_data.

int colvar_grid_count::write_multicol std::string const &    filename,
std::string    description = "grid file"
const
 

Write grid in a format which is both human-readable and gnuplot-friendly.

Reimplemented from colvar_grid< size_t >.

Definition at line 57 of file colvargrid.C.

References colvar_grid::write_multicol.

std::ostream & colvar_grid_count::write_multicol std::ostream &    os const
 

Write grid in a format which is both human-readable and gnuplot-friendly.

Reimplemented from colvar_grid< size_t >.

Definition at line 52 of file colvargrid.C.

References colvar_grid::write_multicol.

Referenced by colvarbias_ti::write_output_files.

int colvar_grid_count::write_opendx std::string const &    filename,
std::string    description = "grid file"
const
 

Write the grid data without labels, as they are represented in memory.

Reimplemented from colvar_grid< size_t >.

Definition at line 68 of file colvargrid.C.

References colvar_grid::write_opendx.

std::ostream & colvar_grid_count::write_opendx std::ostream &    os const
 

Write the grid data without labels, as they are represented in memory.

Reimplemented from colvar_grid< size_t >.

Definition at line 63 of file colvargrid.C.

References colvar_grid::write_opendx.


The documentation for this class was generated from the following files:
Generated on Thu Dec 5 02:44:34 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002