Changeset e72287 for molecuilder


Ignore:
Timestamp:
Oct 17, 2009, 4:42:37 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
25e34b
Parents:
543794
Message:

Functions to output correlations directly added.

Location:
molecuilder/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/analysis_correlation.cpp

    r543794 re72287  
    142142  }
    143143};
     144
     145/** Prints correlation (double, (atom*,atom*) ) pairs to file.
     146 * \param *file file to write to
     147 * \param *map map to write
     148 */
     149void OutputPairCorrelation( ofstream *file, PairCorrelationMap *map )
     150{
     151  *file << "# BinStart\tAtom1\tAtom2" << endl;
     152  for (PairCorrelationMap::iterator runner = map->begin(); runner != map->end(); ++runner) {
     153    *file << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
     154  }
     155};
     156
     157/** Prints correlation (double, int) pairs to file.
     158 * \param *file file to write to
     159 * \param *map map to write
     160 */
     161void OutputCorrelationToPoint( ofstream *file, CorrelationToPointMap *map )
     162{
     163  *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl;
     164  for (CorrelationToPointMap::iterator runner = map->begin(); runner != map->end(); ++runner) {
     165    *file << runner->first;
     166    for (int i=0;i<NDIM;i++)
     167      *file << "\t" << (runner->second.first->node->x[i] - runner->second.second->x[i]);
     168    *file << endl;
     169  }
     170};
     171
     172/** Prints correlation (double, int) pairs to file.
     173 * \param *file file to write to
     174 * \param *map map to write
     175 */
     176void OutputCorrelationToSurface( ofstream *file, CorrelationToSurfaceMap *map )
     177{
     178  *file << "# BinStart\tTriangle" << endl;
     179  for (CorrelationToSurfaceMap::iterator runner = map->begin(); runner != map->end(); ++runner) {
     180    *file << runner->first << "\t" << *(runner->second.second) << endl;
     181  }
     182};
     183
  • molecuilder/src/analysis_correlation.hpp

    r543794 re72287  
    5050double GetBin ( double value, double BinWidth, double BinStart );
    5151void OutputCorrelation( ofstream *file, BinPairMap *map );
     52void OutputPairCorrelation( ofstream *file, BinPairMap *map );
     53void OutputCorrelationToPoint( ofstream *file, BinPairMap *map );
     54void OutputCorrelationToSurface( ofstream *file, BinPairMap *map );
    5255
    5356
Note: See TracChangeset for help on using the changeset viewer.