CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ConfigIONovelty.hh
Go to the documentation of this file.
1 #ifndef CONFIGIONOVELTY_HH
2 #define CONFIGIONOVELTY_HH
3 
5 
6 namespace CASM {
7 
8  class Configuration;
9 
10  namespace ConfigIO {
11 
15 
42  class Novelty: public ScalarAttribute<Configuration> {
43 
44  public:
45 
46  Novelty() :
47  ScalarAttribute<Configuration>("novelty", "Novelty of a configuration with respect to a population of configurations, measured using the Mahalanobis distance of its correlations. Accepts one argument, a configuration selection specifying the population against which novelty is measured (default MASTER). Ex: novelty(path/to/selection)") {}
48 
49 
50  // --- Required implementations -----------
51 
52  std::unique_ptr<Novelty> clone() const {
53  return std::unique_ptr<Novelty>(this->_clone());
54  }
55 
56  double evaluate(const Configuration &_config) const override;
57 
58 
59  // --- Specialized implementation -----------
60 
61  void init(const Configuration &_tmplt) const override;
62 
63  std::string short_header(const Configuration &_config) const override;
64  /*
65  void inject(const Configuration &_config, DataStream &_stream, Index) const override;
66 
67  void print(const Configuration &_config, std::ostream &_stream, Index) const override;
68 
69  jsonParser &to_json(const Configuration &_config, jsonParser &json)const override;
70  */
71  bool parse_args(const std::string &args) override;
72 
73  private:
74 
76  Novelty *_clone() const override {
77  return new Novelty(*this);
78  }
79 
81  mutable std::string m_selection;
82 
85 
88 
91 
92  };
93  }
94 }
95 #endif
96 
Eigen::MatrixXd MatrixXd
bool parse_args(const std::string &args) override
Eigen::MatrixXd m_gram_mat
Gram matrix, which defind Mahalanobis scalar product.
double evaluate(const Configuration &_config) const override
void init(const Configuration &_tmplt) const override
std::string m_selection
specifies which selection to use as the population
Eigen::VectorXd m_avg_corr
The average correlation vector of the population.
Main CASM namespace.
Definition: complete.cpp:8
A DatumFormatter class to measure the 'novelty' of a configuration with respect to a population of co...
Base class for creating scalar DatumFormatter.
Novelty * _clone() const override
Clone.
Eigen::VectorXd VectorXd
std::string short_header(const Configuration &_config) const override
Extract data from objects of 'DataObject' class.
DataFormatter< Configuration > m_format
Formatter which is used to obtain correlations.
A Configuration represents the values of all degrees of freedom in a Supercell.
std::unique_ptr< Novelty > clone() const