CASM  1.1.0
A Clusters Approach to Statistical Mechanics
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 
17 
52 class Novelty : public ScalarAttribute<Configuration> {
53  public:
56  "novelty",
57  "Novelty of a configuration with respect to a population of "
58  "configurations, measured using the Mahalanobis distance of its "
59  "correlations. Accepts one argument, a configuration selection "
60  "specifying the population against which novelty is measured "
61  "(default MASTER). Ex: novelty(path/to/selection)") {}
62 
63  // --- Required implementations -----------
64 
65  std::unique_ptr<Novelty> clone() const {
66  return std::unique_ptr<Novelty>(this->_clone());
67  }
68 
69  double evaluate(const Configuration &_config) const override;
70 
71  // --- Specialized implementation -----------
72 
73  bool init(const Configuration &_tmplt) const override;
74 
75  std::string short_header(const Configuration &_config) const override;
76  /*
77  void inject(const Configuration &_config, DataStream &_stream, Index)
78  const override;
79 
80  void print(const Configuration &_config, std::ostream &_stream, Index)
81  const override;
82 
83  jsonParser &to_json(const Configuration &_config, jsonParser &json)const
84  override;
85  */
86  bool parse_args(const std::string &args) override;
87 
88  private:
90  Novelty *_clone() const override { return new Novelty(*this); }
91 
93  mutable std::string m_selection;
94 
97 
100 
103 };
104 } // namespace ConfigIO
105 } // namespace CASM
106 #endif
Base class for creating scalar DatumFormatter.
A DatumFormatter class to measure the 'novelty' of a configuration with respect to a population of co...
std::string short_header(const Configuration &_config) const override
bool parse_args(const std::string &args) override
bool init(const Configuration &_tmplt) const override
double evaluate(const Configuration &_config) const override
std::unique_ptr< Novelty > clone() const
std::string m_selection
specifies which selection to use as the population
DataFormatter< Configuration > m_format
Formatter which is used to obtain correlations.
Novelty * _clone() const override
Clone.
Eigen::VectorXd m_avg_corr
The average correlation vector of the population.
Eigen::MatrixXd m_gram_mat
Gram matrix, which defind Mahalanobis scalar product.
Extract data from objects of 'DataObject' class.
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
Eigen::VectorXd VectorXd