Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.hpp

    r790807 r58ed4a  
    5151CorrelationToPointMap *PeriodicCorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point, const int ranges[NDIM] );
    5252CorrelationToSurfaceMap *PeriodicCorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] );
    53 double GetBin ( const double value, const double BinWidth, const double BinStart );
     53int GetBin ( const double value, const double BinWidth, const double BinStart );
    5454void OutputCorrelation( ofstream * const file, const BinPairMap * const map );
    5555void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map );
     
    7171
    7272  if (map == NULL) {
    73     eLog() << Verbose(0) << "Nothing to min/max, map is NULL!" << endl;
     73    DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to min/max, map is NULL!" << endl);
    7474    performCriticalExit();
    7575    return;
     
    103103{
    104104  BinPairMap *outmap = new BinPairMap;
    105   double bin = 0.;
     105  int bin = 0;
    106106  double start = 0.;
    107107  double end = 0.;
     
    109109
    110110  if (map == NULL) {
    111     eLog() << Verbose(0) << "Nothing to bin, is NULL!" << endl;
     111    DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to bin, is NULL!" << endl);
    112112    performCriticalExit();
    113113    return outmap;
     
    122122    start = BinStart;
    123123    end = BinEnd;
    124     for (double runner = start; runner <= end; runner += BinWidth)
    125       outmap->insert( pair<double, int> (runner, 0) );
    126124  }
     125  for (int runner = 0; runner <= ceil((end-start)/BinWidth); runner++)
     126    outmap->insert( pair<double, int> ((double)runner*BinWidth+start, 0) );
    127127
    128128  for (typename T::iterator runner = map->begin(); runner != map->end(); ++runner) {
    129129    bin = GetBin (runner->first, BinWidth, start);
    130     BinPairMapInserter = outmap->insert ( pair<double, int> (bin, 1) );
     130    BinPairMapInserter = outmap->insert ( pair<double, int> ((double)bin*BinWidth+start, 1) );
    131131    if (!BinPairMapInserter.second) {  // bin already present, increase
    132132      BinPairMapInserter.first->second += 1;
Note: See TracChangeset for help on using the changeset viewer.