Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::VVec Class Reference

A VVec is a reference to a row or part of a row (a subrow) of a VMatrix. More...

#include <VVec.h>

Inheritance diagram for PLearn::VVec:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VVec ()
 VVec (const PP< VMatrix > &m, int i)
 VVec (const PP< VMatrix > &m, int i, int j, int l)
 VVec (const Vec &v)
 constructor from Vec Will build a MemoryVMatrix containing a view of v as its single row and have the VVec point to it.

int length () const
int size () const
void toVec (const Vec &v) const
void copyFrom (const Vec &v) const
 copies v into into this VVec

VVec subVec (int j, int len)
 operator Vec () const
 conversion to Vec

virtual void print (ostream &out) const
 PLEARN_DECLARE_OBJECT (VVec)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().


Static Public Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Public Attributes

PP< VMatrixdata
int row_index
int col_index
int length_

Private Types

typedef Object inherited

Private Member Functions

void build_ ()

Detailed Description

A VVec is a reference to a row or part of a row (a subrow) of a VMatrix.

Definition at line 54 of file VVec.h.


Member Typedef Documentation

typedef Object PLearn::VVec::inherited [private]
 

Reimplemented from PLearn::Object.

Definition at line 56 of file VVec.h.


Constructor & Destructor Documentation

PLearn::VVec::VVec  )  [inline]
 

Definition at line 66 of file VVec.h.

References col_index, length_, and row_index.

Referenced by subVec().

PLearn::VVec::VVec const PP< VMatrix > &  m,
int  i
[inline]
 

Definition at line 69 of file VVec.h.

References col_index, data, length_, and row_index.

PLearn::VVec::VVec const PP< VMatrix > &  m,
int  i,
int  j,
int  l
[inline]
 

Definition at line 72 of file VVec.h.

References col_index, data, length_, and row_index.

PLearn::VVec::VVec const Vec v  ) 
 

constructor from Vec Will build a MemoryVMatrix containing a view of v as its single row and have the VVec point to it.

So data will be shared with v.

Definition at line 49 of file VVec.cc.

References PLearn::rowmatrix(), and PLearn::Vec.


Member Function Documentation

void PLearn::VVec::build  )  [virtual]
 

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 55 of file VVec.cc.

References build_().

void PLearn::VVec::build_  )  [private]
 

This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build() method, and possibly the public virtual read method (which calls its parent's read). build_() can assume that it's parent's build_ has already been called.

Reimplemented from PLearn::Object.

Definition at line 62 of file VVec.cc.

Referenced by build().

void PLearn::VVec::copyFrom const Vec v  )  const [inline]
 

copies v into into this VVec

Definition at line 95 of file VVec.h.

References col_index, copyFrom(), data, PLearn::TVec< T >::length(), length_, PLERROR, and row_index.

Referenced by copyFrom(), PLearn::operator<<(), and PLearn::operator>>().

void PLearn::VVec::declareOptions OptionList ol  )  [static]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::Object.

Definition at line 67 of file VVec.cc.

References PLearn::declareOption(), and PLearn::OptionList.

int PLearn::VVec::length  )  const [inline]
 

Definition at line 80 of file VVec.h.

References length_.

Referenced by PLearn::Learner::computeCostsFromOutputs(), and PLearn::Learner::computeOutput().

PLearn::VVec::operator Vec  )  const [inline]
 

conversion to Vec

Definition at line 109 of file VVec.h.

References col_index, data, length_, and row_index.

PLearn::VVec::PLEARN_DECLARE_OBJECT VVec   ) 
 

virtual void PLearn::VVec::print ostream &  out  )  const [inline, virtual]
 

Prints a human-readable, short (not necessarily complete) description of this object instance (default prints info()). This is what is called by operator<< on Object

Reimplemented from PLearn::Object.

Definition at line 116 of file VVec.h.

References PLearn::flush().

int PLearn::VVec::size  )  const [inline]
 

Definition at line 81 of file VVec.h.

References length_.

VVec PLearn::VVec::subVec int  j,
int  len
[inline]
 

Definition at line 105 of file VVec.h.

References col_index, data, row_index, subVec(), and VVec().

Referenced by subVec().

void PLearn::VVec::toVec const Vec v  )  const [inline]
 

Definition at line 85 of file VVec.h.

References col_index, data, PLearn::TVec< T >::length(), length_, PLERROR, row_index, and toVec().

Referenced by PLearn::operator<<(), PLearn::operator>>(), and toVec().


Member Data Documentation

int PLearn::VVec::col_index
 

Definition at line 63 of file VVec.h.

Referenced by copyFrom(), operator Vec(), subVec(), toVec(), and VVec().

PP<VMatrix> PLearn::VVec::data
 

Definition at line 61 of file VVec.h.

Referenced by copyFrom(), operator Vec(), subVec(), toVec(), and VVec().

int PLearn::VVec::length_
 

Definition at line 64 of file VVec.h.

Referenced by copyFrom(), length(), operator Vec(), size(), toVec(), and VVec().

int PLearn::VVec::row_index
 

Definition at line 62 of file VVec.h.

Referenced by copyFrom(), operator Vec(), subVec(), toVec(), and VVec().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:04 2004 for PLearn by doxygen 1.3.7