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

colvarvalue.h File Reference

#include "colvarmodule.h"
#include "colvartypes.h"

Go to the source code of this file.

Compounds

class  colvarvalue
 \brief Value of a collective variable: this is a metatype which can be set at runtime. By default it is set to be a scalar number, and can be treated as such in all operations (this is done by most colvar::cvc implementations). colvarvalue allows colvar to be treat different data types. By default, a colvarvalue variable is a scalar number. To use it as another type, declare and initialize it as `colvarvalue x(colvarvalue::type_xxx)`, use `x.type (colvarvalue::type_xxx)` at a later stage, or if unset, assign the type with `x = y;`, provided y is correctly set. All operators (either unary or binary) on a colvarvalue object performs one or more checks on the Type, except when reading from a stream, when there is no way to detect the Type. To use `is >> x;` x MUST already have a type correcly set up for properly parsing the stream. No problem of course with the output streams: `os << x;` Note on performance: to avoid type checks in a long array of colvarvalue objects, use one of the existing "_opt" functions or implement a new one. More...


Generated on Thu Mar 28 02:44:33 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002