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

The first sentence should be a BRIEF DESCRIPTION of what the class does. More...

#include <VMatViewCommand.h>

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

List of all members.

Public Member Functions

 VMatViewCommand ()
virtual void run (const std::vector< std::string > &args)
 The actual implementation of the 'VMatViewCommand' command.

Static Protected Attributes

static PLearnCommandRegistry reg_
 This allows to register the 'VMatViewCommand' command in the command registry.

Private Types

typedef PLearnCommand inherited

Detailed Description

The first sentence should be a BRIEF DESCRIPTION of what the class does.

Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html

Todo:
Write class to-do's here if there are any.
Deprecated:
Write deprecated stuff here if there is any. Indicate what else should be used instead.

Definition at line 58 of file VMatViewCommand.h.


Member Typedef Documentation

Definition at line 60 of file VMatViewCommand.h.


Constructor & Destructor Documentation

PLearn::VMatViewCommand::VMatViewCommand ( )

Definition at line 51 of file VMatViewCommand.cc.

    : PLearnCommand(
        "vmat_view",
        "interactive display of a vmatrix (curses-based)",
        "vmat view [--add,--sub,--diff,--mult,--div] <vmat> ...\n"
        "will interactively display contents of the \n"
        "specified vmatrix (any recognized file format)\n"
        )
{}

Member Function Documentation

void PLearn::VMatViewCommand::run ( const std::vector< std::string > &  args) [virtual]

The actual implementation of the 'VMatViewCommand' command.

Implements PLearn::PLearnCommand.

Definition at line 62 of file VMatViewCommand.cc.

References PLearn::endl(), PLearn::getDataSet(), i, PLERROR, PLearn::pout, PLearn::viewVMat(), and PLearn::vmat_view_dataset.

{
    string op;
    if(args[0]=="--add")
        op="add";
    else if(args[0]=="--sub" || args[0]=="--diff")
        op="sub";
    else if(args[0]=="--mult")
        op="mult";
    else if(args[0]=="--div")
        op="div";
    if(!op.empty()){
        if(args.size()!=3)
            PLERROR("Usage: vmat_view [--add,--sub,--diff,--mult,--div] <source1> ... \n"
                    "If an option is used their must be two sources matrix.");
        VMat vm = new BinaryOpVMatrix(getDataSet(args[1]),getDataSet(args[2]),op);
        viewVMat(vm, op);
        return;
    }

    for(uint i=0;i<args.size();i++){
        PPath vmat_view_dataset(args[i]);
        if(args.size()>1)
            pout<<vmat_view_dataset<<endl;
        VMat vm = getDataSet(vmat_view_dataset);
        viewVMat(vm, vmat_view_dataset);
    }
}

Here is the call graph for this function:


Member Data Documentation

This allows to register the 'VMatViewCommand' command in the command registry.

Definition at line 67 of file VMatViewCommand.h.


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