CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB::PropertiesDatabase Class Referenceabstract

#include <PropertiesDatabase.hh>

+ Inheritance diagram for CASM::DB::PropertiesDatabase:

Detailed Description

Database containing MappedProperties of Configuration

In brief, MappedProperties holds:

Note:

The PropertiesDatabase contains:

  • A one-to-one lookup of "origin" -> MappedProperties
  • A one-to-many lookup of the "to" key (a Configuration name) -> MappedProperties:
    • An iterator to the single preferred properties for a given Configuration are returned by the "find_via_to" method. Self-mapped properties are always preferred, followed by a scoring process that may be customized.
    • The set of all "origin" that mapped to the "to" Configuration are returned by the "all_origins" method.

When there are multiple MappedProperties with different "origin" and the same "to" Configuration (i.e. multiple unstable ideal Configuration that relax to the same stable Configuragion), a "ScoreMappedProperties" object is used to sort the set. The PropertiesDatabase records a default ScoreMappedProperties object, as well as a list of 'bespoke' ScoreMappedProperties, which may be assigned to individual 'to' keys on an as-needed basis.

Definition at line 190 of file PropertiesDatabase.hh.

Classes

class  Compare
 Compare type for std::set<std::string, Compare>, which sorts to determine the 'origin' configname for the best scoring MappedProperties to a particular config. More...
 

Public Types

typedef MappedProperties value_type
 
typedef PropertiesDatabaseIterator iterator
 
typedef Index size_type
 
typedef Base::MostDerived MostDerived
 

Public Member Functions

 PropertiesDatabase (const PrimClex &_primclex)
 
virtual iterator begin () const =0
 Begin iterator over data entries. More...
 
virtual iterator end () const =0
 End iterator over data entries. More...
 
virtual size_type size () const =0
 
bool empty () const
 
virtual iterator find_via_to (std::string to_configname) const =0
 Return iterator to data entry that is the best mapping to specified config. More...
 
virtual iterator find_via_origin (std::string origin) const =0
 Return iterator to data entry that is from the specified origin. More...
 
virtual std::set< std::string, Compareall_origins (std::string to_configname) const =0
 Names of all configurations that relaxed 'origin'->'to'. More...
 
virtual void set_score_method (std::string to_configname, const ScoreMappedProperties &score)=0
 Change the score method for a single configuration. More...
 
ScoreMappedProperties score_method (std::string to_configname) const
 Name of ScoreMappedProperties method. More...
 
double best_score (std::string to_configname) const
 Best score of configurations that relaxed 'origin'->'to'. More...
 
double score (std::string origin) const
 Score mapping 'origin'->'to'. More...
 
double score (const MappedProperties &value) const
 Score mapping 'from'->'to'. More...
 
std::pair< iterator, bool > insert (const MappedProperties &value)
 Insert data. More...
 
iterator erase (iterator pos)
 Erase data. More...
 
size_type erase_via_origin (std::string origin)
 Erase data. More...
 
virtual DatabaseBaseopen ()=0
 
virtual void commit ()=0
 
virtual void close ()=0
 
const PrimClexprimclex () const
 
const Structureprim () const
 
double crystallography_tol () const
 

Protected Member Functions

MostDerivedderived ()
 
const MostDerivedderived () const
 

Private Member Functions

virtual std::pair< iterator, bool > _insert (const MappedProperties &value)=0
 Private _insert MappedProperties, without modifying 'relaxed_from'. More...
 
virtual iterator _erase (iterator pos)=0
 Private _erase MappedProperties, without modifying 'relaxed_from'. More...
 
virtual void _set_all_origins (std::string to_configname, const std::set< std::string, Compare > &_set)=0
 Set sorted container of names of all configurations that relaxed 'from'->'to'. More...
 

Private Attributes

const PrimClexm_primclex
 

Member Typedef Documentation

◆ iterator

◆ MostDerived

typedef Base::MostDerived CASM::HasPrimClex< CRTPBase< DatabaseBase > >::MostDerived
inherited

Definition at line 16 of file HasPrimClex.hh.

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ PropertiesDatabase()

CASM::DB::PropertiesDatabase::PropertiesDatabase ( const PrimClex _primclex)
inline

Definition at line 218 of file PropertiesDatabase.hh.

Member Function Documentation

◆ _erase()

virtual iterator CASM::DB::PropertiesDatabase::_erase ( iterator  pos)
privatepure virtual

Private _erase MappedProperties, without modifying 'relaxed_from'.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ _insert()

virtual std::pair<iterator, bool> CASM::DB::PropertiesDatabase::_insert ( const MappedProperties value)
privatepure virtual

Private _insert MappedProperties, without modifying 'relaxed_from'.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ _set_all_origins()

