CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigDatabase.cc
Go to the documentation of this file.
2 
3 #include <boost/range/iterator_range.hpp>
4 
5 #include "casm/clex/Supercell.hh"
6 
7 namespace CASM {
8 namespace DB {
9 
12  const std::string &scelname) const {
13  return boost::distance(scel_range(scelname));
14 }
15 
20  const Configuration &config) const {
21  auto range = scel_range(config.supercell().name());
22  auto res = std::find(range.begin(), range.end(), config);
23  if (res == range.end()) {
24  return end();
25  }
26  return res;
27 }
28 
29 } // namespace DB
30 } // namespace CASM
std::string scelname(const Structure &prim, const Lattice &superlat)
Make supercell name name [deprecated].
Definition: Supercell.cc:497
ConfigIO::GenericConfigFormatter< jsonParser > config()
Definition: ConfigIO.cc:777
Main CASM namespace.
Definition: APICommand.hh:8
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
Definition: algorithm.hh:16
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39