#include <molecularMeasurements/distribution.H>
Definition at line 50 of file distribution.H.
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 &) |
![]() | |
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. | |
![]() | |
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. | |
Ostream & | printInfo (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 | |
Ostream & | operator<< (Ostream &, const distribution &) |
Additional Inherited Members | |
![]() | |
typedef HashTable< label, label, Hash< label > >::iterator | iterator |
typedef HashTable< label, label, Hash< label > >::const_iterator | const_iterator |
![]() | |
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. |
distribution | ( | ) |
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.
~distribution | ( | ) |
Definition at line 56 of file distribution.C.
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 mean | ( | ) | const |
Definition at line 103 of file distribution.C.
References distribution::approxTotalEntries(), forAll, k(), and HashTable< label, label, Hash< label > >::toc().
Referenced by distribution::normalisedMinusMean().
scalar median | ( | ) |
Definition at line 126 of file distribution.C.
References forAll, distribution::normalised(), and List< T >::size().
void add | ( | const scalar | valueToAdd | ) |
Add a value to the appropriate bin of the distribution.
Definition at line 190 of file distribution.C.
References Foam::abort(), HashTable< label, label, Hash< label > >::begin(), HashTable< label, label, Hash< label > >::end(), Foam::FatalError, FatalErrorIn, HashTable< label, label, Hash< label > >::find(), HashTable< label, label, Hash< label > >::insert(), and Foam::neg().
Referenced by distribution::add().
void add | ( | const label | valueToAdd | ) |
Definition at line 220 of file distribution.C.
References distribution::add().
void insertMissingKeys | ( | ) |
Definition at line 226 of file distribution.C.
References HashTable< label, label, Hash< label > >::begin(), HashTable< label, label, Hash< label > >::end(), HashTable< label, label, Hash< label > >::find(), HashTable< label, label, Hash< label > >::insert(), k(), List< T >::size(), Foam::sort(), and HashTable< label, label, Hash< label > >::toc().
Referenced by distribution::normalised(), and distribution::raw().
Definition at line 249 of file distribution.C.
References distribution::approxTotalEntries(), forAll, distribution::insertMissingKeys(), k(), HashTable< label, label, Hash< label > >::size(), Foam::sort(), and HashTable< label, label, Hash< label > >::toc().
Referenced by distribution::median(), and distribution::normalisedShifted().
Definition at line 274 of file distribution.C.
References distribution::mean(), and distribution::normalisedShifted().
Definition at line 280 of file distribution.C.
References forAll, distribution::normalised(), Foam::sign(), and List< T >::size().
Referenced by distribution::normalisedMinusMean().
Definition at line 383 of file distribution.C.
References forAll, distribution::insertMissingKeys(), k(), HashTable< label, label, Hash< label > >::size(), Foam::sort(), and HashTable< label, label, Hash< label > >::toc().
|
inline |
Definition at line 28 of file distributionI.H.
Referenced by distribution::operator=().
void operator= | ( | const distribution & | rhs | ) |
Definition at line 408 of file distribution.C.
References Foam::abort(), distribution::binWidth(), Foam::FatalError, and FatalErrorIn.
|
friend |
Definition at line 426 of file distribution.C.