CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ECIContainer.cc
Go to the documentation of this file.
2 
3 #include <fstream>
4 
6 
7 namespace CASM {
8 
10 double operator*(const ECIContainer &_eci, const Eigen::VectorXd &_corr) {
11  double result(0);
12  auto ind_it(_eci.index().cbegin()), ind_end(_eci.index().cend());
13  auto eci_it(_eci.value().cbegin());
14  for (; ind_it != ind_end; ++ind_it, ++eci_it)
15  result += (*eci_it) * _corr[*ind_it];
16  return result;
17 }
18 
21 double operator*(const ECIContainer &_eci, double const *_corr_begin) {
22  double result(0);
23  auto ind_it(_eci.index().cbegin()), ind_end(_eci.index().cend());
24  auto eci_it(_eci.value().cbegin());
25  while (ind_it != ind_end) {
26  result += (*eci_it) * (*(_corr_begin + *ind_it));
27  ++ind_it;
28  ++eci_it;
29  }
30  return result;
31 }
32 
33 } // namespace CASM
A sparse container of ECI values and their corresponding orbit indices.
Definition: ECIContainer.hh:12
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
Main CASM namespace.
Definition: APICommand.hh:8
BasisSet operator*(const SymOp &LHS, const BasisSet &RHS)
Definition: BasisSet.cc:1408
Eigen::VectorXd VectorXd