Accumulating histogram of component values. Specified bin resolution, automatic generation of bins. More...
Public Types | |
| typedef pTraits< Type >::cmptType | cmptType |
| Component type. More... | |
Public Member Functions | |
| Distribution () | |
| Construct null. More... | |
| Distribution (const Type &binWidth) | |
| Construct from separate binWidth for each component. More... | |
| Distribution (const Distribution &d) | |
| Construct as copy. More... | |
| ~Distribution () | |
| Destructor. More... | |
| scalar | totalWeight (direction cmpt) const |
| Sum the total weight added to the component in the. More... | |
| List< label > | keys (direction cmpt) const |
| label | index (direction cmpt, label n) |
| Return the appropriate List index for the given bin index. More... | |
| Pair< label > | validLimits (direction cmpt) const |
| Returns the indices of the first and last non-zero entries. More... | |
| Type | mean () const |
| Type | median () const |
| void | add (const Type &valueToAdd, const Type &weight=pTraits< Type >::one) |
| Add a value to the distribution, optionally specifying a weight. More... | |
| List< List< Pair< scalar > > > | normalised () const |
| Return the normalised distribution (probability density) More... | |
| List< List< Pair< scalar > > > | raw () const |
| Return the distribution of the total bin weights. More... | |
| List< List< Pair< scalar > > > | cumulativeNormalised () const |
| Return the cumulative normalised distribution and. More... | |
| List< List< Pair< scalar > > > | cumulativeRaw () const |
| Return the cumulative total bin weights and integration. More... | |
| void | clear () |
| Resets the Distribution by clearing the stored lists. More... | |
| const Type & | binWidth () const |
| Return the bin width. More... | |
| const List< label > & | listStarts () const |
| Return the List start bin indices. More... | |
| void | write (const fileName &filePrefix) const |
| Write the distribution to file: key normalised raw. More... | |
| void | operator= (const Distribution< Type > &) |
Friends | |
| Istream & | operator>> (Istream &, Distribution< Type > &) |
| Ostream & | operator (Ostream &, const Distribution< Type > &) |
Accumulating histogram of component values. Specified bin resolution, automatic generation of bins.
Definition at line 51 of file Distribution.H.
Component type.
Definition at line 80 of file Distribution.H.
| Distribution | ( | ) |
Construct null.
Definition at line 36 of file Distribution.C.
| Distribution | ( | const Type & | binWidth | ) |
Construct from separate binWidth for each component.
Definition at line 45 of file Distribution.C.
| Distribution | ( | const Distribution< Type > & | d | ) |
Construct as copy.
| ~Distribution | ( | ) |
Destructor.
Definition at line 65 of file Distribution.C.
| Foam::scalar totalWeight | ( | direction | cmpt | ) | const |
Sum the total weight added to the component in the.
argument
Definition at line 72 of file Distribution.C.
References forAll.
| Foam::List< Foam::label > keys | ( | direction | cmpt | ) | const |
Definition at line 88 of file Distribution.C.
References Foam::identity().
| Foam::label index | ( | direction | cmpt, |
| label | n | ||
| ) |
Return the appropriate List index for the given bin index.
Resizes the List if required
Definition at line 96 of file Distribution.C.
References forAll, n, List< T >::setSize(), and Foam::Zero.
| Foam::Pair< Foam::label > validLimits | ( | direction | cmpt | ) | const |
Returns the indices of the first and last non-zero entries.
Definition at line 162 of file Distribution.C.
References forAll, and Pair< T >::second().
| Type mean | ( | ) | const |
Definition at line 193 of file Distribution.C.
References Foam::component(), forAll, k, Foam::setComponent(), and Foam::Zero.
| Type median | ( | ) | const |
Definition at line 222 of file Distribution.C.
References Foam::component(), forAll, Foam::mag(), Foam::normalised(), Foam::setComponent(), and Foam::Zero.
Add a value to the distribution, optionally specifying a weight.
Definition at line 309 of file Distribution.C.
References Foam::component(), n, and Foam::neg().
| Foam::List< Foam::List< Foam::Pair< Foam::scalar > > > normalised | ( | ) | const |
Return the normalised distribution (probability density)
and bins
Definition at line 331 of file Distribution.C.
References Foam::component(), k, Pair< T >::second(), and List< T >::setSize().
| Foam::List< Foam::List< Foam::Pair< Foam::scalar > > > raw | ( | ) | const |
Return the distribution of the total bin weights.
Definition at line 379 of file Distribution.C.
References Foam::component(), k, Pair< T >::second(), and List< T >::setSize().
| Foam::List< Foam::List< Foam::Pair< Foam::scalar > > > cumulativeNormalised | ( | ) | const |
Return the cumulative normalised distribution and.
integration locations (at end of bins)
Definition at line 421 of file Distribution.C.
References Foam::component(), forAll, Foam::normalised(), and Foam::sum().
| Foam::List< Foam::List< Foam::Pair< Foam::scalar > > > cumulativeRaw | ( | ) | const |
Return the cumulative total bin weights and integration.
locations (at end of bins)
Definition at line 457 of file Distribution.C.
References Foam::component(), forAll, and Foam::sum().
| void clear | ( | ) |
Resets the Distribution by clearing the stored lists.
Leaves the same number of them and the same binWidth.
Definition at line 488 of file Distribution.C.
|
inline |
Return the bin width.
Definition at line 32 of file DistributionI.H.
|
inline |
Return the List start bin indices.
Definition at line 40 of file DistributionI.H.
| void write | ( | const fileName & | filePrefix | ) | const |
Write the distribution to file: key normalised raw.
Produces a separate file for each component.
Definition at line 500 of file Distribution.C.
References Foam::endl(), forAll, Foam::nl, and Foam::normalised().
| void operator= | ( | const Distribution< Type > & | rhs | ) |
Definition at line 557 of file Distribution.C.
|
friend |
|
friend |