FreeFOAM The Cross-Platform CFD Toolkit
distribution Class Reference

#include <molecularMeasurements/distribution.H>


Detailed Description

+ Inheritance diagram for distribution:
+ Collaboration diagram for distribution:

List of all members.

Public Member Functions

 distribution ()
 Construct null.
 distribution (const scalar binWidth)
 Construct from binWidth.
 distribution (const distribution &)
 Construct as copy.
 ~distribution ()
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.
void add (const label valueToAdd)
void insertMissingKeys ()
List< Pair< scalar > > normalised ()
List< Pair< scalar > > normalisedMinusMean ()
List< Pair< scalar > > normalisedShifted (const 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.
 Map (Istream &is)
 Construct from Istream.
 Map (const Map< label > &map)
 Construct as copy.
 Map (const Xfer< Map< label > > &map)
 Construct by transferring the parameter contents.
 Map (const Xfer< HashTable< label, label, Hash< label > > > &map)
 Construct by transferring the parameter contents.
- Public Member Functions inherited from HashTable< label, label, Hash< label > >
bool set (const label &, const label &newElmt)
 Assign a new hashedEntry, overwriting existing entries.
 HashTable (const label size=128)
 Construct given initial table size.
 HashTable (Istream &, const label size=128)
 Construct from Istream.
 HashTable (const HashTable< label, label, Hash< label > > &)
 Construct as copy.
 HashTable (const Xfer< HashTable< label, label, Hash< label > > > &)
 Construct by transferring the parameter contents.
 ~HashTable ()
label size () const
 Return number of elements in table.
bool empty () const
 Return true if the hash table is empty.
bool found (const label &) const
 Return true if hashedEntry is found in table.
iterator find (const label &)
 Find and return an iterator set at the hashedEntry.
const_iterator find (const label &) const
 Find and return an const_iterator set at the hashedEntry.
List< label > toc () const
 Return the table of contents.
List< label > sortedToc () const
 Return the table of contents as a sorted list.
OstreamprintInfo (Ostream &) const
 Print information.
bool insert (const label &, const label &newElmt)
 Insert a new hashedEntry.
bool erase (const iterator &)
 Erase an hashedEntry specified by given iterator.
bool erase (const label &)
 Erase an hashedEntry specified by given key if in table.
label erase (const UList< label > &)
 Remove entries given by the listed keys from this HashTable.
label erase (const HashTable< AnyType, label, AnyHash > &)
 Remove entries given by the given keys from this HashTable.
void resize (const label newSize)
 Resize the hash table for efficiency.
void clear ()
 Clear all entries from table.
void clearStorage ()
 Clear the table entries and the table itself.
void transfer (HashTable< label, label, Hash< label > > &)
 Transfer the contents of the argument table into this table.
Xfer< HashTable< label, label,
Hash< label > > > 
xfer ()
 Transfer contents to the Xfer container.
label & operator[] (const label &)
 Find and return an hashedEntry.
const label & operator[] (const label &) const
 Find and return an hashedEntry.
label & operator() (const label &)
 Find and return an hashedEntry, create it null if not present.
void operator= (const HashTable< label, label, Hash< label > > &)
 Assignment.
bool operator== (const HashTable< label, label, Hash< label > > &) const
 Equality. Two hash tables are equal if all contents of first are.
bool operator!= (const HashTable< label, label, Hash< label > > &) const
 The opposite of the equality operation. Takes linear time.
iterator begin ()
 iterator set to the begining of the HashTable
const_iterator begin () const
 const_iterator set to the beginning of the HashTable
const iterator & end ()
 iterator set to beyond the end of the HashTable
const const_iterator & end () const
 const_iterator set to beyond the end of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
const const_iterator & cend () const
 const_iterator set to beyond the end of the HashTable

Friends

Ostreamoperator<< (Ostream &, const distribution &)

Additional Inherited Members

- Public Types inherited from Map< label >
typedef HashTable< label,
label, Hash< label >
>::iterator 
iterator
typedef HashTable< label,
label, Hash< label >
>::const_iterator 
const_iterator
- Public Types inherited from HashTable< label, label, Hash< label > >
typedef label value_type
 Type of values the HashTable contains.
typedef label & reference
 Type that can be used for storing into HashTable::value_type.
typedef const label & const_reference
 Type that can be used for storing into constant.
typedef label size_type
 The type that can represent the size of a HashTable.

Constructor & Destructor Documentation

Construct null.

Definition at line 33 of file distribution.C.

distribution ( const scalar  binWidth)

Construct from binWidth.

Definition at line 40 of file distribution.C.

distribution ( const distribution d)

Construct as copy.

Definition at line 47 of file distribution.C.

Definition at line 56 of file distribution.C.


Member Function Documentation

label totalEntries ( ) const

Definition at line 62 of file distribution.C.

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

scalar approxTotalEntries ( ) const

Definition at line 90 of file distribution.C.

References forAllConstIter.

Referenced by distribution::mean(), and distribution::normalised().

scalar median ( )

Definition at line 126 of file distribution.C.

References forAll, distribution::normalised(), and List< T >::size().

void add ( const label  valueToAdd)

Definition at line 220 of file distribution.C.

References distribution::add().

List< Pair< scalar > > normalisedMinusMean ( )

Definition at line 274 of file distribution.C.

References distribution::mean(), and distribution::normalisedShifted().

List< Pair< scalar > > normalisedShifted ( const scalar  shiftValue)
Foam::scalar binWidth ( ) const
inline

Definition at line 28 of file distributionI.H.

Referenced by distribution::operator=().

void operator= ( const distribution rhs)

Friends And Related Function Documentation

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

Definition at line 426 of file distribution.C.


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