Public Member Functions | Private Attributes | List of all members
PLMD::MultiValue Class Reference

#include <MultiValue.h>

Public Member Functions

 MultiValue (const unsigned &, const unsigned &)
 
void resize (const unsigned &, const unsigned &)
 
std::vector< unsigned > & getIndices ()
 
std::vector< unsigned > & getSortIndices ()
 
std::vector< Vector > & getAtomVector ()
 
unsigned getNumberOfValues () const
 Get the number of values in the stash. More...
 
unsigned getNumberOfDerivatives () const
 Get the number of derivatives in the stash. More...
 
void setValue (const unsigned &, const double &)
 Set value numbered. More...
 
void addValue (const unsigned &, const double &)
 Add value numbered. More...
 
void addDerivative (const unsigned &, const unsigned &, const double &)
 Add derivative. More...
 
void addTemporyValue (const double &val)
 Add to the tempory value. More...
 
void addTemporyDerivative (const unsigned &jder, const double &der)
 Add tempory derivatives - this is used for calculating quotients. More...
 
void setDerivative (const unsigned &ival, const unsigned &jder, const double &der)
 Set the value of the derivative. More...
 
double get (const unsigned &) const
 Return the ith value. More...
 
double getDerivative (const unsigned &, const unsigned &) const
 Return a derivative value. More...
 
double getTemporyDerivative (const unsigned &jder) const
 Get one of the tempory derivatives. More...
 
void clearAll ()
 Clear all values. More...
 
void clearTemporyDerivatives ()
 Clear the tempory derivatives. More...
 
void clear (const unsigned &)
 Clear a value. More...
 
bool updateComplete ()
 Functions for accessing active list. More...
 
void emptyActiveMembers ()
 
void putIndexInActiveArray (const unsigned &)
 
void updateIndex (const unsigned &)
 
void sortActiveList ()
 
void completeUpdate ()
 
void updateDynamicList ()
 
bool isActive (const unsigned &ind) const
 
unsigned getNumberActive () const
 
unsigned getActiveIndex (const unsigned &) const
 
void chainRule (const unsigned &, const unsigned &, const unsigned &, const unsigned &, const double &, const unsigned &, std::vector< double > &buffer)
 Transfer derivatives to buffer. More...
 
void copyValues (MultiValue &) const
 
void copyDerivatives (MultiValue &)
 
void quotientRule (const unsigned &nder, const unsigned &oder)
 

Private Attributes

DynamicList< unsigned > hasDerivatives
 Used to ensure rapid accumulation of derivatives. More...
 
std::vector< double > values
 Values of quantities. More...
 
unsigned nderivatives
 Number of derivatives per value. More...
 
std::vector< double > derivatives
 Derivatives. More...
 
double tmpval
 Tempory value. More...
 
