CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DiffClexParamKey Class Referenceabstract

#include <DiffClexParamPack.hh>

+ Inheritance diagram for CASM::DiffClexParamKey:

Detailed Description

Abstract base class for all keys that interact with DiffClexParamPack DiffClexParamPack values are assumed to be 1D, 2D, or to be naturally accessed via 2D slices Standalone values are assumed to be 1D or 2D (for example, a 3xN displacement field) Derived values typically have more dimensions (for example, the derivative of the Mx1 correlation vector with respect to the displacement field has 3 indices, whild the second derivative wrt the displacement field has 5 indices). Derivatives are always asociated with the first independent standalone value in the key name. The key "diff/corr/disp_var" would be associated with "disp_var", which is a 3xN Matrix, and thus the resulting derived value (which is the first derifative of correlations with respect to displacements) will be sliced into 3xN slices. Each slice corresponds to a particular entry in the Mx1 correlation vector (i.e., slice 'j' is the gradient of correlation value j with respect to the entire set of displacement variables). The 'j' index that specifies the particular slice is called a 'secondary identifier', and it can be specified via ClexParamKey::set_identifiers().

Definition at line 78 of file DiffClexParamPack.hh.

Public Types

typedef ClexParamPack::size_type size_type
 

Public Member Functions

 DiffClexParamKey (std::string const &_name, bool _standalone, size_type _ind, std::vector< Index > const &_offset={}, std::vector< Index > const &_stride={})
 DiffClexParamKey Constructor. More...
 
 DiffClexParamKey ()
 
virtual ~DiffClexParamKey ()
 Destructor of abstract base class must be virtual. More...
 
virtual Eigen::MatrixXd const & eval (DiffScalarContainer const &_data, DiffClexParamPack_impl::EvalMode mode) const =0
 Operate on associated DiffScalarContainer to ensure the standalone or derived value associated with this key is present in its cache matrix. More...
 
size_type index () const
 Access the primary identifier of this value (which determines the associated standalone value and/or the shape of the dataslice. More...
 
std::string const & name () const
 Name of this Key, should be descriptive of managed data. Ex.: "disp_var" of "magspin_site_basis". More...
 
template<typename... Args>
void set_identifiers (Args const &... args)
 Specify supplemental identifiers, either via linear indices or pair indices. Internally, identifiers are always passed as linear indices. The number and specification of identifiers depends on derived ClexParamKey implementation. Linear identifiers should be passed as an integral value (Index, int, etc) pair index identifiers must be passed as std::pair<Index,Index> More...
 
std::unique_ptr< BaseKeyclone () const
 Clone the ClexParamKey. More...
 
bool standalone () const
 Returns true if key refers directly to managed data, false if it refers to values derived from managed data. More...
 

Protected Member Functions

Index _l (Index i) const
 Returns i'th linear index identifier. More...
 
template<typename T , typename... Args>
void _set_identifiers (Index i, T const &_val, Args const &... args)
 Recursive unrolling of variadic template to set all identifiers. More...
 
void _set_identifiers (Index i, Index _ind)
 Overload for linear indexed identifier. More...
 
void _set_identifiers (Index i, std::pair< Index, Index > _inds)
 Overload for pair indexed identifier. More...
 
virtual BaseKey_clone () const =0
 Clone the ClexParamKey. More...
 

Protected Attributes

std::vector< Indexm_offset
 
std::vector< Indexm_stride
 
std::vector< Indexm_identifiers
 

Private Attributes

size_type m_index
 
std::string m_name
 
bool m_standalone
 

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ DiffClexParamKey() [1/2]

CASM::DiffClexParamKey::DiffClexParamKey ( std::string const &  _name,
bool  _standalone,
size_type  _ind,
std::vector< Index > const &  _offset = {},
std::vector< Index > const &  _stride = {} 
)
inline

DiffClexParamKey Constructor.

Parameters
_nameThe name of the associated value
_indIndex of the standalone value that is the primary identifier for the associated value
_offsetConstant offset for any secondary identifiers for the value of interest
_stride

Definition at line 87 of file DiffClexParamPack.hh.

◆ DiffClexParamKey() [2/2]

CASM::DiffClexParamKey::DiffClexParamKey ( )
inline

Definition at line 96 of file DiffClexParamPack.hh.

◆ ~DiffClexParamKey()

virtual CASM::DiffClexParamKey::~DiffClexParamKey ( )
inlinevirtual

Destructor of abstract base class must be virtual.

Definition at line 99 of file DiffClexParamPack.hh.

Member Function Documentation

◆ _clone()

virtual BaseKey* CASM::ClexParamPack_impl::BaseKey::_clone ( ) const
protectedpure virtualinherited

◆ _l()

Index CASM::ClexParamPack_impl::BaseKey::_l ( Index  i) const
inlineprotectedinherited

Returns i'th linear index identifier.

Definition at line 86 of file ClexParamPack.hh.

◆ _set_identifiers() [1/3]

void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
Index  _ind 
)
inlineprotectedinherited

