CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::BasicClexParamPack Class Reference

#include <BasicClexParamPack.hh>

+ Inheritance diagram for CASM::BasicClexParamPack:

Detailed Description

Abstract base class for reading/writing clexulator parameters Parameters are assume be naturally representable as 1D or 2D arrays.

Definition at line 39 of file BasicClexParamPack.hh.

Public Types

enum class  EvalMode { DEFAULT , READ , DYNAM }
 
using Key = BasicClexParamKey
 
using DoubleReference = Eigen::MatrixXd::CoeffReturnType
 
template<typename Scalar >
using Val = ValAccess< Scalar >
 
typedef unsigned int size_type
 

Public Member Functions

size_type size (ClexParamKey const &_key) const override
 'N' dimension of parameter array (either '1', or size of unit cell neighborhood) returns number of columns in parameter array More...
 
size_type size (Key const &_key) const
 
size_type dim (ClexParamKey const &_key) const override
 'm' dimension of parameter array returns number of rows in parameter array More...
 
size_type dim (Key const &_key) const
 
std::string eval_mode (ClexParamKey const &_key) const override
 Check evaluation mode for ClexParamPack parameter Choices are at least. More...
 
EvalMode eval_mode (Key const &_key) const
 
Eigen::MatrixXd const & read (ClexParamKey const &_key) const override
 Returns const reference to parameter array for parameter specified by. More...
 
Eigen::MatrixXd const & read (Key const &_key) const
 
double const & read (ClexParamKey const &_key, size_type _ind) const override
 Returns const reference to element of 1D parameter array for parameter specified by. More...
 
double const & read (Key const &_key, size_type _ind) const
 
double const & read (ClexParamKey const &_key, size_type _i, size_type _j) const override
 Returns const reference to element of 2D parameter array for parameter specified by. More...
 
double const & read (Key const &_key, size_type _i, size_type _j) const
 
void set_eval_mode (ClexParamKey const &_key, std::string const &_mode) override
 Sets evaluation mode for ClexParamPack parameter Choices are at least. More...
 
void set_eval_mode (Key const &_key, EvalMode _mode)
 
void write (ClexParamKey const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val) override
 Write parameter array for parameter specified by. More...
 
void write (Key const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val)
 
void write (ClexParamKey const &_key, size_type _i, double _val) override
 Write element to 1D parameter array for parameter specified by. More...
 
void write (Key const &_key, size_type _i, double _val)
 
void write (ClexParamKey const &_key, size_type _i, size_type _j, double _val) override
 Write element to 2D parameter array for parameter specified by. More...
 
void write (Key const &_key, size_type _i, size_type _j, double _val)
 
Key allocate (std::string const &_keyname, Index _rows, Index _cols, bool _independent)
 
std::map< std::string, ClexParamKey > const & keys () const
 Obtain registry of all keys for data blocks managed by this ClexParamPack. More...
 
ClexParamKey const & key (std::string const &_name) const
 Obtain key for managed data block by name. More...
 
void pre_eval ()
 May be specialized to perform preprocessing before function evaluation. More...
 
void post_eval ()
 May be specialized to perform postprocessing after function evaluation. More...
 

Static Public Attributes

static const EvalMode DEFAULT
 
static const EvalMode READ
 
static const EvalMode DYNAM
 

Protected Attributes

std::map< std::string, ClexParamKeym_keys
 

Private Attributes

std::vector< Eigen::MatrixXd > m_data
 
std::vector< EvalModem_eval
 

Friends

template<typename Scalar >
class ValAccess
 

Member Typedef Documentation

◆ DoubleReference

using CASM::BasicClexParamPack::DoubleReference = Eigen::MatrixXd::CoeffReturnType

Definition at line 48 of file BasicClexParamPack.hh.

◆ Key

◆ size_type

typedef unsigned int CASM::ClexParamPack::size_type
inherited

Definition at line 232 of file ClexParamPack.hh.

◆ Val

template<typename Scalar >
using CASM::BasicClexParamPack::Val = ValAccess<Scalar>

Definition at line 51 of file BasicClexParamPack.hh.

Member Enumeration Documentation

