28 #ifndef CHEMISTRY_QC_BASIS_KCLUSTER_HPP
29 #define CHEMISTRY_QC_BASIS_KCLUSTER_HPP
31 #include <chemistry/molecule/atom.h>
32 #include <chemistry/qc/basis/gaussbas.h>
33 #include <Eigen/Dense>
51 std::size_t mol_index()
const {
return mol_index_;}
57 std::size_t mol_index_;
68 using Vector3 = Eigen::Vector3d;
74 KCluster(
const Vector3 &pos = Vector3(0,0,0)) : center_(pos), atoms_()
78 center_ = rhs.center_;
84 atoms_.push_back(
Atom(atom, index));
89 atoms_.push_back(atom);
94 Vector3 atom_vec(atom.
r(0), atom.
r(1), atom.
r(2));
96 return (atom_vec - center_).norm();
99 const Vector3&
center()
const {
return center_; }
105 std::size_t n_atoms =
natoms();
110 for(
auto i = 0; i < n_atoms; ++i){
127 std::sort(atoms_.begin(), atoms_.end(), [](
const Atom &a,
128 const Atom &b){
return a.mol_index() < b.mol_index();}
142 return atoms_.size();
145 const std::vector<Atom>& atoms()
const {
return atoms_;}
149 std::vector<Atom> atoms_;
class holds the information about the differnt clusters in k-means tiling.
Definition: kcluster.hpp:65
void guess_center()
Move the center to the centroid of the cluster and forget members.
Definition: kcluster.hpp:133
KCluster(const Vector3 &pos=Vector3(0, 0, 0))
Constructor takes an Eigen::Vector3d which designates the center of the cluster.
Definition: kcluster.hpp:74
Contains new MPQC code since version 3.
Definition: integralenginepool.hpp:37
double distance(const Atom &atom)
Finds distance to any atom to the center of the cluster.
Definition: kcluster.hpp:93
Definition: kcluster.hpp:41
void sort_atoms()
Sort the atoms so they are ordered by molecule index.
Definition: kcluster.hpp:126
Atom represents an atom in a Molecule.
Definition: atom.h:47
std::size_t natoms()
Return the index.
Definition: kcluster.hpp:141
const Vector3 & center() const
Returns the position vector of the center of the cluster.
Definition: kcluster.hpp:99
void add_atom(const sc::Atom &atom, std::size_t index)
Adds an atom to the cluster. Must know its index as well.
Definition: kcluster.hpp:83
double & r(int xyz)
Returns a reference to the x,y, or z coordinate.
Definition: atom.h:136
Vector3 centroid()
Returns the centorid of the cluster.
Definition: kcluster.hpp:103
void add_atom(const Atom &atom)
Adds an atom to the cluster. Must know its index as well.
Definition: kcluster.hpp:88
Generated at Sun Jan 26 2020 23:23:57 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.