Public Member Functions | Private Attributes
BinSum< IndexType, List, CombineOp > Class Template Reference

Sums into bins. More...

Inheritance diagram for BinSum< IndexType, List, CombineOp >:
Inheritance graph
[legend]
Collaboration diagram for BinSum< IndexType, List, CombineOp >:
Collaboration graph
[legend]

Public Member Functions

 BinSum (const IndexType min, const IndexType max, const IndexType delta)
 Construct given min, max, delta. More...
 
 BinSum (const IndexType min, const IndexType max, const IndexType delta, const UList< IndexType > &indexVals, const List &vals, const CombineOp &cop=plusEqOp< typename List::value_type >())
 Construct given min, max, delta and data. More...
 
IndexType delta () const
 Return the delta. More...
 
const IndexType & lowSum () const
 Return the sum of all added elements < min. More...
 
const IndexType & highSum () const
 Return the sum of all added elements >= max. More...
 
void add (const IndexType &indexVal, const typename List::const_reference val, const CombineOp &cop=plusEqOp< typename List::value_type >())
 
void add (const UList< IndexType > &indexVals, const List &vals, const CombineOp &cop=plusEqOp< typename List::value_type >())
 
- Public Member Functions inherited from List
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
template<class InputIterator >
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
template<unsigned Size>
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
label size () const
 Return the number of elements in the UList. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 
template<class T >
 List (const label s)
 
template<class T >
 List (const label s, const T &a)
 
template<class T >
 List (const List< T > &a)
 
template<class T >
 List (const Xfer< List< T > > &lst)
 
template<class T >
 List (List< T > &a, bool reUse)
 
template<class T >
 List (const UList< T > &a, const labelUList &map)
 
template<class T >
 List (const PtrList< T > &lst)
 
template<class T >
 List (const SLList< T > &lst)
 
template<class T >
 List (const UIndirectList< T > &lst)
 
template<class T >
 List (const BiIndirectList< T > &lst)
 
template<class T >
void transfer (List< T > &a)
 
template<class T >
void transfer (SortableList< T > &a)
 
template<class T >
 List ()
 
template<class T >
 List (Istream &is)
 

Private Attributes

const IndexType min_
 
const IndexType max_
 
const IndexType delta_
 
List::value_type lowSum_
 Sum < lowest bin. More...
 
List::value_type highSum_
 Sum of >= highest bin. More...
 

Additional Inherited Members

- Public Types inherited from List
typedef SubList< TsubList
 Declare type of subList. More...
 
- Static Public Member Functions inherited from List
static const List< T > & null ()
 Return a null List. More...
 
- Protected Member Functions inherited from List
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Detailed Description

template<class IndexType, class List, class CombineOp = plusEqOp<typename List::value_type>>
class Foam::BinSum< IndexType, List, CombineOp >

Sums into bins.

Source files

Definition at line 55 of file BinSum.H.

Constructor & Destructor Documentation

◆ BinSum() [1/2]

BinSum ( const IndexType  min,
const IndexType  max,
const IndexType  delta 
)

Construct given min, max, delta.

Definition at line 32 of file BinSum.C.

◆ BinSum() [2/2]

BinSum ( const IndexType  min,
const IndexType  max,
const IndexType  delta,
const UList< IndexType > &  indexVals,
const List vals,
const CombineOp &  cop = plusEqOp<typename List::value_type>() 
)

Construct given min, max, delta and data.

Definition at line 49 of file BinSum.C.

References Foam::add(), and forAll.

Here is the call graph for this function:

Member Function Documentation

◆ delta()

IndexType delta ( ) const
inline

Return the delta.

Definition at line 101 of file BinSum.H.

References BinSum< IndexType, List, CombineOp >::delta_.

◆ lowSum()

const IndexType& lowSum ( ) const
inline

Return the sum of all added elements < min.

Definition at line 107 of file BinSum.H.

References BinSum< IndexType, List, CombineOp >::lowSum_.

◆ highSum()

const IndexType& highSum ( ) const
inline

Return the sum of all added elements >= max.

Definition at line 113 of file BinSum.H.

References BinSum< IndexType, List, CombineOp >::highSum_.

◆ add() [1/2]

void add ( const IndexType &  indexVal,
const typename List::const_reference  val,
const CombineOp &  cop = plusEqOp<typename List::value_type>() 
)

Definition at line 76 of file BinSum.C.

Referenced by main().

Here is the caller graph for this function:

◆ add() [2/2]

void add ( const UList< IndexType > &  indexVals,
const List vals,
const CombineOp &  cop = plusEqOp<typename List::value_type>() 
)

Definition at line 100 of file BinSum.C.

References Foam::add(), and forAll.

Here is the call graph for this function:

Field Documentation

◆ min_

const IndexType min_
private

Definition at line 61 of file BinSum.H.

◆ max_

const IndexType max_
private

Definition at line 63 of file BinSum.H.

◆ delta_

const IndexType delta_
private

Definition at line 65 of file BinSum.H.

Referenced by BinSum< IndexType, List, CombineOp >::delta().

◆ lowSum_

List::value_type lowSum_
private

Sum < lowest bin.

Definition at line 69 of file BinSum.H.

Referenced by BinSum< IndexType, List, CombineOp >::lowSum().

◆ highSum_

List::value_type highSum_
private

Sum of >= highest bin.

Definition at line 72 of file BinSum.H.

Referenced by BinSum< IndexType, List, CombineOp >::highSum().


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