PLearn 0.1
Public Member Functions | Protected Attributes
PLearn::SDBVMSource Class Reference

A SDBVMSource represents a source for a value that can be either directly a field from a SDB or an already processed SDBVMField. More...

#include <SDBVMat.h>

Collaboration diagram for PLearn::SDBVMSource:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SDBVMSource (FieldPtr the_sdbfieldptr)
 SDBVMSource (PSDBVMField the_sdbvmfieldptr)
FieldValue getValue (const SDBWithStats &sdb, const Row &row) const
 to get the value of this source
const FieldStatgetFieldStat (const SDBWithStats &sdb, const Row &row) const
 to get the statistics for this source (works only if the source is a FieldPtr, produces an error if it's a PSDBVMField)

Protected Attributes

FieldPtr sdbfieldptr
PSDBVMField sdbvmfieldptr
Vec output

Detailed Description

A SDBVMSource represents a source for a value that can be either directly a field from a SDB or an already processed SDBVMField.

Definition at line 202 of file SDBVMat.h.


Constructor & Destructor Documentation

PLearn::SDBVMSource::SDBVMSource ( FieldPtr  the_sdbfieldptr) [inline]

Definition at line 210 of file SDBVMat.h.

        :sdbfieldptr(the_sdbfieldptr) {}
PLearn::SDBVMSource::SDBVMSource ( PSDBVMField  the_sdbvmfieldptr) [inline]

Definition at line 213 of file SDBVMat.h.

References PLERROR.

        :sdbvmfieldptr(the_sdbvmfieldptr), 
         output(1)
    {
        if(sdbvmfieldptr->fieldWidth()!=1)
            PLERROR("Can't make a SDBVMSource from a SDBVMField whose width is other than 1");
    }

Member Function Documentation

const FieldStat& PLearn::SDBVMSource::getFieldStat ( const SDBWithStats sdb,
const Row row 
) const [inline]

to get the statistics for this source (works only if the source is a FieldPtr, produces an error if it's a PSDBVMField)

Definition at line 235 of file SDBVMat.h.

References PLearn::SDBWithStats::getStat(), and PLERROR.

Referenced by PLearn::SDBVMFieldDivSigma::convertField(), and PLearn::SDBVMFieldNormalize::convertField().

    {
        if(!sdbfieldptr)
            PLERROR("works only if the source is a FieldPtr");
        return sdb.getStat(sdbfieldptr.field_index());
    }

Here is the call graph for this function:

Here is the caller graph for this function:

FieldValue PLearn::SDBVMSource::getValue ( const SDBWithStats sdb,
const Row row 
) const [inline]

Member Data Documentation

Definition at line 207 of file SDBVMat.h.

Definition at line 205 of file SDBVMat.h.

Definition at line 206 of file SDBVMat.h.


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