Overload for linear indexed identifier.

Definition at line 96 of file ClexParamPack.hh.

◆ _set_identifiers() [2/3]

void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
std::pair< Index, Index _inds 
)
inlineprotectedinherited

Overload for pair indexed identifier.

Definition at line 101 of file ClexParamPack.hh.

◆ _set_identifiers() [3/3]

template<typename T , typename... Args>
void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
T const &  _val,
Args const &...  args 
)
inlineprotectedinherited

Recursive unrolling of variadic template to set all identifiers.

Definition at line 90 of file ClexParamPack.hh.

◆ clone()

std::unique_ptr<BaseKey> CASM::ClexParamPack_impl::BaseKey::clone ( ) const
inlineinherited

Clone the ClexParamKey.

Definition at line 76 of file ClexParamPack.hh.

◆ eval()

virtual Eigen::MatrixXd const& CASM::DiffClexParamKey::eval ( DiffScalarContainer const &  _data,
DiffClexParamPack_impl::EvalMode  mode 
) const
pure virtual

Operate on associated DiffScalarContainer to ensure the standalone or derived value associated with this key is present in its cache matrix.

Implemented in CASM::DiffClexParamHessKey, CASM::DiffClexParamGradKey, and CASM::DiffClexParamValKey.

◆ index()

size_type CASM::DiffClexParamKey::index ( ) const
inline

Access the primary identifier of this value (which determines the associated standalone value and/or the shape of the dataslice.

Definition at line 109 of file DiffClexParamPack.hh.

◆ name()

std::string const& CASM::ClexParamPack_impl::BaseKey::name ( ) const
inlineinherited

Name of this Key, should be descriptive of managed data. Ex.: "disp_var" of "magspin_site_basis".

Definition at line 62 of file ClexParamPack.hh.

◆ set_identifiers()

template<typename... Args>
void CASM::ClexParamPack_impl::BaseKey::set_identifiers ( Args const &...  args)
inlineinherited

Specify supplemental identifiers, either via linear indices or pair indices. Internally, identifiers are always passed as linear indices. The number and specification of identifiers depends on derived ClexParamKey implementation. Linear identifiers should be passed as an integral value (Index, int, etc) pair index identifiers must be passed as std::pair<Index,Index>

Definition at line 71 of file ClexParamPack.hh.

◆ standalone()

bool CASM::ClexParamPack_impl::BaseKey::standalone ( ) const
inlineinherited

Returns true if key refers directly to managed data, false if it refers to values derived from managed data.

Definition at line 82 of file ClexParamPack.hh.

Member Data Documentation

◆ m_identifiers

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_identifiers
protectedinherited

Definition at line 110 of file ClexParamPack.hh.

◆ m_index

size_type CASM::DiffClexParamKey::m_index
private

Definition at line 112 of file DiffClexParamPack.hh.

◆ m_name

std::string CASM::ClexParamPack_impl::BaseKey::m_name
privateinherited

Definition at line 113 of file ClexParamPack.hh.

◆ m_offset

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_offset
protectedinherited

Definition at line 108 of file ClexParamPack.hh.

◆ m_standalone

bool CASM::ClexParamPack_impl::BaseKey::m_standalone
privateinherited

Definition at line 114 of file ClexParamPack.hh.

◆ m_stride

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_stride
protectedinherited

Definition at line 109 of file ClexParamPack.hh.


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