CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ECIContainer.hh
Go to the documentation of this file.
1 #ifndef CASM_ECICONTAINER_HH
2 #define CASM_ECICONTAINER_HH
3 
6 
7 namespace CASM {
8 
12  class ECIContainer {
13 
14  public:
15 
17 
20 
28  template<typename SparseECIIterator, typename OrbitIndexIterator>
29  ECIContainer(SparseECIIterator eci_begin, SparseECIIterator eci_end, OrbitIndexIterator index_begin) {
30  auto eci_it = eci_begin;
31  auto index_it = index_begin;
32  for(; eci_it != eci_end; ++eci_it, ++index_it) {
33  m_value.push_back(*eci_it);
34  m_index.push_back(*index_it);
35  }
36  }
37 
39  size_type size() const {
40  return m_value.size();
41  }
42 
44  const std::vector<double> &value() const {
45  return m_value;
46  }
47 
49  const std::vector<size_type> &index() const {
50  return m_index;
51  }
52 
53  private:
54 
56  std::vector<double> m_value;
57 
59  std::vector<size_type> m_index;
60 
61  };
62 
64  double operator*(const ECIContainer &_eci, const Correlation &_corr);
65 
67  double operator*(const ECIContainer &_eci, double const *_corr_begin);
68 
70  ECIContainer read_eci_out(const fs::path &filepath);
71 
73  ECIContainer read_eci(const fs::path &filepath);
74 
75 }
76 #endif
ECIContainer(SparseECIIterator eci_begin, SparseECIIterator eci_end, OrbitIndexIterator index_begin)
Construct from range of ECI values and corresponding orbit indices.
Definition: ECIContainer.hh:29
Clexulator_impl::Base::size_type size_type
Definition: Clexulator.hh:244
Main CASM namespace.
Definition: complete.cpp:8
Clexulator::size_type size_type
Definition: ECIContainer.hh:16
size_type size() const
Number of eci specified (no guarentee they are all non-zero)
Definition: ECIContainer.hh:39
ECIContainer read_eci(const fs::path &filepath)
Read eci.json file from specified path.
const std::vector< double > & value() const
const Access ECI values
Definition: ECIContainer.hh:44
std::vector< double > m_value
Efective cluster interaction values.
Definition: ECIContainer.hh:56
BasisSet operator*(const SymOp &LHS, const BasisSet &RHS)
Definition: BasisSet.cc:1154
ECIContainer()
Default constructor.
Definition: ECIContainer.hh:19
ECIContainer read_eci_out(const fs::path &filepath)
Read eci.out file from specified path (deprecated)
Definition: ECIContainer.cc:48
const std::vector< size_type > & index() const
const Access orbit indices of ECI values
Definition: ECIContainer.hh:49
std::vector< size_type > m_index
Orbit index for each coefficient in m_value.
Definition: ECIContainer.hh:59
Eigen::VectorXd Correlation
Definition: Correlation.hh:9
A sparse container of ECI values and their corresponding orbit indices.
Definition: ECIContainer.hh:12