CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Correlation.hh
Go to the documentation of this file.
1 #ifndef CASM_CORRELATION_HH
2 #define CASM_CORRELATION_HH
3 
4 #include "casm/external/Eigen/Dense"
6 
7 namespace CASM {
8 
10 
11  template<class U>
12  void match_shape(Correlation &corr, const Array<Array<Array<U> > > &thing) {
13 
14  //resize(thing.size());
15  Index num_corr = 0;
16  for(Index i = 0; i < thing.size(); i++) {
17  //at(i).resize(thing[i].size());
18  for(Index j = 0; j < thing[i].size(); j++) {
19  num_corr += thing[i][j].size();
20  }
21  }
22  corr = Eigen::VectorXd::Zero(num_corr);
23  }
24 
25  template<class ClustType>
26  void match_shape(Correlation &corr, const GenericOrbitree<ClustType> &tree) {
27  Index num_corr = 0;
28  for(Index i = 0; i < tree.size(); i++) {
29  for(Index j = 0; j < tree[i].size(); j++) {
30  num_corr += tree.prototype(i, j).clust_basis.size();
31  }
32  }
33  corr = Eigen::VectorXd::Zero(num_corr);
34  }
35 }
36 
37 #endif
void match_shape(Correlation &corr, const Array< Array< Array< U > > > &thing)
Definition: Correlation.hh:12
Main CASM namespace.
Definition: complete.cpp:8
EigenIndex Index
For long integer indexing:
Eigen::VectorXd VectorXd
Eigen::VectorXd Correlation
Definition: Correlation.hh:9
const ClustType & prototype(Index np, Index no) const
Access prototype of orbit (np, no)
Basic std::vector like container (deprecated)
Index size(Index np) const
Number of orbits in OrbitBranch 'np'.