template <class T> void GroupBin(const vector<T>& inArray, const Integer mode, const grouping& GroupInfo, vector<T>& outArray)
template <class T> void GroupBin(const valarray<T>& inArray, const Integer mode, const grouping& GroupInfo, valarray<T>& outArray)
This routine applies GroupInfo to the input inArray to create the output outArray. The behavior is determined by mode which can take five values: SumMode which adds the contents of all bins in a group; SumQuadMode which adds the bins in quadrature; MeanMode which returns the arithmetic mean of the all bins in a group; FirstEltMode which returns the value of the first bin in each group; LastEltMode which returns the value of the last bin in each group.
Integer readBinFactors(string filename, vector<Integer>& StartBin, vector<Integer>& EndBin, vector<Integer>& BinFactor)
Read a file containing grouping information and place into the arrays StartBin, EndBin and BinFactor. Each line of the file should have three numbers, the start bin, end bin, and grouping factor.