ClusteringBase::ClusteringBase(const ActionOptions&ao): Action(ao), ActionWithInputMatrix(ao), number_of_cluster(-1) { if( getAdjacencyVessel() ) { cluster_sizes.resize(getNumberOfNodes()); which_cluster.resize(getNumberOfNodes()); if( getNumberOfNodeTypes()!=1 ) error("should only be running clustering with one base multicolvar in function"); if( !getAdjacencyVessel()->undirectedGraph() ) error("input contact matrix is incompatible with clustering"); } if( keywords.exists("MATRIX") ) { std::vector<AtomNumber> fake_atoms; setupMultiColvarBase( fake_atoms ); } }
void ClusteringBase::turnOnDerivatives() { // Check base multicolvar isn't density probably other things shouldn't be allowed here as well if( (getAdjacencyVessel()->getMatrixAction())->getNumberOfBaseMultiColvars()>0 ) { if( getBaseMultiColvar(0)->isDensity() ) error("DFS clustering cannot be differentiated if base multicolvar is DENSITY"); } // Ensure that derivatives are turned on in base classes ActionWithInputMatrix::turnOnDerivatives(); }
Vector ActionWithInputMatrix::getPositionOfAtomForLinkCells( const unsigned& iatom ) const { return (getAdjacencyVessel()->function)->getPositionOfAtomForLinkCells( iatom ); }
double ClusteringBase::getCutoffForConnection() const { return getAdjacencyVessel()->getCutoffForConnection(); }
bool ClusteringBase::areConnected( const unsigned& iatom, const unsigned& jatom ) const { return getAdjacencyVessel()->nodesAreConnected( iatom, jatom ); }