PLearn 0.1
Public Member Functions
PLearn::StatsItArray Class Reference

#include <StatsIterator.h>

Inheritance diagram for PLearn::StatsItArray:
Inheritance graph
[legend]
Collaboration diagram for PLearn::StatsItArray:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StatsItArray ()
 StatsItArray (const StatsIt &statsit)
 StatsItArray (const StatsIt &statsit1, const StatsIt &statsit2)
 StatsItArray (const Array< StatsIt > &va)
 StatsItArray (Array< StatsIt > &va)
 StatsItArray (const StatsItArray &va)
StatsItArrayoperator&= (const StatsIt &v)
StatsItArrayoperator&= (const StatsItArray &va)
StatsItArray operator& (const StatsIt &v) const
StatsItArray operator& (const StatsItArray &va) const
void init (int inputsize)
void update (const Vec &input)
void update (const Mat &inputs)
bool requiresMultiplePasses ()
 returns true if any of the StatsIterator in the array requires more than one pass through the data
StatsItArray finish ()
 returns an array of those that are not yet finished
Array< VecgetResults ()
Array< VeccomputeStats (VMat data)

Detailed Description

Definition at line 378 of file StatsIterator.h.


Constructor & Destructor Documentation

PLearn::StatsItArray::StatsItArray ( )

Definition at line 746 of file StatsIterator.cc.

    : Array<StatsIt>(0,5)
{}
PLearn::StatsItArray::StatsItArray ( const StatsIt statsit)

Definition at line 750 of file StatsIterator.cc.

    : Array<StatsIt>(1,5)
{ (*this)[0] = statsit; }
PLearn::StatsItArray::StatsItArray ( const StatsIt statsit1,
const StatsIt statsit2 
)

Definition at line 754 of file StatsIterator.cc.

    : Array<StatsIt>(2,5)
{
    (*this)[0] = statsit1;
    (*this)[1] = statsit2;
}
PLearn::StatsItArray::StatsItArray ( const Array< StatsIt > &  va) [inline]

Definition at line 385 of file StatsIterator.h.

: Array<StatsIt>(va) {}
PLearn::StatsItArray::StatsItArray ( Array< StatsIt > &  va) [inline]

Definition at line 386 of file StatsIterator.h.

: Array<StatsIt>(va) {}
PLearn::StatsItArray::StatsItArray ( const StatsItArray va) [inline]

Definition at line 387 of file StatsIterator.h.

: Array<StatsIt>(va) {}

Member Function Documentation

Array< Vec > PLearn::StatsItArray::computeStats ( VMat  data)

Definition at line 807 of file StatsIterator.cc.

References finish(), getResults(), i, init(), PLearn::TVec< StatsIt >::input(), PLearn::VMat::length(), PLearn::TVec< T >::size(), update(), and PLearn::VMat::width().

Referenced by PLearn::Learner::computeTestStatistics(), and PLearn::Learner::test().

{
    int inputsize = data.width();
    init(inputsize);

    Vec input(inputsize);
    StatsItArray unfinished = *this;

    while(unfinished.size()>0)
    {
        for(int i=0; i<data.length(); i++)
        {
            data->getRow(i,input);
            unfinished.update(input);
        }
        unfinished = finish();
    }

    return getResults();
}

Here is the call graph for this function:

Here is the caller graph for this function:

StatsItArray PLearn::StatsItArray::finish ( )

returns an array of those that are not yet finished

Definition at line 790 of file StatsIterator.cc.

References PLearn::TVec< T >::append(), and PLearn::TVec< StatsIt >::size().

Referenced by computeStats(), and PLearn::Learner::test().

{
    StatsItArray unfinished;
    for(int k=0; k<size(); k++)
        if ( ! (*this)[k]->finish() )
            unfinished.append((*this)[k]);
    return unfinished;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Array< Vec > PLearn::StatsItArray::getResults ( )

Definition at line 799 of file StatsIterator.cc.

References PLearn::TVec< StatsIt >::size().

Referenced by computeStats(), and PLearn::Learner::test().

{
    Array<Vec> results(size());
    for(int k=0; k<size(); k++)
        results[k] = (*this)[k]->getResult();
    return results;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::StatsItArray::init ( int  inputsize)

Definition at line 761 of file StatsIterator.cc.

References PLearn::TVec< StatsIt >::size().

Referenced by computeStats(), and PLearn::Learner::test().

{
    for(int k=0; k<size(); k++)
        (*this)[k]->init(inputsize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

StatsItArray PLearn::StatsItArray::operator& ( const StatsIt v) const [inline]

Definition at line 392 of file StatsIterator.h.

References PLearn::operator&().

    { return PLearn::operator&(*this,v); }

Here is the call graph for this function:

StatsItArray PLearn::StatsItArray::operator& ( const StatsItArray va) const [inline]

Definition at line 394 of file StatsIterator.h.

References PLearn::operator&().

    { return PLearn::operator&(*this,va); }

Here is the call graph for this function:

StatsItArray& PLearn::StatsItArray::operator&= ( const StatsItArray va) [inline]

Definition at line 390 of file StatsIterator.h.

References PLearn::operator&=().

    { PLearn::operator&=(*this,va); return *this; }

Here is the call graph for this function:

StatsItArray& PLearn::StatsItArray::operator&= ( const StatsIt v) [inline]

Definition at line 388 of file StatsIterator.h.

References PLearn::operator&=().

    { PLearn::operator&=(*this,v); return *this;}

Here is the call graph for this function:

bool PLearn::StatsItArray::requiresMultiplePasses ( )

returns true if any of the StatsIterator in the array requires more than one pass through the data

Definition at line 781 of file StatsIterator.cc.

References PLearn::TVec< StatsIt >::size().

Referenced by PLearn::Learner::test().

{
    for(int k=0; k<size(); k++)
        if ( (*this)[k]->requiresMultiplePasses() )
            return true;
    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::StatsItArray::update ( const Vec input)

Definition at line 767 of file StatsIterator.cc.

References PLearn::TVec< StatsIt >::size().

Referenced by computeStats(), PLearn::Learner::test(), and update().

{
    for(int k=0; k<size(); k++)
        (*this)[k]->update(input);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::StatsItArray::update ( const Mat inputs)

Definition at line 772 of file StatsIterator.cc.

References i, PLearn::TVec< StatsIt >::input(), PLearn::TMat< T >::length(), and update().

{
    for (int i=0;i<inputs.length();i++)
    {
        Vec input = inputs(i);
        update(input);
    }
}

Here is the call graph for this function:


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