lib/MolecularFeaturizer.cpp
// write traj molecular features to file
write traj molecular features to file
write traj molecular features to file
bool writeMFtraj(std::vector<std::vector<double> >& mf_traj, string fname, vector<int>& frames){
  ofstream outFile;
  outFile.open(fname.c_str());
  if (mf_traj.size() != frames.size()){
    cout << "ERROR: Number of frames in traj and feature length do not match!" << endl;
    return 0;
  }
  for (unsigned int i=0; i < mf_traj.size(); i++){
    outFile << frames[i] << " ";
    for (unsigned int j=0; j < mf_traj[0].size(); j++){
      outFile << mf_traj[i][j] << " ";
    }
    outFile << std::endl;
  }
  return true;
}
bool writeMFtraj ( std :: vector < std :: vector < double > > & mf_traj , string fname , vector < int > & frames ) { ofstream outFile ; outFile . open ( fname . c_str ( ) ) ; if ( mf_traj . size ( ) != frames . size ( ) ) { cout << " " << endl ; return 0 ; } for ( unsigned int i = 0 ; i < mf_traj . size ( ) ; i ++ ) { outFile << frames [ i ] << " " ; for ( unsigned int j = 0 ; j < mf_traj [ 0 ] . size ( ) ; j ++ ) { outFile << mf_traj [ i ] [ j ] << " " ; } outFile << std :: endl ; } return true ; }
write traj molecular features to file
write traj molecular features to file