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

#include <DiffClexParamPack.hh>

+ Inheritance diagram for CASM::DiffClexParamPack:

Detailed Description

Class for managing the set of all dependent and independent paramters used/generated by clexulator.

Definition at line 242 of file DiffClexParamPack.hh.

Public Types

using DiffScalar = DiffClexParamPack_impl::DiffScalar
 
using EvalMode = DiffClexParamPack_impl::EvalMode
 
using BaseKey = DiffClexParamKey
 
using Key = DiffClexParamValKey
 
using DoubleReference = Eigen::MatrixXd::CoeffReturnType
 
template<typename Scalar >
using Val = ValAccess< Scalar >
 
typedef unsigned int size_type
 

Public Member Functions

 DiffClexParamPack ()
 Default constructor initializes evaluation mode and zeros numbers of managed parameters. More...
 
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 (BaseKey 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 (BaseKey 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 (BaseKey const &_key) const
 
EvalMode eval_mode () 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 (BaseKey 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 (BaseKey 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 (BaseKey const &_key, size_type _i, size_type _j) const
 
void write (ClexParamKey const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val) override
 Write parameter array for parameter specified by. More...
 
void write (ClexParamKey const &_key, size_type _i, double _val) override
 Write element to 1D parameter array for parameter specified by. More...
 
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 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 (BaseKey const &_key, EvalMode _mode)
 Set evaluation mode of specified parameter type. More...
 
void pre_eval ()
 Prepares all independent parameters before function evaluation if derivatives are desired. More...
 
void post_eval ()
 Processes all dependent parameters after function evaluation if derivatives are desired. More...
 
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...
 

Protected Attributes

std::map< std::string, ClexParamKeym_keys
 

Private Attributes

std::vector< DiffScalarContainerm_data
 
std::vector< EvalModem_eval
 
EvalMode m_tot_eval_mode
 
Index m_N_independent
 
Index m_N_dependent
 

Friends

template<typename Scalar >
class ValAccess
 
static const EvalMode DEFAULT
 
static const EvalMode READ
 
static const EvalMode DIFF
 
static const EvalMode DYNAM
 
void write (BaseKey const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val)
 
void write (BaseKey const &_key, size_type _i, double _val)
 
void write (BaseKey const &_key, size_type _i, size_type _j, double _val)
 
Key allocate (std::string const &_keyname, Index _rows, Index _cols, bool _independent)
 

Member Typedef Documentation

◆ BaseKey

◆ DiffScalar

◆ DoubleReference

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

Definition at line 255 of file DiffClexParamPack.hh.

◆ EvalMode

◆ 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::DiffClexParamPack::Val = ValAccess<Scalar>

Definition at line 258 of file DiffClexParamPack.hh.

Constructor & Destructor Documentation

◆ DiffClexParamPack()

CASM::DiffClexParamPack::DiffClexParamPack ( )
inline

Default constructor initializes evaluation mode and zeros numbers of managed parameters.

Definition at line 265 of file DiffClexParamPack.hh.

Member Function Documentation

◆ allocate()

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

Definition at line 609 of file DiffClexParamPack.hh.

◆ dim() [1/2]

size_type CASM::DiffClexParamPack::dim ( BaseKey const &  _key) const
inline

Definition at line 280 of file DiffClexParamPack.hh.

◆ dim() [2/2]

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

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

Implements CASM::ClexParamPack.

Definition at line 276 of file DiffClexParamPack.hh.

◆ eval_mode() [1/3]

EvalMode CASM::DiffClexParamPack::eval_mode ( ) const
inline

Definition at line 290 of file DiffClexParamPack.hh.

◆ eval_mode() [2/3]

EvalMode CASM::DiffClexParamPack::eval_mode ( BaseKey const &  _key) const
inline

Definition at line 288 of file DiffClexParamPack.hh.

◆ eval_mode() [3/3]

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

Check evaluation mode for ClexParamPack parameter Choices are at least.

Implements CASM::ClexParamPack.

Definition at line 284 of file DiffClexParamPack.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::DiffClexParamPack::post_eval ( )
inline

Processes all dependent parameters after function evaluation if derivatives are desired.

Definition at line 375 of file DiffClexParamPack.hh.

◆ pre_eval()

void CASM::DiffClexParamPack::pre_eval ( )
inline

Prepares all independent parameters before function evaluation if derivatives are desired.

Definition at line 363 of file DiffClexParamPack.hh.

◆ read() [1/6]

Eigen::MatrixXd const& CASM::DiffClexParamPack::read ( BaseKey const &  _key) const
inline

Definition at line 296 of file DiffClexParamPack.hh.

◆ read() [2/6]

double const& CASM::DiffClexParamPack::read ( BaseKey const &  _key,
size_type  _i,
size_type  _j 
) const
inline

Definition at line 313 of file DiffClexParamPack.hh.

◆ read() [3/6]

double const& CASM::DiffClexParamPack::read ( BaseKey const &  _key,
size_type  _ind 
) const
inline

Definition at line 304 of file DiffClexParamPack.hh.

◆ read() [4/6]

Eigen::MatrixXd const& CASM::DiffClexParamPack::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 292 of file DiffClexParamPack.hh.

◆ read() [5/6]

double const& CASM::DiffClexParamPack::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 308 of file DiffClexParamPack.hh.

◆ read() [6/6]

double const& CASM::DiffClexParamPack::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 300 of file DiffClexParamPack.hh.

◆ set_eval_mode() [1/2]

void CASM::DiffClexParamPack::set_eval_mode ( BaseKey const &  _key,
EvalMode  _mode 
)
inline

Set evaluation mode of specified parameter type.

Parameters
_keySpecifies parameter for which evluation mode is being set
_modeNew value for evaluation mode

Definition at line 350 of file DiffClexParamPack.hh.

◆ set_eval_mode() [2/2]

void CASM::DiffClexParamPack::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 341 of file DiffClexParamPack.hh.

◆ size() [1/2]

size_type CASM::DiffClexParamPack::size ( BaseKey const &  _key) const
inline

Definition at line 272 of file DiffClexParamPack.hh.

◆ size() [2/2]

size_type CASM::DiffClexParamPack::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 268 of file DiffClexParamPack.hh.

◆ write() [1/6]

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

Definition at line 568 of file DiffClexParamPack.hh.

◆ write() [2/6]

void CASM::DiffClexParamPack::write ( BaseKey const &  _key,
size_type  _i,
double  _val 
)
inline

Definition at line 581 of file DiffClexParamPack.hh.

◆ write() [3/6]

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

Definition at line 595 of file DiffClexParamPack.hh.

◆ write() [4/6]

void CASM::DiffClexParamPack::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 317 of file DiffClexParamPack.hh.

◆ write() [5/6]

void CASM::DiffClexParamPack::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 325 of file DiffClexParamPack.hh.

◆ write() [6/6]

void CASM::DiffClexParamPack::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 331 of file DiffClexParamPack.hh.

Friends And Related Function Documentation

◆ ValAccess

template<typename Scalar >
friend class ValAccess
friend

Definition at line 261 of file DiffClexParamPack.hh.

Member Data Documentation

◆ DEFAULT

const DiffClexParamPack::EvalMode CASM::DiffClexParamPack::DEFAULT
static

◆ DIFF

const DiffClexParamPack::EvalMode CASM::DiffClexParamPack::DIFF
static

◆ DYNAM

const DiffClexParamPack::EvalMode CASM::DiffClexParamPack::DYNAM
static

◆ m_data

std::vector<DiffScalarContainer> CASM::DiffClexParamPack::m_data
private

Definition at line 386 of file DiffClexParamPack.hh.

◆ m_eval

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

Definition at line 387 of file DiffClexParamPack.hh.

◆ m_keys

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

Definition at line 325 of file ClexParamPack.hh.

◆ m_N_dependent

Index CASM::DiffClexParamPack::m_N_dependent
private

Definition at line 390 of file DiffClexParamPack.hh.

◆ m_N_independent

Index CASM::DiffClexParamPack::m_N_independent
private

Definition at line 389 of file DiffClexParamPack.hh.

◆ m_tot_eval_mode

EvalMode CASM::DiffClexParamPack::m_tot_eval_mode
private

Definition at line 388 of file DiffClexParamPack.hh.

◆ READ

const DiffClexParamPack::EvalMode CASM::DiffClexParamPack::READ
static

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