◆ EvalMode

Enumerator
DEFAULT 
READ 
DYNAM 

Definition at line 41 of file BasicClexParamPack.hh.

Member Function Documentation

◆ allocate()

Key CASM::BasicClexParamPack::allocate ( std::string const &  _keyname,
Index  _rows,
Index  _cols,
bool  _independent 
)
inline

Definition at line 135 of file BasicClexParamPack.hh.

◆ dim() [1/2]

size_type CASM::BasicClexParamPack::dim ( ClexParamKey const &  _key) const
inlineoverridevirtual

'm' dimension of parameter array returns number of rows in parameter array

Implements CASM::ClexParamPack.

Definition at line 62 of file BasicClexParamPack.hh.

◆ dim() [2/2]

size_type CASM::BasicClexParamPack::dim ( Key const &  _key) const
inline

Definition at line 66 of file BasicClexParamPack.hh.

◆ eval_mode() [1/2]

std::string CASM::BasicClexParamPack::eval_mode ( ClexParamKey const &  _key) const
inlineoverridevirtual

Check evaluation mode for ClexParamPack parameter Choices are at least.

Implements CASM::ClexParamPack.

Definition at line 68 of file BasicClexParamPack.hh.

◆ eval_mode() [2/2]

EvalMode CASM::BasicClexParamPack::eval_mode ( Key const &  _key) const
inline

Definition at line 72 of file BasicClexParamPack.hh.

◆ key()

ClexParamKey const& CASM::ClexParamPack::key ( std::string const &  _name) const
inlineinherited

Obtain key for managed data block by name.

Definition at line 242 of file ClexParamPack.hh.

◆ keys()

std::map<std::string, ClexParamKey> const& CASM::ClexParamPack::keys ( ) const
inlineinherited

Obtain registry of all keys for data blocks managed by this ClexParamPack.

Definition at line 239 of file ClexParamPack.hh.

◆ post_eval()

void CASM::ClexParamPack::post_eval ( )
inlineinherited

May be specialized to perform postprocessing after function evaluation.

Definition at line 322 of file ClexParamPack.hh.

◆ pre_eval()

void CASM::ClexParamPack::pre_eval ( )
inlineinherited

May be specialized to perform preprocessing before function evaluation.

Definition at line 318 of file ClexParamPack.hh.

◆ read() [1/6]

Eigen::MatrixXd const& CASM::BasicClexParamPack::read ( ClexParamKey const &  _key) const
inlineoverridevirtual

Returns const reference to parameter array for parameter specified by.

Parameters
_keyNOTE: Take care in constructing pointers or references from the return value. If _key accepts additional index identifiers, (because the parameter has more than 2 dimensions) ClexParamPack::read() may be implemented using an internally cached matrix holding the current data slice. As such, subsequent requests to ClexParamPack::read() for a different slice may alter the internally cached values while returning a reference for the same block of memory

Implements CASM::ClexParamPack.

Definition at line 74 of file BasicClexParamPack.hh.

◆ read() [2/6]

double const& CASM::BasicClexParamPack::read ( ClexParamKey const &  _key,
size_type  _i,
size_type  _j 
) const
inlineoverridevirtual

Returns const reference to element of 2D parameter array for parameter specified by.

Parameters
_key

Implements CASM::ClexParamPack.

Definition at line 90 of file BasicClexParamPack.hh.

◆ read() [3/6]

double const& CASM::BasicClexParamPack::read ( ClexParamKey const &  _key,
size_type  _i 
) const
inlineoverridevirtual

Returns const reference to element of 1D parameter array for parameter specified by.

Parameters
_key

Implements CASM::ClexParamPack.

Definition at line 82 of file BasicClexParamPack.hh.

◆ read() [4/6]

Eigen::MatrixXd const& CASM::BasicClexParamPack::read ( Key const &  _key) const
inline

Definition at line 78 of file BasicClexParamPack.hh.

◆ read() [5/6]

double const& CASM::BasicClexParamPack::read ( Key const &  _key,
size_type  _i,
size_type  _j 
) const
inline

Definition at line 95 of file BasicClexParamPack.hh.

