19 #ifndef ATOMPROBE_HISTOGRAM_H 20 #define ATOMPROBE_HISTOGRAM_H 26 #include <gsl/gsl_histogram.h> 49 std::vector<std::vector<unsigned int> > &histogram,
float stepMass,
50 float endMass,
bool lowerTriangular=
false);
69 std::vector<std::vector<unsigned int> > &histogram,
float stepMass,
70 float endMass,
bool lowerTriangular=
true);
76 T end, T step, std::vector<T> &histVals)
79 ASSERT(step > std::numeric_limits<T>::epsilon());
81 gsl_histogram *h = gsl_histogram_alloc((end-start)/step);
82 gsl_histogram_set_ranges_uniform(h,start,end);
84 for(
size_t ui=0; ui<data.size();ui++)
85 gsl_histogram_increment(h,data[ui]);
88 histVals.resize(h->n);
89 #pragma omp parallel for 90 for(
size_t ui=0;ui<h->n; ui++)
91 histVals[ui]=h->bin[ui];
93 gsl_histogram_free(h);
bool accumulateCorrelationHistogram(const std::vector< EPOS_ENTRY > &eposIons, std::vector< std::vector< unsigned int > > &histogram, float stepMass, float endMass, bool lowerTriangular=true)
Increments a correlation histogram, as per correlationHistogram,.
void linearHistogram(const std::vector< T > &data, T start, T end, T step, std::vector< T > &histVals)
bool correlationHistogram(const std::vector< EPOS_ENTRY > &eposIons, std::vector< std::vector< unsigned int > > &histogram, float stepMass, float endMass, bool lowerTriangular=false)
Generates an ion "correlation histogram" from a vector of EPOS ions. The input vector MUST ...