CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClusterInvariants_stream_io.cc
Go to the documentation of this file.
2 
3 #include <iomanip>
4 
6 
7 namespace CASM {
8 
10 std::ostream &operator<<(std::ostream &sout,
11  ClusterInvariants const &invariants) {
12  if (invariants.size() <= 1) {
13  sout << " #Points: " << invariants.size();
14  } else {
15  sout << " #Points: " << invariants.size();
16  sout << " Site Distances: {";
17  for (int i = 0; i < invariants.displacement().size(); i++) {
18  if (i != 0) {
19  sout << ", ";
20  }
21  sout << std::setprecision(5) << invariants.displacement()[i];
22  }
23  sout << "}";
24  }
25  return sout;
26 }
27 
29 std::ostream &operator<<(std::ostream &sout,
30  WithinScelClusterInvariants const &invariants) {
31  if (invariants.size() <= 1) {
32  sout << " #Points: " << invariants.size();
33  } else {
34  sout << " #Points: " << invariants.size();
35  sout << " Site Distances: {";
36  for (int i = 0; i < invariants.displacement().size(); i++) {
37  if (i != 0) {
38  sout << ", ";
39  }
40  sout << std::setprecision(5) << invariants.displacement()[i];
41  }
42  sout << "}";
43  }
44  return sout;
45 }
46 
47 } // namespace CASM
Stores cluster invariants: number of sites and site distances.
int size() const
Number of elements in the cluster.
std::vector< double > const & displacement() const
const Access displacements between coordinates in the cluster, sorted in ascending order
Stores cluster invariants: number of sites and site distances (using robust_min_dist)
int size() const
Number of elements in the cluster.
std::vector< double > const & displacement() const
const Access displacements between coordinates in the cluster, sorted in ascending order,...
Main CASM namespace.
Definition: APICommand.hh:8
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)