std::vector< double > tmpder
 Tempory vector of derivatives (used for calculating quotients. More...
 
bool atLeastOneSet
 Logical to check if any derivatives were set. More...
 
std::vector< unsigned > indices
 This is a fudge to save on vector resizing in MultiColvar. More...
 
std::vector< unsigned > sort_indices
 
std::vector< Vectortmp_atoms
 

Constructor & Destructor Documentation

◆ MultiValue()

PLMD::MultiValue::MultiValue ( const unsigned &  nvals,
const unsigned &  nder 
)

Member Function Documentation

◆ addDerivative()

void PLMD::MultiValue::addDerivative ( const unsigned &  ival,
const unsigned &  jder,
const double &  der 
)
inline

Add derivative.

◆ addTemporyDerivative()

void PLMD::MultiValue::addTemporyDerivative ( const unsigned &  jder,
const double &  der 
)
inline

Add tempory derivatives - this is used for calculating quotients.

◆ addTemporyValue()

void PLMD::MultiValue::addTemporyValue ( const double &  val)
inline

Add to the tempory value.

◆ addValue()

void PLMD::MultiValue::addValue ( const unsigned &  ival,
const double &  val 
)
inline

Add value numbered.

◆ chainRule()

void PLMD::MultiValue::chainRule ( const unsigned &  ival,
const unsigned &  iout,
const unsigned &  stride,
const unsigned &  off,
const double &  df,
const unsigned &  bufstart,
std::vector< double > &  buffer 
)

Transfer derivatives to buffer.

◆ clear()

void PLMD::MultiValue::clear ( const unsigned &  ival)

Clear a value.

◆ clearAll()

void PLMD::MultiValue::clearAll ( )

Clear all values.

◆ clearTemporyDerivatives()

void PLMD::MultiValue::clearTemporyDerivatives ( )

Clear the tempory derivatives.

◆ completeUpdate()

void PLMD::MultiValue::completeUpdate ( )
inline

◆ copyDerivatives()

void PLMD::MultiValue::copyDerivatives ( MultiValue outvals)

◆ copyValues()

void PLMD::MultiValue::copyValues ( MultiValue outvals) const

◆ emptyActiveMembers()

void PLMD::MultiValue::emptyActiveMembers ( )
inline

◆ get()

double PLMD::MultiValue::get ( const unsigned &  ival) const
inline

Return the ith value.

◆ getActiveIndex()

unsigned PLMD::MultiValue::getActiveIndex ( const unsigned &  ind) const
inline

◆ getAtomVector()

std::vector< Vector > & PLMD::MultiValue::getAtomVector ( )
inline

◆ getDerivative()

double PLMD::MultiValue::getDerivative ( const unsigned &  ival,
const unsigned &  jder 
) const
inline

Return a derivative value.

◆ getIndices()

std::vector< unsigned > & PLMD::MultiValue::getIndices ( )
inline

◆ getNumberActive()

unsigned PLMD::MultiValue::getNumberActive ( ) const
inline

◆ getNumberOfDerivatives()

unsigned PLMD::MultiValue::getNumberOfDerivatives ( ) const
inline

Get the number of derivatives in the stash.

◆ getNumberOfValues()

unsigned PLMD::MultiValue::getNumberOfValues ( ) const
inline

Get the number of values in the stash.

◆ getSortIndices()

std::vector< unsigned > & PLMD::MultiValue::getSortIndices ( )
inline

◆ getTemporyDerivative()

double PLMD::MultiValue::getTemporyDerivative ( const unsigned &  jder) const
inline

Get one of the tempory derivatives.

◆ isActive()

bool PLMD::MultiValue::isActive ( const unsigned &  ind) const
inline

◆ putIndexInActiveArray()

void PLMD::MultiValue::putIndexInActiveArray ( const unsigned &  ind)
inline

◆ quotientRule()

void PLMD::MultiValue::quotientRule ( const unsigned &  nder,
const unsigned &  oder 
)

◆ resize()

void PLMD::MultiValue::resize ( const unsigned &  nvals,
const unsigned &  nder 
)

◆ setDerivative()

void PLMD::MultiValue::setDerivative ( const unsigned &  ival,
const unsigned &  jder,
const double &  der 
)
inline

Set the value of the derivative.

◆ setValue()

void PLMD::MultiValue::setValue ( const unsigned &  ival,
const double &  val 
)
inline

Set value numbered.

◆ sortActiveList()

void PLMD::MultiValue::sortActiveList ( )
inline

◆ updateComplete()

bool PLMD::MultiValue::updateComplete ( )
inline

Functions for accessing active list.

◆ updateDynamicList()

void PLMD::MultiValue::updateDynamicList ( )
inline

◆ updateIndex()

void PLMD::MultiValue::updateIndex ( const unsigned &  ind)
inline

Member Data Documentation

◆ atLeastOneSet

bool PLMD::MultiValue::atLeastOneSet
private

Logical to check if any derivatives were set.

◆ derivatives

std::vector<double> PLMD::MultiValue::derivatives
private

Derivatives.

◆ hasDerivatives

DynamicList<unsigned> PLMD::MultiValue::hasDerivatives
private

Used to ensure rapid accumulation of derivatives.

◆ indices

std::vector<unsigned> PLMD::MultiValue::indices
private

This is a fudge to save on vector resizing in MultiColvar.

◆ nderivatives

unsigned PLMD::MultiValue::nderivatives
private

Number of derivatives per value.

◆ sort_indices

std::vector<unsigned> PLMD::MultiValue::sort_indices
private

◆ tmp_atoms

std::vector<Vector> PLMD::MultiValue::tmp_atoms
private

◆ tmpder

std::vector<double> PLMD::MultiValue::tmpder
private

Tempory vector of derivatives (used for calculating quotients.

◆ tmpval

double PLMD::MultiValue::tmpval
private

Tempory value.

◆ values

std::vector<double> PLMD::MultiValue::values
private

Values of quantities.


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