X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fanalysisdata%2Fmodules%2Fhistogram.cpp;h=fd6727ff91aa53d4fec623f54db339cde280a4e9;hb=fdad87f6637e6a59152b851bd033195f4e376c0b;hp=24f67024a74217c8391166d56b187ce72c51080b;hpb=982c4f9cd49002caeaacf9142af0f25aed3c345b;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/analysisdata/modules/histogram.cpp b/src/gromacs/analysisdata/modules/histogram.cpp index 24f67024a7..fd6727ff91 100644 --- a/src/gromacs/analysisdata/modules/histogram.cpp +++ b/src/gromacs/analysisdata/modules/histogram.cpp @@ -333,6 +333,7 @@ AbstractAverageHistogram::clone() const { AverageHistogramPointer dest(new StaticAverageHistogram()); copyContents(this, dest.get()); + dest->settings_ = settings_; return dest; } @@ -354,6 +355,24 @@ AbstractAverageHistogram::normalizeProbability() } } +void +AbstractAverageHistogram::makeCumulative() +{ + for (int c = 0; c < columnCount(); ++c) + { + double sum = 0; + for (int i = 0; i < rowCount(); ++i) + { + sum += value(i, c).value(); + // Clear the error, as we don't cumulate that. + value(i, c).clear(); + value(i, c).setValue(sum); + } + } + setXAxis(settings().firstEdge() + settings().binWidth(), + settings().binWidth()); +} + void AbstractAverageHistogram::scaleSingle(int index, real factor)