PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Private Types | Private Member Functions
PLearn::FilterSplitter Class Reference

#include <FilterSplitter.h>

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

List of all members.

Public Member Functions

 FilterSplitter ()
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual FilterSplitterdeepCopy (CopiesMap &copies) const
virtual int nsplits () const
 Returns the number of available different "splits".
virtual int nSetsPerSplit () const
 Returns the number of sets per split.
virtual TVec< VMatgetSplit (int i=0)
 Returns split number i.

Static Public Member Functions

static string _classname_ ()
 Declares name and deepCopy methods.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

TVec< string > filters
 The string that you would normally put inside the filter.
bool report_progress

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares this class' options.

Private Types

typedef Splitter inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 52 of file FilterSplitter.h.


Member Typedef Documentation

Reimplemented from PLearn::Splitter.

Definition at line 57 of file FilterSplitter.h.


Constructor & Destructor Documentation

PLearn::FilterSplitter::FilterSplitter ( )

Definition at line 50 of file FilterSplitter.cc.

    : report_progress(false)
{
}

Member Function Documentation

string PLearn::FilterSplitter::_classname_ ( ) [static]

Declares name and deepCopy methods.

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

OptionList & PLearn::FilterSplitter::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

RemoteMethodMap & PLearn::FilterSplitter::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

bool PLearn::FilterSplitter::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

Object * PLearn::FilterSplitter::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 58 of file FilterSplitter.cc.

StaticInitializer FilterSplitter::_static_initializer_ & PLearn::FilterSplitter::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

void PLearn::FilterSplitter::build ( ) [virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::Object.

Definition at line 92 of file FilterSplitter.cc.

References PLearn::Object::build(), and build_().

Here is the call graph for this function:

void PLearn::FilterSplitter::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::Object.

Definition at line 80 of file FilterSplitter.cc.

Referenced by build().

{
    // ### This method should do the real building of the object,
    // ### according to set 'options', in *any* situation.
    // ### Typical situations include:
    // ###  - Initial building of an object from a few user-specified options
    // ###  - Building of a "reloaded" object: i.e. from the complete set of all serialised options.
    // ###  - Updating or "re-building" of an object after a few "tuning" options have been modified.
    // ### You should assume that the parent class' build_() has already been called.
}

Here is the caller graph for this function:

string PLearn::FilterSplitter::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 58 of file FilterSplitter.cc.

void PLearn::FilterSplitter::declareOptions ( OptionList ol) [static, protected]

Declares this class' options.

Reimplemented from PLearn::Splitter.

Definition at line 60 of file FilterSplitter.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Splitter::declareOptions(), filters, and report_progress.

{
    // ### Declare all of this object's options here
    // ### For the "flags" of each option, you should typically specify
    // ### one of OptionBase::buildoption, OptionBase::learntoption or
    // ### OptionBase::tuningoption. Another possible flag to be combined with
    // ### is OptionBase::nosave

    declareOption(ol, "filters", &FilterSplitter::filters, OptionBase::buildoption,
                  "array of strings: The VPL code for each set that should produce a single scalar\n"
                  ", indicating whether we should keep the line (if the produced scalar is non zero)\n"
                  "or throw it away (if it's zero)");

    declareOption(ol, "report_progress", &FilterSplitter::report_progress, OptionBase::buildoption,
                  "Whether to report or not the progress in filtering.");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::FilterSplitter::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Splitter.

Definition at line 106 of file FilterSplitter.h.

FilterSplitter * PLearn::FilterSplitter::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Splitter.

Definition at line 58 of file FilterSplitter.cc.

OptionList & PLearn::FilterSplitter::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 58 of file FilterSplitter.cc.

OptionMap & PLearn::FilterSplitter::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 58 of file FilterSplitter.cc.

RemoteMethodMap & PLearn::FilterSplitter::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 58 of file FilterSplitter.cc.

TVec< VMat > PLearn::FilterSplitter::getSplit ( int  i = 0) [virtual]

Returns split number i.

Implements PLearn::Splitter.

Definition at line 119 of file FilterSplitter.cc.

References PLearn::TVec< T >::append(), PLearn::Splitter::dataset, filters, i, PLearn::TVec< T >::length(), PLearn::newFilename(), PLERROR, and report_progress.

{
    if (k != 0) PLERROR("This splitter will only create a single split");
    // ### Build and return the kth split
    TVec<VMat> splitsets;
    for (int i=0; i<filters.length(); i++) {
        splitsets.append(new FilteredVMatrix(dataset, filters[i], newFilename("/tmp", "filtered_vmatrix_temp_dir_", true), report_progress));
    }
    return splitsets;
}

Here is the call graph for this function:

void PLearn::FilterSplitter::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Splitter.

Definition at line 98 of file FilterSplitter.cc.

References PLearn::deepCopyField(), filters, and PLearn::Splitter::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:

int PLearn::FilterSplitter::nSetsPerSplit ( ) const [virtual]

Returns the number of sets per split.

Implements PLearn::Splitter.

Definition at line 110 of file FilterSplitter.cc.

References filters, and PLearn::TVec< T >::length().

{
    // ### Return the number of sets per split
    return filters.length();
}

Here is the call graph for this function:

int PLearn::FilterSplitter::nsplits ( ) const [virtual]

Returns the number of available different "splits".

Implements PLearn::Splitter.

Definition at line 104 of file FilterSplitter.cc.

{
    // ### Return the number of available splits
    return 1;
}

Member Data Documentation

Reimplemented from PLearn::Splitter.

Definition at line 106 of file FilterSplitter.h.

The string that you would normally put inside the filter.

Definition at line 71 of file FilterSplitter.h.

Referenced by declareOptions(), getSplit(), makeDeepCopyFromShallowCopy(), and nSetsPerSplit().

Definition at line 73 of file FilterSplitter.h.

Referenced by declareOptions(), and getSplit().


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