CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigIOStrucScore.hh
Go to the documentation of this file.
1 #ifndef CASM_ConfigIOStrucScore
2 #define CASM_ConfigIOStrucScore
3 
4 #include <boost/filesystem.hpp>
5 
6 #include "casm/basis_set/DoF.hh"
9 
10 namespace CASM {
11 namespace xtal {
12 class Site;
13 class BasicStructure;
14 class StrucMapper;
15 } // namespace xtal
16 using xtal::BasicStructure;
17 using xtal::Site;
18 using xtal::StrucMapper;
19 
20 class Configuration;
21 
22 namespace ConfigIO {
23 
29 class StrucScore : public VectorXdAttribute<Configuration> {
30  public:
31  StrucScore();
32 
33  StrucScore(StrucScore const &RHS);
34 
35  // --- Required implementations -----------
36 
37  std::unique_ptr<StrucScore> clone() const {
38  return std::unique_ptr<StrucScore>(this->_clone());
39  }
40 
41  Eigen::VectorXd evaluate(Configuration const &_config) const override;
42 
43  // --- Specialized implementation -----------
44 
45  bool validate(Configuration const &_config) const override;
46 
47  std::string short_header(Configuration const &_config) const override;
48 
49  std::vector<std::string> col_header(
50  Configuration const &_config) const override;
51 
52  bool parse_args(std::string const &args) override;
53 
54  bool init(Configuration const &tmplt) const override;
55 
56  protected:
57  mutable std::unique_ptr<BasicStructure> m_altprim;
58  mutable std::unique_ptr<StrucMapper> m_strucmapper;
60  fs::path m_prim_path;
61  std::vector<std::string> m_prop_names;
62 
63  private:
65  StrucScore *_clone() const override { return new StrucScore(*this); }
66 };
67 
68 } // namespace ConfigIO
69 } // namespace CASM
70 #endif
Abstract base class for creating 1D DatumFormatter.
Evaluates the mapping of a configuration onto an arbitrary primitive structure.
std::unique_ptr< StrucScore > clone() const
Eigen::VectorXd evaluate(Configuration const &_config) const override
bool validate(Configuration const &_config) const override
std::unique_ptr< StrucMapper > m_strucmapper
std::string short_header(Configuration const &_config) const override
bool init(Configuration const &tmplt) const override
If not yet initialized, use the default clexulator from the PrimClex.
std::vector< std::string > m_prop_names
std::vector< std::string > col_header(Configuration const &_config) const override
bool parse_args(std::string const &args) override
Default implementation calls _parse_index_expression.
StrucScore * _clone() const override
Clone.
std::unique_ptr< BasicStructure > m_altprim
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::VectorXd VectorXd