lib/AtomicFeaturizer.cpp
// featurizer for single eta & single selected_neighbor_atomname (if selected)
featurizer for single eta & single selected_neighbor_atomname (if selected)
featurizer for single eta & single selected_neighbor_atomname ( if selected )
bool AtomicFeaturizer::featurizeEta(const vector<vector<Atom*> >& neighbors,
                                    const vector<vector<double> >& pdin,
                                    const vector<vector<double> >& pdx,
                                    const vector<vector<double> >& pdy,
                                    const vector<vector<double> >& pdz,
                                    double cutoff, double eta, string ngh_select,
                                    Molecule* selMol,
                                    vector<double>& features){
  int natom = selMol->getNAtom();
  vector<double> xfeatures (natom);
  vector<double> yfeatures (natom);
  vector<double> zfeatures (natom);
  vector<double> featureOneAtm;
  Atom* ai;
  string atmname;
  for (unsigned int i=0; i < natom; i++){
    featureOneAtm.clear();
    ai = selMol->getAtom(i);
    atmname = ai->getAtmName();
    featurizeEtAtm(neighbors, pdin, pdx, pdy, pdz, cutoff, eta, ai, ngh_select, featureOneAtm);
    xfeatures[i] = featureOneAtm[0];
    yfeatures[i] = featureOneAtm[1];
    zfeatures[i] = featureOneAtm[2];
  }
  for (unsigned j = 0; j < natom; j ++){
    features.push_back(xfeatures[j]);
    features.push_back(yfeatures[j]);
    features.push_back(zfeatures[j]);
  }
  return 0;
}
bool AtomicFeaturizer :: featurizeEta ( const vector < vector < Atom * > > & neighbors , const vector < vector < double > > & pdin , const vector < vector < double > > & pdx , const vector < vector < double > > & pdy , const vector < vector < double > > & pdz , double cutoff , double eta , string ngh_select , Molecule * selMol , vector < double > & features ) { int natom = selMol -> getNAtom ( ) ; vector < double > xfeatures ( natom ) ; vector < double > yfeatures ( natom ) ; vector < double > zfeatures ( natom ) ; vector < double > featureOneAtm ; Atom * ai ; string atmname ; for ( unsigned int i = 0 ; i < natom ; i ++ ) { featureOneAtm . clear ( ) ; ai = selMol -> getAtom ( i ) ; atmname = ai -> getAtmName ( ) ; featurizeEtAtm ( neighbors , pdin , pdx , pdy , pdz , cutoff , eta , ai , ngh_select , featureOneAtm ) ; xfeatures [ i ] = featureOneAtm [ 0 ] ; yfeatures [ i ] = featureOneAtm [ 1 ] ; zfeatures [ i ] = featureOneAtm [ 2 ] ; } for ( unsigned j = 0 ; j < natom ; j ++ ) { features . push_back ( xfeatures [ j ] ) ; features . push_back ( yfeatures [ j ] ) ; features . push_back ( zfeatures [ j ] ) ; } return 0 ; }
featurizer for single eta & single selected_neighbor_atomname (if selected)
featurizer for single eta & single selected_neighbor_atomname ( if selected )
// ngh_select: NEIGHBOR atmname to be considered to calculate features; //             leave empty when not specified, all atoms will be taken into consideration // initialize feature vectors // initialize parameters // cleanup for current atom // push back into feature vector in the order of // 1x 1y 1z 2x 2y 2z 3x 3y 3z ...