inlib  1.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
inlib::ntu::stat_looper< T > Class Template Reference
Inheritance diagram for inlib::ntu::stat_looper< T >:
Inheritance graph
[legend]
Collaboration diagram for inlib::ntu::stat_looper< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 stat_looper (base_ntu &a_ntu, const base_col &a_col)
virtual ~stat_looper ()
 stat_looper (const stat_looper &a_from)
stat_looperoperator= (const stat_looper &a_from)
bool process ()
mn () const
mx () const
S () const
S2 () const
uint64 counter () const

Protected Member Functions

virtual bool action (const T &a_v)

Protected Attributes

bool m_first
m_mn
m_mx
m_S
m_S2
uint64 m_counter

Detailed Description

template<class T>
class inlib::ntu::stat_looper< T >

Definition at line 790 of file aida.


Constructor & Destructor Documentation

template<class T >
inlib::ntu::stat_looper< T >::stat_looper ( base_ntu a_ntu,
const base_col a_col 
) [inline]

Definition at line 810 of file aida.

  : base_looper<T>(a_ntu,a_col)
  ,m_first(true)
  ,m_mn(T())
  ,m_mx(T())
  ,m_S(T())
  ,m_S2(T())
  ,m_counter(0)
  {}
template<class T >
virtual inlib::ntu::stat_looper< T >::~stat_looper ( ) [inline, virtual]

Definition at line 819 of file aida.

{}
template<class T >
inlib::ntu::stat_looper< T >::stat_looper ( const stat_looper< T > &  a_from) [inline]

Definition at line 821 of file aida.

  : base_looper<T>(a_from)
  ,m_first(true)
  ,m_mn(T())
  ,m_mx(T())
  ,m_S(T())
  ,m_S2(T())
  ,m_counter(0)
  {}

Member Function Documentation

template<class T >
virtual bool inlib::ntu::stat_looper< T >::action ( const T &  a_v) [inline, protected, virtual]

Implements inlib::ntu::base_looper< T >.

Definition at line 792 of file aida.

                                    {
    if(m_first) {
      m_mn = a_v;
      m_mx = a_v;
      m_S = a_v;
      m_S2 = a_v*a_v;

      m_first = false;
    } else {
      m_mn = inlib::mn<T>(m_mn,a_v);
      m_mx = inlib::mx<T>(m_mx,a_v);
      m_S += a_v;
      m_S2 += a_v*a_v;
    }
    m_counter++;
    return true; //continue looping.
  }
template<class T >
uint64 inlib::ntu::stat_looper< T >::counter ( ) const [inline]

Definition at line 857 of file aida.

{return m_counter;}
template<class T >
T inlib::ntu::stat_looper< T >::mn ( ) const [inline]

Definition at line 853 of file aida.

{return m_mn;}
template<class T >
T inlib::ntu::stat_looper< T >::mx ( ) const [inline]

Definition at line 854 of file aida.

{return m_mx;}
template<class T >
stat_looper& inlib::ntu::stat_looper< T >::operator= ( const stat_looper< T > &  a_from) [inline]

Definition at line 830 of file aida.

                                                   {
    base_looper<T>::operator=(a_from);
    m_first = true;
    m_mn = T();
    m_mx = T();
    m_S = T();
    m_S2 = T();
    m_counter = 0;
    return *this;
  }  
template<class T >
bool inlib::ntu::stat_looper< T >::process ( ) [inline]

Reimplemented from inlib::ntu::base_looper< T >.

Definition at line 841 of file aida.

                 {
    m_counter = 0;
    if(!base_looper<T>::process()) {
      m_mn = T();
      m_mx = T();
      m_S = T();
      m_S2 = T();
      m_counter = 0;
      return false;
    }
    return true;
  }
template<class T >
T inlib::ntu::stat_looper< T >::S ( ) const [inline]

Definition at line 855 of file aida.

{return m_S;}
template<class T >
T inlib::ntu::stat_looper< T >::S2 ( ) const [inline]

Definition at line 856 of file aida.

{return m_S2;}

Member Data Documentation

template<class T >
uint64 inlib::ntu::stat_looper< T >::m_counter [protected]

Definition at line 864 of file aida.

template<class T >
bool inlib::ntu::stat_looper< T >::m_first [protected]

Definition at line 859 of file aida.

template<class T >
T inlib::ntu::stat_looper< T >::m_mn [protected]

Definition at line 860 of file aida.

template<class T >
T inlib::ntu::stat_looper< T >::m_mx [protected]

Definition at line 861 of file aida.

template<class T >
T inlib::ntu::stat_looper< T >::m_S [protected]

Definition at line 862 of file aida.

template<class T >
T inlib::ntu::stat_looper< T >::m_S2 [protected]

Definition at line 863 of file aida.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines