31 #if defined(Histogram_RECURSES) 32 #error Recursive header files inclusion detected in Histogram.h 33 #else // defined(Histogram_RECURSES) 35 #define Histogram_RECURSES 37 #if !defined Histogram_h 44 #include "DGtal/base/Common.h" 45 #include "DGtal/base/Clone.h" 46 #include "DGtal/math/CBinner.h" 47 #include "DGtal/kernel/CEuclideanRing.h" 48 #include "DGtal/math/Statistic.h" 63 template <
typename TQuantity>
85 : myMin( min ), myMax( max ), myNb( n )
89 myWidth = ( max - min ) / static_cast<Quantity>( n );
143 template <
typename TQuantity,
150 BOOST_STATIC_ASSERT(( boost::is_same< TQuantity, typename TBinner::Quantity >::value ));
157 typedef typename Binner::Bin
Bin;
209 void addValue( Quantity q );
217 template <
typename TInputIterator>
218 void addValues( TInputIterator it, TInputIterator itE );
229 Bin bin( Quantity q )
const;
246 Size nb( Bin b )
const;
253 Size accumulation( Bin b )
const;
259 double pdf( Bin b )
const;
265 double cdf( Bin b )
const;
274 void selfDisplay ( std::ostream & out )
const;
280 bool isValid()
const;
317 void prepare( Bin size );
329 template <
typename TQuantity,
typename TBinner>
331 operator<< ( std::ostream & out, const Histogram<TQuantity, TBinner> & object );
338 #include "DGtal/math/Histogram.ih" 343 #endif // !defined Histogram_h 345 #undef Histogram_RECURSES 346 #endif // else defined(Histogram_RECURSES) const Binner * myBinner
The binner that places quantities into a bin.
Container::const_iterator ConstIterator
boost::uint32_t uint32_t
unsigned 32-bit integer.
Aim: Represents a typical histogram in statistics, which is a discrete estimate of the probability di...
Aim: This class processes a set of sample values for one variable and can then compute different stat...
K init(Point(0, 0, 0), Point(512, 512, 512), true)
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Histogram< Quantity, Binner > Self
Bin operator()(const Quantity &q) const
Aim: The traits class for all models of Cinteger.
RegularBinner(const Quantity &min, const Quantity &max, Bin n)
DGtal is the top-level namespace which contains all DGtal functions and types.
Container myHistogram
The histogram data.
boost::uint64_t uint64_t
unsigned 64-bit integer.
std::vector< Size > Container
Container myCumulativeHistogram
The cumulative histogram data.
Aim: Represents an object that places a quantity into a bin, i.e. a functor that associates a natural...
Aim: Represents an elementary functor that partitions quantities into regular intervals, given a range [min,max] range and a number nb of intervals (each interval is called a bin).
RegularBinner< Quantity > Self