virtual void CASM::DB::PropertiesDatabase::_set_all_origins ( std::string  to_configname,
const std::set< std::string, Compare > &  _set 
)
privatepure virtual

Set sorted container of names of all configurations that relaxed 'from'->'to'.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ all_origins()

virtual std::set<std::string, Compare> CASM::DB::PropertiesDatabase::all_origins ( std::string  to_configname) const
pure virtual

Names of all configurations that relaxed 'origin'->'to'.

  • Empty set if none

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ begin()

virtual iterator CASM::DB::PropertiesDatabase::begin ( ) const
pure virtual

Begin iterator over data entries.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ best_score()

double CASM::DB::PropertiesDatabase::best_score ( std::string  to_configname) const
inline

Best score of configurations that relaxed 'origin'->'to'.

Definition at line 254 of file PropertiesDatabase.hh.

◆ close()

virtual void CASM::DB::DatabaseBase::close ( )
pure virtualinherited

◆ commit()

◆ crystallography_tol()

double CASM::HasPrimClex< CRTPBase< DatabaseBase > >::crystallography_tol
inherited

Definition at line 21 of file HasPrimClex_impl.hh.

◆ derived() [1/2]

template<typename _MostDerived >
MostDerived& notstd::CRTPBase< _MostDerived >::derived ( )
inlineprotectedinherited

Definition at line 13 of file CRTPBase.hh.

◆ derived() [2/2]

template<typename _MostDerived >
const MostDerived& notstd::CRTPBase< _MostDerived >::derived ( ) const
inlineprotectedinherited

Definition at line 15 of file CRTPBase.hh.

◆ empty()

bool CASM::DB::PropertiesDatabase::empty ( ) const
inline

Definition at line 227 of file PropertiesDatabase.hh.

◆ end()

virtual iterator CASM::DB::PropertiesDatabase::end ( ) const
pure virtual

End iterator over data entries.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ erase()

PropertiesDatabase::iterator CASM::DB::PropertiesDatabase::erase ( iterator  pos)

Erase data.

Erase the 'origin' data element at provided iterator.

Definition at line 35 of file PropertiesDatabase.cc.

◆ erase_via_origin()

size_type CASM::DB::PropertiesDatabase::erase_via_origin ( std::string  origin)
inline

Erase data.

Definition at line 275 of file PropertiesDatabase.hh.

◆ find_via_origin()

virtual iterator CASM::DB::PropertiesDatabase::find_via_origin ( std::string  origin) const
pure virtual

Return iterator to data entry that is from the specified origin.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ find_via_to()

virtual iterator CASM::DB::PropertiesDatabase::find_via_to ( std::string  to_configname) const
pure virtual

Return iterator to data entry that is the best mapping to specified config.

  • Prefers self-mapped, else best scoring

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ insert()

std::pair< PropertiesDatabase::iterator, bool > CASM::DB::PropertiesDatabase::insert ( const MappedProperties value)

Insert data.

Definition at line 18 of file PropertiesDatabase.cc.

◆ open()

virtual DatabaseBase& CASM::DB::DatabaseBase::open ( )
pure virtualinherited

◆ prim()

const Structure & CASM::HasPrimClex< CRTPBase< DatabaseBase > >::prim
inherited

Definition at line 19 of file HasPrimClex_impl.hh.

◆ primclex()

const PrimClex& CASM::DB::DatabaseBase::primclex ( ) const
inlineinherited

Definition at line 35 of file Database.hh.

◆ score() [1/2]

double CASM::DB::PropertiesDatabase::score ( const MappedProperties value) const
inline

Score mapping 'from'->'to'.

Definition at line 264 of file PropertiesDatabase.hh.

◆ score() [2/2]

double CASM::DB::PropertiesDatabase::score ( std::string  origin) const
inline

Score mapping 'origin'->'to'.

Definition at line 259 of file PropertiesDatabase.hh.

◆ score_method()

ScoreMappedProperties CASM::DB::PropertiesDatabase::score_method ( std::string  to_configname) const
inline

Name of ScoreMappedProperties method.

Definition at line 249 of file PropertiesDatabase.hh.

◆ set_score_method()

virtual void CASM::DB::PropertiesDatabase::set_score_method ( std::string  to_configname,
const ScoreMappedProperties score 
)
pure virtual

Change the score method for a single configuration.

Implemented in CASM::DB::jsonPropertiesDatabase.

◆ size()

virtual size_type CASM::DB::PropertiesDatabase::size ( ) const
pure virtual

Member Data Documentation

◆ m_primclex

const PrimClex* CASM::DB::DatabaseBase::m_primclex
privateinherited

Definition at line 38 of file Database.hh.


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