distribution Class Reference

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

Inheritance diagram for distribution:
[legend]
Collaboration diagram for distribution:
[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 ()
 Default construct with default table capacity. More...
 
 Map (const label size)
 Construct with given initial table capacity. More...
 
 Map (Istream &is)
 Construct from Istream with default table capacity. More...
 
 Map (const this_type &map)
 Copy construct. More...
 
 Map (this_type &&map)
 Move construct. More...
 
 Map (std::initializer_list< std::pair< label, label >> map)
 Construct from an initializer list. More...
 
void operator= (const this_type &rhs)
 Copy assignment. More...
 
void operator= (this_type &&rhs)
 Move assignment. More...
 
void operator= (const this_type &rhs)
 Copy assign. More...
 
void operator= (std::initializer_list< std::pair< Key, label >> rhs)
 Copy assign from an initializer list. More...
 
void operator= (this_type &&rhs)
 Move assign. More...
 

Static Public Member Functions

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

Friends

Ostreamoperator<< (Ostream &, const distribution &)
 

Additional Inherited Members

- Public Types inherited from Map< label >
typedef Map< label > this_type
 The template instance used for this Map. More...
 
typedef HashTable< label, label, Hash< label > > parent_type
 The template instance used for the parent HashTable. More...
 
using iterator = typename parent_type::iterator
 
using const_iterator = typename parent_type::const_iterator
 

Detailed Description

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

Source files

Definition at line 61 of file distribution.H.

Constructor & Destructor Documentation

◆ distribution() [1/3]

Construct null.

Definition at line 58 of file distribution.C.

◆ distribution() [2/3]

distribution ( const scalar  binWidth)

Construct from binWidth.

Definition at line 65 of file distribution.C.

◆ distribution() [3/3]

distribution ( const distribution d)

Construct as copy.

Definition at line 72 of file distribution.C.

◆ ~distribution()

~distribution ( )
virtual

Destructor.

Definition at line 81 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 42 of file distribution.C.

References forAll, Foam::nl, and os().

Here is the call graph for this function:

◆ totalEntries()

Foam::label totalEntries ( ) const

Definition at line 87 of file distribution.C.

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

Here is the call graph for this function:

◆ approxTotalEntries()

Foam::scalar approxTotalEntries ( ) const

Definition at line 115 of file distribution.C.

References forAllConstIters().

Here is the call graph for this function:

◆ mean()

Foam::scalar mean ( ) const

Definition at line 128 of file distribution.C.

References forAll, k, and Foam::glTF::key().

Here is the call graph for this function:

◆ median()

Foam::scalar median ( )

Definition at line 151 of file distribution.C.

References forAll, and Foam::normalised().

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 215 of file distribution.C.

References Foam::abort(), stdFoam::begin(), stdFoam::end(), Foam::FatalError, FatalErrorInFunction, Foam::ListOps::find(), insert(), n, and Foam::neg().

Here is the call graph for this function:

◆ add() [2/2]

void add ( const label  valueToAdd)

Definition at line 245 of file distribution.C.

References Foam::add().

Here is the call graph for this function:

◆ insertMissingKeys()

void insertMissingKeys ( )

Definition at line 251 of file distribution.C.

References insert(), and k.

Here is the call graph for this function:

◆ normalised()

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

Definition at line 266 of file distribution.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Info, k, and Foam::glTF::key().

Here is the call graph for this function:

◆ normalisedMinusMean()

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

Definition at line 293 of file distribution.C.

◆ normalisedShifted()

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

Definition at line 300 of file distribution.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Info, Foam::nl, Foam::normalised(), and Foam::sign().

Here is the call graph for this function:

◆ raw()

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

Definition at line 411 of file distribution.C.

References forAll, k, and Foam::glTF::key().

Here is the call graph for this function:

◆ binWidth()

Foam::scalar binWidth ( ) const
inline

Definition at line 30 of file distributionI.H.

Referenced by distribution::operator=().

Here is the caller graph for this function:

◆ operator=()

void operator= ( const distribution rhs)

Definition at line 433 of file distribution.C.

References distribution::binWidth(), and Map< T >::operator=().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

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

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