45#include "applications/dynamicProps/SelectionCorrFunc.hpp"
48 SelectionCorrFunc::SelectionCorrFunc(SimInfo* info,
49 const std::string& filename,
50 const std::string& sele1,
51 const std::string& sele2) :
52 ObjectCCF<int>(info, filename, sele1, sele2) {
53 setCorrFuncType(
"SelectionCorrFunc");
54 setOutputName(
getPrefix(dumpFilename_) +
".selecorr");
56 selected1_.resize(nFrames_);
57 selected2_.resize(nFrames_);
60 int SelectionCorrFunc::computeProperty1(
int frame, StuntDouble* sd) {
61 selected1_[frame].push_back(sd->getGlobalIndex());
62 return selected1_[frame].size() - 1;
65 int SelectionCorrFunc::computeProperty2(
int frame, StuntDouble* sd) {
66 selected2_[frame].push_back(sd->getGlobalIndex());
67 return selected2_[frame].size() - 1;
70 int SelectionCorrFunc::calcCorrVal(
int frame1,
int frame2,
int id1,
int id2) {
71 if (selected1_[frame1][id1] == selected2_[frame2][id2])
return 1;
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)