CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ECIContainer.hh
Go to the documentation of this file.
1 #ifndef CASM_ECICONTAINER_HH
2 #define CASM_ECICONTAINER_HH
3 
5 
6 namespace CASM {
7 
12 class ECIContainer {
13  public:
15 
18 
26  template <typename SparseECIIterator, typename OrbitIndexIterator>
27  ECIContainer(SparseECIIterator eci_begin, SparseECIIterator eci_end,
28  OrbitIndexIterator index_begin) {
29  auto eci_it = eci_begin;
30  auto index_it = index_begin;
31  for (; eci_it != eci_end; ++eci_it, ++index_it) {
32  m_value.push_back(*eci_it);
33  m_index.push_back(*index_it);
34  }
35  }
36 
38  size_type size() const { return m_value.size(); }
39 
41  const std::vector<double> &value() const { return m_value; }
42 
44  const std::vector<size_type> &index() const { return m_index; }
45 
46  private:
48  std::vector<double> m_value;
49 
51  std::vector<size_type> m_index;
52 };
53 
55 double operator*(const ECIContainer &_eci, const Eigen::VectorXd &_corr);
56 
59 double operator*(const ECIContainer &_eci, double const *_corr_begin);
60 
61 } // namespace CASM
62 #endif
Clexulator_impl::Base::size_type size_type
Definition: Clexulator.hh:442
A sparse container of ECI values and their corresponding orbit indices.
Definition: ECIContainer.hh:12
size_type size() const
Number of eci specified (no guarentee they are all non-zero)
Definition: ECIContainer.hh:38
const std::vector< size_type > & index() const
const Access orbit indices of ECI values
Definition: ECIContainer.hh:44
const std::vector< double > & value() const
const Access ECI values
Definition: ECIContainer.hh:41
Clexulator::size_type size_type
Definition: ECIContainer.hh:14
ECIContainer(SparseECIIterator eci_begin, SparseECIIterator eci_end, OrbitIndexIterator index_begin)
Construct from range of ECI values and corresponding orbit indices.
Definition: ECIContainer.hh:27
ECIContainer()
Default constructor.
Definition: ECIContainer.hh:17
std::vector< double > m_value
Efective cluster interaction values.
Definition: ECIContainer.hh:48
std::vector< size_type > m_index
Orbit index for each coefficient in m_value.
Definition: ECIContainer.hh:51
Main CASM namespace.
Definition: APICommand.hh:8
BasisSet operator*(const SymOp &LHS, const BasisSet &RHS)
Definition: BasisSet.cc:1408
Eigen::VectorXd VectorXd