Public Member Functions | Static Public Member Functions | Private Attributes | Friends
distribution Class Reference

Accumulating histogram of values. Specified bin resolution automatic generation of bins. More...

Inheritance diagram for distribution:
Inheritance graph
[legend]
Collaboration diagram for distribution:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("distribution")
 Runtime type information. More...
 
 distribution ()
 Construct null. More...
 
 distribution (const scalar binWidth)
 Construct from binWidth. More...
 
 distribution (const distribution &)
 Construct as copy. More...
 
virtual ~distribution ()
 Destructor. More...
 
label totalEntries () const
 
scalar approxTotalEntries () const
 
scalar mean () const
 
scalar median ()
 
void add (const scalar valueToAdd)
 Add a value to the appropriate bin of the distribution. More...
 
void add (const label valueToAdd)
 
void insertMissingKeys ()
 
List< Pair< scalar > > normalised ()
 
List< Pair< scalar > > normalisedMinusMean ()
 
List< Pair< scalar > > normalisedShifted (scalar shiftValue)
 
List< Pair< scalar > > raw ()
 
scalar binWidth () const
 
void operator= (const distribution &)
 
- Public Member Functions inherited from Map< label >
 Map (const label size=128)
 Construct given initial size. More...
 
 Map (Istream &is)
 Construct from Istream. More...
 
 Map (const Map< T > &map)
 Construct as copy. More...
 
 Map (const Xfer< Map< T > > &map)
 Construct by transferring the parameter contents. More...
 
 Map (const Xfer< HashTable< T, label, Hash< label > > > &map)
 Construct by transferring the parameter contents. More...
 

Static Public Member Functions

static void write (const fileName &file, const List< Pair< scalar > > &pairs)
 Write to file. More...
 

Private Attributes

scalar binWidth_
 

Friends

Ostreamoperator<< (Ostream &, const distribution &)
 

Additional Inherited Members

- Public Types inherited from Map< label >
typedef HashTable< T, label, Hash< label > >::iterator iterator
 
typedef HashTable< T, label, Hash< label > >::const_iterator const_iterator
 

Detailed Description

Accumulating histogram of values. Specified bin resolution automatic generation of bins.

Source files

Definition at line 51 of file distribution.H.

Constructor & Destructor Documentation

◆ distribution() [1/3]

Construct null.

Definition at line 55 of file distribution.C.

◆ distribution() [2/3]

distribution ( const scalar  binWidth)

Construct from binWidth.

Definition at line 62 of file distribution.C.

◆ distribution() [3/3]

distribution ( const distribution d)

Construct as copy.

Definition at line 69 of file distribution.C.

◆ ~distribution()

~distribution ( )
virtual

Destructor.

Definition at line 78 of file distribution.C.

Member Function Documentation

◆ TypeName()

TypeName ( "distribution"  )

Runtime type information.

◆ write()

void write ( const fileName file,
const List< Pair< scalar > > &  pairs 
)
static

Write to file.

Definition at line 39 of file distribution.C.

References forAll, and Foam::nl.

◆ totalEntries()

Foam::label totalEntries ( ) const

Definition at line 84 of file distribution.C.

References Foam::endl(), forAllConstIter(), and WarningInFunction.

Here is the call graph for this function:

◆ approxTotalEntries()

Foam::scalar approxTotalEntries ( ) const

Definition at line 112 of file distribution.C.

References forAllConstIter().

Here is the call graph for this function:

◆ mean()

Foam::scalar mean ( ) const

Definition at line 125 of file distribution.C.

References forAll, and k.

◆ median()

Foam::scalar median ( )

Definition at line 148 of file distribution.C.

References forAll, and List::size().

Here is the call graph for this function:

◆ add() [1/2]

void add ( const scalar  valueToAdd)

Add a value to the appropriate bin of the distribution.

Definition at line 212 of file distribution.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, insert(), n, and Foam::neg().

Here is the call graph for this function:

◆ add() [2/2]

void add ( const label  valueToAdd)

Definition at line 242 of file distribution.C.

References Foam::add().

Here is the call graph for this function:

◆ insertMissingKeys()

void insertMissingKeys ( )

Definition at line 248 of file distribution.C.

References insert(), k, List::size(), and Foam::sort().

Here is the call graph for this function:

◆ normalised()

Foam::List< Foam::Pair< Foam::scalar > > normalised ( )

Definition at line 271 of file distribution.C.

References Foam::endl(), forAll, Foam::Info, k, and Foam::sort().

Here is the call graph for this function:

◆ normalisedMinusMean()

Foam::List< Foam::Pair< Foam::scalar > > normalisedMinusMean ( )

Definition at line 301 of file distribution.C.

◆ normalisedShifted()

Foam::List< Foam::Pair< Foam::scalar > > normalisedShifted ( scalar  shiftValue)

Definition at line 308 of file distribution.C.

References Foam::endl(), forAll, Foam::Info, Foam::nl, Foam::sign(), and List::size().

Here is the call graph for this function:

◆ raw()

Foam::List< Foam::Pair< Foam::scalar > > raw ( )

Definition at line 419 of file distribution.C.

References forAll, k, and Foam::sort().

Here is the call graph for this function:

◆ binWidth()

Foam::scalar binWidth ( ) const
inline

Definition at line 28 of file distributionI.H.

References distribution::binWidth_.

Referenced by distribution::operator=().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const distribution rhs)

Definition at line 444 of file distribution.C.

References Foam::abort(), distribution::binWidth(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream ,
const distribution  
)
friend

Field Documentation

◆ binWidth_

scalar binWidth_
private

Definition at line 57 of file distribution.H.

Referenced by distribution::binWidth().


The documentation for this class was generated from the following files: