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

colvarparams Class Reference

\file colvarparams.h Functions to handle scalar parameters used in objects. More...

#include <colvarparams.h>

Inheritance diagram for colvarparams:

colvarparse colvar colvar::cvc colvar_grid colvar_grid< cvm::real > colvar_grid< size_t > colvarbias colvarbias_restraint_moving colvarmodule::atom_group List of all members.

Public Methods

int param_exists (std::string const &param_name)
 Whether the parameter param_name exists. More...

virtual std::vector< std::stringget_param_names ()
 Get a copy of the names of registered parameters. More...

virtual std::vector< std::stringget_param_grad_names ()
 Get a copy of the names of registered parameter gradients. More...

virtual void const * get_param_ptr (std::string const &param_name)
 Pointer to the parameter param_name. More...

virtual void const * get_param_grad_ptr (std::string const &param_name)
 Pointer to the gradient of parameter param_name. More...

virtual cvm::real get_param (std::string const &param_name)
 Value of the parameter param_name (must be a scalar). More...

virtual int set_param (std::string const &param_name, void const *new_value)
 Set the named parameter to the given value. More...


Protected Methods

 colvarparams ()
 Default constructor. More...

virtual ~colvarparams ()
 Default destructor. More...

void register_param (std::string const &param_name, void *param_ptr)
 Register the given parameter. More...

void register_param_grad (std::string const &param_name, colvarvalue *param_grad_ptr)
 Register the gradient of the given parameter. More...


Protected Attributes

std::map< std::string, void
const * > 
param_map
 Pointers to relevant parameters that may be accessed by other objects. More...

std::map< std::string, colvarvalue
const * > 
param_grad_map
 Derivatives of the object with respect to internal parameters. More...


Detailed Description

\file colvarparams.h Functions to handle scalar parameters used in objects.

Definition at line 18 of file colvarparams.h.


Constructor & Destructor Documentation

colvarparams::colvarparams   [protected]
 

Default constructor.

Definition at line 20 of file colvarparams.C.

colvarparams::~colvarparams   [protected, virtual]
 

Default destructor.

Definition at line 24 of file colvarparams.C.


Member Function Documentation

cvm::real colvarparams::get_param std::string const &    param_name [virtual]
 

Value of the parameter param_name (must be a scalar).

Definition at line 94 of file colvarparams.C.

References get_param_ptr, and NULL.

std::vector< std::string > colvarparams::get_param_grad_names   [virtual]
 

Get a copy of the names of registered parameter gradients.

Definition at line 62 of file colvarparams.C.

References param_grad_map, and result.

void const * colvarparams::get_param_grad_ptr std::string const &    param_name [virtual]
 

Pointer to the gradient of parameter param_name.

Definition at line 83 of file colvarparams.C.

References COLVARS_INPUT_ERROR, colvarmodule::error, NULL, and param_grad_map.

Referenced by colvar::cvc::get_param_grad.

std::vector< std::string > colvarparams::get_param_names   [virtual]
 

Get a copy of the names of registered parameters.

Definition at line 51 of file colvarparams.C.

References param_map, and result.

void const * colvarparams::get_param_ptr std::string const &    param_name [virtual]
 

Pointer to the parameter param_name.

Definition at line 73 of file colvarparams.C.

References COLVARS_INPUT_ERROR, colvarmodule::error, NULL, and param_map.

Referenced by get_param.

int colvarparams::param_exists std::string const &    param_name
 

Whether the parameter param_name exists.

Definition at line 42 of file colvarparams.C.

References COLVARS_INPUT_ERROR, and param_map.

void colvarparams::register_param std::string const &    param_name,
void *    param_ptr
[protected]
 

Register the given parameter.

Definition at line 28 of file colvarparams.C.

References param_map.

Referenced by colvar::map_total::init, colvar::cvc::init, colvar::cvc::init_as_distance, and colvar::cvc::init_scalar_boundaries.

void colvarparams::register_param_grad std::string const &    param_name,
colvarvalue   param_grad_ptr
[protected]
 

Register the gradient of the given parameter.

Definition at line 35 of file colvarparams.C.

References param_grad_map.

int colvarparams::set_param std::string const &    param_name,
void const *    new_value
[virtual]
 

Set the named parameter to the given value.

Reimplemented in colvar::cvc.

Definition at line 102 of file colvarparams.C.

References COLVARS_INPUT_ERROR, COLVARS_NOT_IMPLEMENTED, colvarmodule::error, and param_map.

Referenced by colvar::cvc::set_param.


Member Data Documentation

std::map<std::string, colvarvalue const *> colvarparams::param_grad_map [protected]
 

Derivatives of the object with respect to internal parameters.

Definition at line 55 of file colvarparams.h.

Referenced by get_param_grad_names, get_param_grad_ptr, and register_param_grad.

std::map<std::string, void const *> colvarparams::param_map [protected]
 

Pointers to relevant parameters that may be accessed by other objects.

Definition at line 52 of file colvarparams.h.

Referenced by get_param_names, get_param_ptr, param_exists, register_param, set_param, and colvar::cvc::set_param.


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