1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Calculates the counts per bin of a list.
33 \*---------------------------------------------------------------------------*/
38 #include "labelList.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class Histogram Declaration
48 \*---------------------------------------------------------------------------*/
58 //- Number of <= lowest bin
61 //- Number of > highest bin
65 // Private Member Functions
67 void count(const List& bins, const List& l);
69 //- Disallow default bitwise copy construct
70 Histogram(const Histogram&);
72 //- Disallow default bitwise assignment
73 void operator=(const Histogram&);
80 //- Construct given bin values and input list
81 Histogram(const List& bins, const List& l);
83 //- Construct given min, max, number of bins and input list
86 const typename List::const_reference min,
87 const typename List::const_reference max,
95 //- Return the counts per bin
96 inline const labelList& counts() const
101 //- Return the number of elements <= bins[0]
102 // (so inclusive lowest bin value)
103 inline label nLow() const
108 //- Return the number of elements > bins[bins.size()-1]
109 // (so exclusive highest bin value)
110 inline label nHigh() const
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 } // End namespace Foam
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 //# include "HistogramI.H"
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 # include "Histogram.C"
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 // ************************************************************************* //