◆ read() [6/6]

double const& CASM::BasicClexParamPack::read ( Key const &  _key,
size_type  _ind 
) const
inline

Definition at line 86 of file BasicClexParamPack.hh.

◆ set_eval_mode() [1/2]

void CASM::BasicClexParamPack::set_eval_mode ( ClexParamKey const &  _key,
std::string const &  _mode 
)
inlineoverridevirtual

Sets evaluation mode for ClexParamPack parameter Choices are at least.

Implements CASM::ClexParamPack.

Definition at line 99 of file BasicClexParamPack.hh.

◆ set_eval_mode() [2/2]

void CASM::BasicClexParamPack::set_eval_mode ( Key const &  _key,
EvalMode  _mode 
)
inline

Definition at line 105 of file BasicClexParamPack.hh.

◆ size() [1/2]

size_type CASM::BasicClexParamPack::size ( ClexParamKey const &  _key) const
inlineoverridevirtual

'N' dimension of parameter array (either '1', or size of unit cell neighborhood) returns number of columns in parameter array

Implements CASM::ClexParamPack.

Definition at line 56 of file BasicClexParamPack.hh.

◆ size() [2/2]

size_type CASM::BasicClexParamPack::size ( Key const &  _key) const
inline

Definition at line 60 of file BasicClexParamPack.hh.

◆ write() [1/6]

void CASM::BasicClexParamPack::write ( ClexParamKey const &  _key,
Eigen::Ref< const Eigen::MatrixXd > const &  _val 
)
inlineoverridevirtual

Write parameter array for parameter specified by.

Parameters
_key

Implements CASM::ClexParamPack.

Definition at line 109 of file BasicClexParamPack.hh.

◆ write() [2/6]

void CASM::BasicClexParamPack::write ( ClexParamKey const &  _key,
size_type  _i,
double  val 
)
inlineoverridevirtual

Write element to 1D parameter array for parameter specified by.

Parameters
_key

Implements CASM::ClexParamPack.

Definition at line 118 of file BasicClexParamPack.hh.

◆ write() [3/6]

void CASM::BasicClexParamPack::write ( ClexParamKey const &  _key,
size_type  _i,
size_type  _j,
double  val 
)
inlineoverridevirtual

Write element to 2D parameter array for parameter specified by.

Parameters
_key

Implements CASM::ClexParamPack.

Definition at line 126 of file BasicClexParamPack.hh.

◆ write() [4/6]

void CASM::BasicClexParamPack::write ( Key const &  _key,
Eigen::Ref< const Eigen::MatrixXd > const &  _val 
)
inline

Definition at line 114 of file BasicClexParamPack.hh.

◆ write() [5/6]

void CASM::BasicClexParamPack::write ( Key const &  _key,
size_type  _i,
double  _val 
)
inline

Definition at line 122 of file BasicClexParamPack.hh.

◆ write() [6/6]

void CASM::BasicClexParamPack::write ( Key const &  _key,
size_type  _i,
size_type  _j,
double  _val 
)
inline

Definition at line 131 of file BasicClexParamPack.hh.

Friends And Related Function Documentation

◆ ValAccess

template<typename Scalar >
friend class ValAccess
friend

Definition at line 54 of file BasicClexParamPack.hh.

Member Data Documentation

◆ DEFAULT

const BasicClexParamPack::EvalMode CASM::BasicClexParamPack::DEFAULT
static

◆ DYNAM

const BasicClexParamPack::EvalMode CASM::BasicClexParamPack::DYNAM
static

◆ m_data

std::vector<Eigen::MatrixXd> CASM::BasicClexParamPack::m_data
private

Definition at line 155 of file BasicClexParamPack.hh.

◆ m_eval

std::vector<EvalMode> CASM::BasicClexParamPack::m_eval
private

Definition at line 156 of file BasicClexParamPack.hh.

◆ m_keys

std::map<std::string, ClexParamKey> CASM::ClexParamPack::m_keys
protectedinherited

Definition at line 325 of file ClexParamPack.hh.

◆ READ

const BasicClexParamPack::EvalMode CASM::BasicClexParamPack::READ
static

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